stage4/generate_c/st_code_gen.c
author laurent
Tue, 01 Sep 2009 17:01:08 +0200
changeset 199 b075f28ec081
parent 169 bea932bc60b0
child 208 c72748a12ae3
permissions -rw-r--r--
Bug with type conversion EN/ENO not evaluated fixed
Removing some warnings in iec_std_lib.h
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     1
/*
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
     2
 * (c) 2008 Edouard TISSERANT
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     3
 *
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     4
 * Offered to the public under the terms of the GNU General Public License
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     5
 * as published by the Free Software Foundation; either version 2 of the
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     6
 * License, or (at your option) any later version.
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     7
 *
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     8
 * This program is distributed in the hope that it will be useful, but
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
     9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    11
 * Public License for more details.
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    12
 *
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    13
 * This code is made available on the understanding that it will not be
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    14
 * used in safety-critical situations without a full and competent review.
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    15
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    16
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    17
/*
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    18
 * An IEC 61131-3 IL and ST compiler.
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    19
 *
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    20
 * Based on the
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    21
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    22
 *
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    23
 */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    24
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    25
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    26
 * IEC 61131-3 standard function library
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    27
 * generated code, do not edit by hand
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    28
 */
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    29
 
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    30
 
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    31
switch(current_function_type){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    32
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
    33
/****
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    34
 *REAL_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    35
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    36
    case function_real_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    37
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    38
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    39
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    40
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    41
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    42
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    43
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    44
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    45
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    46
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    47
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    48
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    49
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    50
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    51
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    52
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    53
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    54
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    55
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    56
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
    57
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    58
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    59
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    60
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    61
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    62
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    63
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
    64
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    65
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    66
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    67
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    68
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    69
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    70
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    71
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    72
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    73
    }/*function_real_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    74
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    75
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    76
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    77
 *REAL_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    78
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    79
    case function_real_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    80
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    81
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    82
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    83
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    84
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    85
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    86
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    87
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    88
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    89
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    90
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    91
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    92
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    93
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    94
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    95
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    96
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    97
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    98
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    99
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   100
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   101
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   102
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   103
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   104
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   105
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   106
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   107
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   108
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   109
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   110
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   111
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   112
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   113
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   114
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   115
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   116
    }/*function_real_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   117
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   118
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   119
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   120
 *REAL_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   121
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   122
    case function_real_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   123
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   124
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   125
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   126
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   127
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   128
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   129
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   130
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   131
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   132
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   133
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   134
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   135
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   136
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   137
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   138
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   139
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   140
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   141
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   142
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   143
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   144
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   145
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   146
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   147
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   148
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   149
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   150
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   151
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   152
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   153
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   154
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   155
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   156
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   157
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   158
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   159
    }/*function_real_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   160
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   161
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   162
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   163
 *REAL_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   164
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   165
    case function_real_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   166
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   167
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   168
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   169
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   170
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   171
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   172
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   173
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   174
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   175
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   176
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   177
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   178
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   179
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   180
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   181
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   182
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   183
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   184
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   185
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   186
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   187
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   188
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   189
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   190
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   191
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   192
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   193
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   194
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   195
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   196
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   197
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   198
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   199
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   200
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   201
    }/*function_real_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   202
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   203
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   204
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   205
 *REAL_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   206
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   207
    case function_real_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   208
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   209
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   210
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   211
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   212
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   213
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   214
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   215
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   216
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   217
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   218
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   219
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   220
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   221
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   222
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   223
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   224
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   225
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   226
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   227
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   228
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   229
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   230
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   231
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   232
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   233
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   234
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   235
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   236
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   237
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   238
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   239
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   240
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   241
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   242
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   243
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   244
    }/*function_real_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   245
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   246
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   247
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   248
 *REAL_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   249
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   250
    case function_real_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   251
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   252
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   253
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   254
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   255
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   256
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   257
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   258
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   259
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   260
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   261
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   262
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   263
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   264
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   265
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   266
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   267
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   268
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   269
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   270
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   271
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   272
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   273
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   274
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   275
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   276
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   277
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   278
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   279
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   280
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   281
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   282
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   283
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   284
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   285
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   286
    }/*function_real_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   287
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   288
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   289
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   290
 *REAL_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   291
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   292
    case function_real_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   293
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   294
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   295
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   296
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   297
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   298
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   299
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   300
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   301
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   302
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   303
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   304
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   305
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   306
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   307
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   308
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   309
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   310
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   311
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   312
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   313
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   314
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   315
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   316
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   317
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   318
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   319
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   320
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   321
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   322
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   323
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   324
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   325
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   326
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   327
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   328
    }/*function_real_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   329
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   330
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   331
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   332
 *REAL_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   333
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   334
    case function_real_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   335
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   336
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   337
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   338
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   339
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   340
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   341
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   342
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   343
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   344
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   345
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   346
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   347
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   348
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   349
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   350
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   351
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   352
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   353
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   354
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   355
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   356
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   357
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   358
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   359
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   360
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   361
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   362
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   363
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   364
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   365
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   366
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   367
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   368
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   369
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   370
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   371
    }/*function_real_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   372
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   373
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   374
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   375
 *REAL_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   376
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   377
    case function_real_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   378
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   379
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   380
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   381
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   382
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   383
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   384
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   385
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   386
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   387
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   388
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   389
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   390
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   391
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   392
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   393
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   394
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   395
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   396
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   397
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   398
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   399
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   400
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   401
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   402
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   403
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   404
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   405
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   406
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   407
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   408
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   409
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   410
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   411
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   412
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   413
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   414
    }/*function_real_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   415
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   416
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   417
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   418
 *REAL_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   419
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   420
    case function_real_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   421
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   422
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   423
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   424
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   425
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   426
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   427
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   428
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   429
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   430
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   431
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   432
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   433
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   434
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   435
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   436
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   437
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   438
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   439
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   440
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   441
                function_name = (symbol_c*)(new pragma_c("__real_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   442
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   443
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   444
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   445
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   446
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   447
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   448
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   449
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   450
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   451
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   452
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   453
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   454
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   455
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   456
    }/*function_real_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   457
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   458
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   459
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   460
 *REAL_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   461
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   462
    case function_real_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   463
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   464
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   465
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   466
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   467
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   468
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   469
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   470
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   471
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   472
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   473
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   474
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   475
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   476
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   477
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   478
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   479
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   480
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   481
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   482
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   483
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   484
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   485
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   486
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   487
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   488
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   489
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   490
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   491
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   492
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   493
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   494
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   495
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   496
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   497
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   498
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   499
    }/*function_real_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   500
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   501
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   502
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   503
 *REAL_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   504
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   505
    case function_real_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   506
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   507
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   508
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   509
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   510
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   511
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   512
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   513
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   514
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   515
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   516
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   517
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   518
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   519
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   520
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   521
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   522
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   523
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   524
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   525
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   526
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   527
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   528
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   529
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   530
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   531
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   532
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   533
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   534
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   535
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   536
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   537
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   538
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   539
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   540
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   541
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   542
    }/*function_real_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   543
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   544
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   545
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   546
 *REAL_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   547
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   548
    case function_real_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   549
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   550
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   551
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   552
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   553
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   554
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   555
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   556
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   557
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   558
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   559
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   560
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   561
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   562
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   563
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   564
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   565
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   566
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   567
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   568
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   569
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   570
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   571
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   572
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   573
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   574
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   575
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   576
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   577
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   578
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   579
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   580
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   581
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   582
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   583
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   584
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   585
    }/*function_real_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   586
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   587
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   588
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   589
 *REAL_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   590
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   591
    case function_real_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   592
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   593
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   594
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   595
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   596
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   597
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   598
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   599
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   600
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   601
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   602
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   603
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   604
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   605
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   606
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   607
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   608
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   609
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   610
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   611
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   612
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   613
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   614
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   615
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   616
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   617
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   618
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   619
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   620
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   621
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   622
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   623
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   624
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   625
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   626
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   627
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   628
    }/*function_real_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   629
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   630
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   631
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   632
 *REAL_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   633
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   634
    case function_real_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   635
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   636
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   637
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   638
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   639
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   640
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   641
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   642
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   643
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   644
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   645
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   646
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   647
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   648
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   649
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   650
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   651
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   652
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   653
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   654
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   655
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   656
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   657
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   658
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   659
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   660
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   661
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   662
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   663
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   664
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   665
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   666
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   667
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   668
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   669
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   670
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   671
    }/*function_real_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   672
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   673
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   674
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   675
 *REAL_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   676
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   677
    case function_real_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   678
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   679
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   680
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   681
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   682
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   683
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   684
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   685
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   686
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   687
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   688
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   689
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   690
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   691
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   692
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   693
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   694
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   695
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   696
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   697
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   698
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   699
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   700
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   701
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   702
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   703
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   704
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   705
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   706
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   707
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   708
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   709
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   710
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   711
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   712
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   713
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   714
    }/*function_real_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   715
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   716
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   717
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   718
 *REAL_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   719
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   720
    case function_real_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   721
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   722
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   723
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   724
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   725
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   726
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   727
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   728
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   729
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   730
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   731
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   732
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   733
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   734
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   735
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   736
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   737
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   738
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   739
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   740
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   741
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   742
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   743
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   744
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   745
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   746
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   747
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   748
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   749
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   750
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   751
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   752
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   753
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   754
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   755
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   756
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   757
    }/*function_real_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   758
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   759
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   760
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   761
 *REAL_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   762
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   763
    case function_real_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   764
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   765
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   766
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   767
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   768
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   769
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   770
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   771
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   772
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   773
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   774
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   775
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   776
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   777
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   778
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   779
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   780
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   781
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   782
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   783
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   784
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   785
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   786
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   787
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   788
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   789
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   790
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   791
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   792
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   793
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   794
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   795
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   796
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   797
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   798
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   799
    }/*function_real_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   800
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   801
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   802
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   803
 *REAL_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   804
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   805
    case function_real_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   806
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   807
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   808
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   809
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   810
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   811
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   812
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   813
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   814
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   815
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   816
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   817
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   818
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   819
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   820
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   821
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   822
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   823
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   824
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   825
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   826
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   827
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   828
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   829
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   830
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   831
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   832
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   833
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   834
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   835
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   836
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   837
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   838
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   839
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   840
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   841
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   842
    }/*function_real_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   843
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   844
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   845
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   846
 *SINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   847
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   848
    case function_sint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   849
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   850
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   851
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   852
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   853
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   854
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   855
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   856
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   857
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   858
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   859
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   860
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   861
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   862
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   863
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   864
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   865
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   866
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   867
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   868
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   869
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   870
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   871
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   872
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   873
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   874
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   875
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   876
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   877
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   878
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   879
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   880
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   881
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   882
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   883
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   884
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   885
    }/*function_sint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   886
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   887
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   888
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   889
 *SINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   890
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   891
    case function_sint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   892
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   893
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   894
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   895
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   896
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   897
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   898
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   899
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   900
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   901
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   902
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   903
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   904
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   905
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   906
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   907
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   908
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   909
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   910
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   911
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   912
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   913
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   914
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   915
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   916
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   917
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   918
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   919
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   920
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   921
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   922
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   923
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   924
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   925
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   926
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   927
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   928
    }/*function_sint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   929
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   930
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   931
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   932
 *SINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   933
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   934
    case function_sint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   935
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   936
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   937
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   938
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   939
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   940
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   941
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   942
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   943
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   944
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   945
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   946
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   947
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   948
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   949
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   950
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   951
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   952
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   953
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   954
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   955
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   956
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   957
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   958
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   959
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   960
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   961
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
   962
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   963
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   964
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   965
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   966
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   967
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   968
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   969
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   970
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   971
    }/*function_sint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   972
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   973
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   974
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   975
 *SINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   976
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   977
    case function_sint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   978
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   979
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   980
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   981
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   982
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   983
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   984
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   985
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   986
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   987
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   988
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   989
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   990
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   991
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   992
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   993
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   994
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   995
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   996
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   997
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   998
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   999
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1000
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1001
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1002
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1003
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1004
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1005
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1006
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1007
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1008
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1009
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1010
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1011
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1012
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1013
    }/*function_sint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1014
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1015
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1016
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1017
 *SINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1018
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1019
    case function_sint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1020
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1021
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1022
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1023
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1024
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1025
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1026
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1027
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1028
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1029
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1030
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1031
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1032
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1033
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1034
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1035
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1036
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1037
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1038
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1039
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1040
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1041
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1042
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1043
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1044
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1045
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1046
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1047
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1048
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1049
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1050
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1051
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1052
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1053
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1054
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1055
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1056
    }/*function_sint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1057
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1058
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1059
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1060
 *SINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1061
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1062
    case function_sint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1063
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1064
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1065
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1066
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1067
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1068
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1069
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1070
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1071
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1072
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1073
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1074
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1075
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1076
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1077
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1078
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1079
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1080
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1081
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1082
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1083
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1084
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1085
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1086
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1087
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1088
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1089
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1090
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1091
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1092
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1093
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1094
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1095
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1096
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1097
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1098
    }/*function_sint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1099
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1100
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1101
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1102
 *SINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1103
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1104
    case function_sint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1105
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1106
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1107
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1108
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1109
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1110
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1111
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1112
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1113
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1114
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1115
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1116
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1117
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1118
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1119
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1120
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1121
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1122
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1123
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1124
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1125
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1126
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1127
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1128
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1129
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1130
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1131
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1132
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1133
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1134
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1135
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1136
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1137
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1138
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1139
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1140
    }/*function_sint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1141
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1142
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1143
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1144
 *SINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1145
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1146
    case function_sint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1147
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1148
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1150
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1151
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1152
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1153
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1154
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1155
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1156
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1157
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1158
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1159
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1160
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1161
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1162
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1163
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1164
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1165
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1166
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1167
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1168
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1169
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1170
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1171
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1172
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1173
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1174
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1175
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1176
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1177
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1178
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1179
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1180
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1181
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1182
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1183
    }/*function_sint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1184
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1185
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1186
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1187
 *SINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1188
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1189
    case function_sint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1190
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1191
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1192
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1193
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1194
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1195
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1196
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1197
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1198
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1199
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1200
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1201
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1202
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1203
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1204
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1205
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1206
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1207
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1208
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1209
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1210
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1211
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1212
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1213
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1214
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1215
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1216
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1217
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1218
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1219
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1220
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1221
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1222
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1223
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1224
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1225
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1226
    }/*function_sint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1227
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1228
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1229
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1230
 *SINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1231
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1232
    case function_sint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1233
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1234
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1235
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1236
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1237
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1238
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1239
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1240
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1241
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1242
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1243
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1244
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1245
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1246
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1247
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1248
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1249
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1250
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1251
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1252
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1253
                function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1254
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1255
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1256
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1257
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1258
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1259
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1260
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1261
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1262
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1263
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1264
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1265
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1266
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1267
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1268
    }/*function_sint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1269
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1270
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1271
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1272
 *SINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1273
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1274
    case function_sint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1275
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1276
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1277
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1278
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1279
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1280
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1281
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1282
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1283
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1284
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1285
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1286
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1287
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1288
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1289
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1290
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1291
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1292
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1293
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1294
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1295
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1296
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1297
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1298
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1299
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1300
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1301
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1302
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1303
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1304
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1305
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1306
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1307
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1308
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1309
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1310
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1311
    }/*function_sint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1312
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1313
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1314
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1315
 *SINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1316
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1317
    case function_sint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1318
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1319
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1320
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1321
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1322
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1323
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1324
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1325
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1326
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1327
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1328
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1329
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1330
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1331
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1332
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1333
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1334
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1335
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1336
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1337
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1338
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1339
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1340
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1341
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1342
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1343
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1344
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1345
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1346
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1347
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1348
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1349
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1350
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1351
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1352
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1353
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1354
    }/*function_sint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1355
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1356
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1357
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1358
 *SINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1359
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1360
    case function_sint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1361
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1362
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1363
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1364
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1365
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1366
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1367
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1368
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1369
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1370
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1371
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1372
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1373
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1374
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1375
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1376
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1377
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1378
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1379
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1380
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1381
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1382
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1383
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1384
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1385
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1386
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1387
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1388
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1389
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1390
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1391
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1392
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1393
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1394
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1395
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1396
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1397
    }/*function_sint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1398
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1399
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1400
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1401
 *SINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1402
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1403
    case function_sint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1404
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1405
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1406
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1407
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1408
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1409
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1410
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1411
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1412
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1413
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1414
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1415
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1416
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1417
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1418
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1419
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1420
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1421
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1422
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1423
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1424
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1425
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1426
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1427
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1428
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1429
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1430
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1431
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1432
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1433
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1434
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1435
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1436
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1437
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1438
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1439
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1440
    }/*function_sint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1441
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1442
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1443
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1444
 *SINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1445
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1446
    case function_sint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1447
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1448
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1449
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1450
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1451
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1452
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1453
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1454
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1455
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1456
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1457
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1458
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1459
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1460
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1461
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1462
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1463
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1464
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1465
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1466
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1467
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1468
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1469
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1470
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1471
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1472
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1473
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1474
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1475
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1476
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1477
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1478
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1479
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1480
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1481
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1482
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1483
    }/*function_sint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1484
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1485
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1486
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1487
 *SINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1488
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1489
    case function_sint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1490
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1491
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1492
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1493
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1494
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1495
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1496
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1497
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1498
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1499
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1500
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1501
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1502
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1503
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1504
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1505
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1506
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1507
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1508
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1509
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1510
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1511
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1512
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1513
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1514
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1515
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1516
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1517
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1518
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1519
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1520
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1521
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1522
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1523
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1524
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1525
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1526
    }/*function_sint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1527
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1528
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1529
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1530
 *SINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1531
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1532
    case function_sint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1533
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1534
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1535
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1536
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1537
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1538
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1539
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1540
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1541
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1542
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1543
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1544
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1545
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1546
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1547
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1548
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1549
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1550
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1551
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1552
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1553
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1554
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1555
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1556
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1557
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1558
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1559
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1560
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1561
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1562
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1563
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1564
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1565
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1566
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1567
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1568
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1569
    }/*function_sint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1570
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1571
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1572
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1573
 *SINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1574
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1575
    case function_sint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1576
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1577
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1578
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1579
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1580
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1581
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1582
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1583
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1584
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1585
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1586
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1587
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1588
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1589
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1590
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1591
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1592
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1593
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1594
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1595
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1596
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1597
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1598
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1599
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1600
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1601
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1602
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1603
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1604
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1605
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1606
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1607
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1608
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1609
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1610
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1611
    }/*function_sint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1612
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1613
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1614
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1615
 *SINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1616
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1617
    case function_sint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1618
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1619
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1620
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1621
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1622
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1623
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1624
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1625
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1626
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1627
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1628
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1629
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1630
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1631
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1632
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1633
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1634
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1635
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1636
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1637
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1638
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1639
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1640
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1641
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1642
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1643
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1644
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1645
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1646
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1647
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1648
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1649
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1650
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1651
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1652
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1653
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1654
    }/*function_sint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1655
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1656
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1657
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1658
 *LINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1659
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1660
    case function_lint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1661
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1662
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1663
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1664
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1665
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1666
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1667
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1668
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1669
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1670
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1671
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1672
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1673
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1674
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1675
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1676
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1677
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1678
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1679
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1680
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1681
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1682
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1683
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1684
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1685
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1686
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1687
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1688
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1689
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1690
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1691
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1692
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1693
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1694
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1695
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1696
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1697
    }/*function_lint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1698
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1699
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1700
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1701
 *LINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1702
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1703
    case function_lint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1704
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1705
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1706
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1707
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1708
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1709
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1710
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1711
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1712
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1713
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1714
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1715
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1716
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1717
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1718
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1719
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1720
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1721
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1722
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1723
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1724
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1725
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1726
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1727
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1728
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1729
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1730
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1731
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1732
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1733
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1734
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1735
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1736
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1737
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1738
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1739
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1740
    }/*function_lint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1741
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1742
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1743
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1744
 *LINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1745
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1746
    case function_lint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1747
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1748
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1749
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1750
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1751
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1752
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1753
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1754
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1755
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1756
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1757
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1758
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1759
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1760
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1761
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1762
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1763
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1764
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1765
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1766
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1767
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1768
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1769
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1770
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1771
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1772
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1773
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1774
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1775
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1776
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1777
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1778
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1779
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1780
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1781
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1782
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1783
    }/*function_lint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1784
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1785
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1786
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1787
 *LINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1788
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1789
    case function_lint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1790
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1791
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1792
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1793
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1794
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1795
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1796
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1797
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1798
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1799
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1800
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1801
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1802
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1803
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1804
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1805
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1806
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1807
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1808
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1809
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1810
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1811
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1812
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1813
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1814
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1815
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1816
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1817
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1818
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1819
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1820
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1821
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1822
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1823
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1824
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1825
    }/*function_lint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1826
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1827
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1828
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1829
 *LINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1830
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1831
    case function_lint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1832
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1833
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1834
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1835
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1836
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1837
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1838
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1839
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1840
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1841
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1842
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1843
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1844
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1845
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1846
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1847
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1848
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1849
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1850
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1851
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1852
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1853
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1854
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1855
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1856
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1857
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1858
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1859
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1860
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1861
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1862
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1863
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1864
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1865
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1866
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1867
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1868
    }/*function_lint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1869
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1870
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1871
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1872
 *LINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1873
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1874
    case function_lint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1875
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1876
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1877
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1878
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1879
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1880
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1881
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1882
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1883
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1884
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1885
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1886
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1887
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1888
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1889
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1890
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1891
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1892
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1893
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1894
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1895
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1896
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1897
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1898
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1899
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1900
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1901
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1902
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1903
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1904
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1905
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1906
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1907
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1908
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1909
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1910
    }/*function_lint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1911
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1912
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1913
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1914
 *LINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1915
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1916
    case function_lint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1917
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1918
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1919
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1920
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1921
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1922
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1923
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1924
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1925
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1926
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1927
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1928
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1929
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1930
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1931
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1932
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1933
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1934
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1935
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1936
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1937
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1938
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1939
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1940
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1941
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1942
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1943
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1944
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1945
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1946
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1947
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1948
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1949
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1950
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1951
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1952
    }/*function_lint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1953
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1954
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1955
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1956
 *LINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1957
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1958
    case function_lint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1959
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1960
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1961
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1962
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1963
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1964
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1965
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1966
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1967
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1968
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1969
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1970
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1971
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1972
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1973
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1974
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1975
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1976
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1977
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1978
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1979
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1980
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1981
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1982
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1983
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1984
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1985
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  1986
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1987
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1988
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1989
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1990
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1991
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1992
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1993
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1994
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1995
    }/*function_lint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1996
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1997
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1998
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1999
 *LINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2000
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2001
    case function_lint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2002
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2003
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2004
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2005
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2006
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2007
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2008
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2009
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2010
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2011
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2012
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2013
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2014
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2015
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2016
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2017
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2018
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2019
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2020
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2021
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2022
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2023
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2024
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2025
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2026
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2027
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2028
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2029
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2030
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2031
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2032
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2033
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2034
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2035
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2036
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2037
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2038
    }/*function_lint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2039
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2040
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2041
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2042
 *LINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2043
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2044
    case function_lint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2045
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2046
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2047
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2048
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2049
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2050
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2051
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2052
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2053
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2054
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2055
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2056
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2057
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2058
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2059
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2060
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2061
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2062
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2063
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2064
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2065
                function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2066
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2067
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2068
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2069
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2070
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2071
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2072
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2073
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2074
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2075
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2076
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2077
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2078
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2079
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2080
    }/*function_lint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2081
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2082
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2083
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2084
 *LINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2085
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2086
    case function_lint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2087
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2088
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2089
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2090
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2091
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2092
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2093
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2094
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2095
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2096
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2097
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2098
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2099
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2100
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2101
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2102
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2103
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2104
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2105
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2106
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2107
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2108
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2109
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2110
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2111
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2112
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2113
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2114
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2115
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2116
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2117
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2118
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2119
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2120
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2121
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2122
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2123
    }/*function_lint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2124
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2125
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2126
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2127
 *LINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2128
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2129
    case function_lint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2130
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2131
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2132
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2133
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2134
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2135
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2136
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2137
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2138
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2139
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2140
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2141
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2142
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2143
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2144
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2145
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2146
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2147
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2148
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2149
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2150
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2151
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2152
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2153
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2154
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2155
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2156
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2157
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2158
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2159
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2160
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2161
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2162
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2163
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2164
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2165
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2166
    }/*function_lint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2167
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2168
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2169
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2170
 *LINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2171
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2172
    case function_lint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2173
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2174
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2175
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2176
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2177
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2178
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2179
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2180
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2181
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2182
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2183
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2184
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2185
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2186
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2187
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2188
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2189
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2190
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2191
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2192
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2193
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2194
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2195
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2196
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2197
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2198
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2199
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2200
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2201
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2202
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2203
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2204
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2205
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2206
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2207
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2208
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2209
    }/*function_lint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2210
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2211
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2212
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2213
 *LINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2214
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2215
    case function_lint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2216
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2217
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2218
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2219
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2220
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2221
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2222
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2223
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2224
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2225
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2226
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2227
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2228
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2229
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2230
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2231
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2232
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2233
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2234
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2235
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2236
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2237
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2238
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2239
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2240
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2241
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2242
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2243
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2244
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2245
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2246
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2247
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2248
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2249
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2250
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2251
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2252
    }/*function_lint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2253
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2254
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2255
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2256
 *LINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2257
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2258
    case function_lint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2259
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2260
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2261
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2262
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2263
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2264
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2265
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2266
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2267
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2268
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2269
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2270
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2271
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2272
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2273
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2274
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2275
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2276
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2277
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2278
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2279
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2280
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2281
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2282
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2283
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2284
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2285
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2286
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2287
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2288
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2289
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2290
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2291
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2292
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2293
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2294
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2295
    }/*function_lint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2296
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2297
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2298
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2299
 *LINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2300
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2301
    case function_lint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2302
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2303
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2304
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2305
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2306
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2307
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2308
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2309
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2310
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2311
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2312
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2313
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2314
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2315
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2316
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2317
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2318
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2319
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2320
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2321
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2322
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2323
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2324
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2325
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2326
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2327
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2328
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2329
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2330
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2331
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2332
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2333
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2334
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2335
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2336
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2337
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2338
    }/*function_lint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2339
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2340
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2341
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2342
 *LINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2343
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2344
    case function_lint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2345
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2346
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2347
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2348
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2349
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2350
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2351
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2352
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2353
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2354
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2355
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2356
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2357
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2358
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2359
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2360
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2361
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2362
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2363
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2364
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2365
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2366
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2367
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2368
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2369
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2370
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2371
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2372
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2373
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2374
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2375
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2376
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2377
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2378
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2379
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2380
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2381
    }/*function_lint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2382
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2383
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2384
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2385
 *LINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2386
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2387
    case function_lint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2388
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2389
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2390
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2391
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2392
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2393
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2394
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2395
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2396
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2397
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2398
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2399
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2400
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2401
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2402
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2403
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2404
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2405
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2406
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2407
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2408
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2409
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2410
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2411
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2412
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2413
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2414
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2415
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2416
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2417
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2418
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2419
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2420
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2421
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2422
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2423
    }/*function_lint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2424
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2425
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2426
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2427
 *LINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2428
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2429
    case function_lint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2430
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2431
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2432
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2433
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2434
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2435
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2436
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2437
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2438
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2439
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2440
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2441
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2442
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2443
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2444
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2445
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2446
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2447
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2448
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2449
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2450
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2451
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2452
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2453
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2454
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2455
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2456
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2457
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2458
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2459
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2460
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2461
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2462
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2463
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2464
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2465
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2466
    }/*function_lint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2467
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2468
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2469
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2470
 *DINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2471
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2472
    case function_dint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2473
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2474
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2475
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2476
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2477
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2478
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2479
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2480
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2481
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2482
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2483
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2484
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2485
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2486
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2487
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2488
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2489
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2490
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2491
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2492
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2493
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2494
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2495
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2496
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2497
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2498
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2499
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2500
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2501
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2502
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2503
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2504
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2505
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2506
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2507
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2508
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2509
    }/*function_dint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2510
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2511
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2512
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2513
 *DINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2514
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2515
    case function_dint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2516
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2517
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2518
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2519
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2520
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2521
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2522
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2523
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2524
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2525
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2526
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2527
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2528
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2529
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2530
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2531
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2532
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2533
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2534
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2535
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2536
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2537
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2538
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2539
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2540
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2541
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2542
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2543
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2544
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2545
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2546
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2547
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2548
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2549
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2550
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2551
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2552
    }/*function_dint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2553
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2554
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2555
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2556
 *DINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2557
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2558
    case function_dint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2559
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2560
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2561
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2562
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2563
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2564
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2565
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2566
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2567
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2568
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2569
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2570
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2571
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2572
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2573
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2574
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2575
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2576
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2577
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2578
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2579
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2580
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2581
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2582
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2583
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2584
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2585
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2586
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2587
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2588
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2589
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2590
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2591
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2592
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2593
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2594
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2595
    }/*function_dint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2596
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2597
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2598
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2599
 *DINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2600
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2601
    case function_dint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2602
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2603
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2604
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2605
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2606
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2607
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2608
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2609
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2610
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2611
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2612
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2613
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2614
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2615
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2616
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2617
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2618
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2619
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2620
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2621
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2622
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2623
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2624
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2625
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2626
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2627
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2628
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2629
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2630
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2631
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2632
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2633
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2634
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2635
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2636
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2637
    }/*function_dint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2638
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2639
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2640
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2641
 *DINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2642
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2643
    case function_dint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2644
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2645
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2646
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2647
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2648
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2649
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2650
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2651
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2652
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2653
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2654
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2655
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2656
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2657
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2658
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2659
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2660
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2661
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2662
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2663
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2664
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2665
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2666
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2667
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2668
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2669
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2670
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2671
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2672
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2673
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2674
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2675
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2676
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2677
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2678
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2679
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2680
    }/*function_dint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2681
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2682
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2683
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2684
 *DINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2685
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2686
    case function_dint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2687
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2688
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2689
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2690
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2691
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2692
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2693
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2694
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2695
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2696
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2697
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2698
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2699
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2700
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2701
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2702
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2703
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2704
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2705
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2706
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2707
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2708
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2709
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2710
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2711
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2712
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2713
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2714
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2715
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2716
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2717
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2718
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2719
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2720
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2721
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2722
    }/*function_dint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2723
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2724
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2725
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2726
 *DINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2727
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2728
    case function_dint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2729
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2730
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2731
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2732
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2733
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2734
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2735
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2736
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2737
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2738
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2739
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2740
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2741
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2742
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2743
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2744
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2745
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2746
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2747
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2748
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2749
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2750
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2751
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2752
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2753
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2754
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2755
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2756
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2757
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2758
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2759
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2760
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2761
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2762
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2763
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2764
    }/*function_dint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2765
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2766
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2767
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2768
 *DINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2769
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2770
    case function_dint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2771
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2772
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2773
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2774
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2775
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2776
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2777
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2778
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2779
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2780
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2781
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2782
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2783
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2784
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2785
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2786
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2787
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2788
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2789
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2790
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2791
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2792
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2793
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2794
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2795
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2796
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2797
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2798
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2799
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2800
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2801
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2802
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2803
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2804
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2805
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2806
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2807
    }/*function_dint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2808
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2809
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2810
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2811
 *DINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2812
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2813
    case function_dint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2814
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2815
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2816
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2817
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2818
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2819
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2820
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2821
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2822
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2823
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2824
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2825
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2826
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2827
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2828
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2829
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2830
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2831
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2832
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2833
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2834
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2835
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2836
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2837
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2838
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2839
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2840
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2841
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2842
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2843
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2844
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2845
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2846
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2847
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2848
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2849
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2850
    }/*function_dint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2851
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2852
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2853
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2854
 *DINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2855
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2856
    case function_dint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2857
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2858
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2859
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2860
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2861
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2862
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2863
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2864
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2865
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2866
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2867
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2868
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2869
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2870
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2871
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2872
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2873
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2874
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2875
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2876
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2877
                function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2878
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2879
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2880
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2881
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2882
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2883
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2884
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2885
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2886
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2887
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2888
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2889
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2890
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2891
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2892
    }/*function_dint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2893
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2894
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2895
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2896
 *DINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2897
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2898
    case function_dint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2899
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2900
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2901
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2902
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2903
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2904
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2905
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2906
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2907
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2908
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2909
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2910
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2911
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2912
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2913
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2914
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2915
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2916
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2917
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2918
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2919
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2920
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2921
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2922
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2923
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2924
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2925
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2926
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2927
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2928
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2929
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2930
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2931
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2932
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2933
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2934
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2935
    }/*function_dint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2936
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2937
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2938
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2939
 *DINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2940
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2941
    case function_dint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2942
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2943
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2944
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2945
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2946
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2947
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2948
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2949
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2950
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2951
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2952
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2953
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2954
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2955
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2956
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2957
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2958
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2959
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2960
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2961
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2962
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2963
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2964
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2965
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2966
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2967
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2968
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  2969
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2970
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2971
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2972
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2973
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2974
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2975
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2976
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2977
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2978
    }/*function_dint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2979
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2980
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2981
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2982
 *DINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2983
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2984
    case function_dint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2985
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2986
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2987
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2988
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2989
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2990
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  2991
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2992
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2993
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2994
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2995
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2996
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2997
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2998
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  2999
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3000
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3001
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3002
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3003
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3004
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3005
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3006
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3007
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3008
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3009
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3010
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3011
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3012
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3013
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3014
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3015
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3016
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3017
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3018
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3019
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3020
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3021
    }/*function_dint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3022
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3023
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3024
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3025
 *DINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3026
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3027
    case function_dint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3028
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3029
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3030
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3031
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3032
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3033
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3034
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3035
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3036
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3037
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3038
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3039
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3040
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3041
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3042
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3043
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3044
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3045
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3046
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3047
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3048
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3049
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3050
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3051
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3052
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3053
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3054
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3055
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3056
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3057
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3058
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3059
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3060
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3061
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3062
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3063
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3064
    }/*function_dint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3065
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3066
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3067
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3068
 *DINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3069
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3070
    case function_dint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3071
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3072
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3073
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3074
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3075
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3076
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3077
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3078
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3079
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3080
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3081
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3082
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3083
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3084
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3085
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3086
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3087
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3088
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3089
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3090
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3091
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3092
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3093
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3094
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3095
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3096
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3097
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3098
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3099
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3100
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3101
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3102
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3103
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3104
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3105
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3106
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3107
    }/*function_dint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3108
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3109
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3110
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3111
 *DINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3112
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3113
    case function_dint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3114
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3115
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3116
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3117
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3118
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3119
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3120
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3121
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3122
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3123
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3124
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3125
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3126
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3127
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3128
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3129
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3130
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3131
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3132
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3133
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3134
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3135
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3136
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3137
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3138
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3139
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3140
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3141
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3142
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3143
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3144
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3145
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3146
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3147
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3148
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3149
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3150
    }/*function_dint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3151
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3152
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3153
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3154
 *DINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3155
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3156
    case function_dint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3157
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3158
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3159
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3160
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3161
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3162
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3163
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3164
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3165
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3166
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3167
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3168
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3169
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3170
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3171
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3172
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3173
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3174
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3175
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3176
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3177
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3178
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3179
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3180
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3181
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3182
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3183
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3184
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3185
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3186
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3187
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3188
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3189
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3190
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3191
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3192
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3193
    }/*function_dint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3194
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3195
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3196
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3197
 *DINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3198
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3199
    case function_dint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3200
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3201
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3202
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3203
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3204
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3205
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3206
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3207
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3208
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3209
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3210
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3211
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3212
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3213
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3214
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3215
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3216
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3217
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3218
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3219
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3220
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3221
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3222
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3223
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3224
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3225
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3226
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3227
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3228
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3229
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3230
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3231
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3232
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3233
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3234
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3235
    }/*function_dint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3236
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3237
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3238
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3239
 *DINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3240
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3241
    case function_dint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3242
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3243
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3244
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3245
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3246
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3247
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3248
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3249
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3250
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3251
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3252
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3253
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3254
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3255
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3256
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3257
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3258
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3259
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3260
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3261
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3262
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3263
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3264
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3265
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3266
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3267
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3268
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3269
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3270
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3271
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3272
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3273
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3274
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3275
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3276
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3277
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3278
    }/*function_dint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3279
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3280
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3281
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3282
 *DATE_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3283
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3284
    case function_date_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3285
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3286
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3287
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3288
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3289
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3290
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3291
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3292
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3293
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3294
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3295
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3296
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3297
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3298
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3299
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3300
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3301
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3302
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3303
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3304
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3305
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3306
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3307
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3308
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3309
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3310
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3311
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3312
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3313
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3314
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3315
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3316
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3317
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3318
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3319
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3320
    }/*function_date_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3321
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3322
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3323
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3324
 *DATE_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3325
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3326
    case function_date_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3327
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3328
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3329
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3330
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3331
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3332
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3333
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3334
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3335
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3336
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3337
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3338
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3339
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3340
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3341
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3342
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3343
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3344
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3345
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3346
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3347
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3348
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3349
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3350
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3351
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3352
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3353
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3354
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3355
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3356
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3357
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3358
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3359
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3360
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3361
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3362
    }/*function_date_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3363
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3364
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3365
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3366
 *DATE_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3367
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3368
    case function_date_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3369
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3370
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3371
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3372
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3373
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3374
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3375
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3376
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3377
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3378
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3379
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3380
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3381
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3382
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3383
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3384
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3385
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3386
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3387
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3388
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3389
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3390
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3391
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3392
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3393
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3394
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3395
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3396
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3397
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3398
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3399
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3400
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3401
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3402
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3403
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3404
    }/*function_date_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3405
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3406
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3407
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3408
 *DATE_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3409
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3410
    case function_date_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3411
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3412
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3413
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3414
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3415
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3416
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3417
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3418
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3419
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3420
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3421
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3422
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3423
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3424
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3425
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3426
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3427
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3428
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3429
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3430
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3431
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3432
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3433
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3434
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3435
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3436
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3437
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3438
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3439
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3440
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3441
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3442
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3443
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3444
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3445
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3446
    }/*function_date_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3447
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3448
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3449
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3450
 *DATE_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3451
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3452
    case function_date_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3453
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3454
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3455
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3456
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3457
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3458
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3459
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3460
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3461
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3462
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3463
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3464
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3465
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3466
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3467
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3468
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3469
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3470
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3471
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3472
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3473
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3474
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3475
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3476
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3477
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3478
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3479
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3480
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3481
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3482
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3483
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3484
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3485
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3486
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3487
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3488
    }/*function_date_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3489
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3490
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3491
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3492
 *DATE_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3493
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3494
    case function_date_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3495
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3496
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3497
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3498
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3499
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3500
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3501
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3502
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3503
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3504
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3505
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3506
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3507
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3508
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3509
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3510
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3511
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3512
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3513
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3514
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3515
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3516
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3517
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3518
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3519
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3520
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3521
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3522
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3523
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3524
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3525
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3526
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3527
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3528
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3529
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3530
    }/*function_date_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3531
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3532
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3533
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3534
 *DATE_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3535
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3536
    case function_date_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3537
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3538
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3539
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3540
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3541
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3542
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3543
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3544
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3545
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3546
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3547
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3548
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3549
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3550
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3551
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3552
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3553
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3554
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3555
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3556
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3557
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3558
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3559
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3560
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3561
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3562
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3563
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3564
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3565
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3566
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3567
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3568
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3569
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3570
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3571
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3572
    }/*function_date_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3573
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3574
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3575
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3576
 *DATE_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3577
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3578
    case function_date_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3579
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3580
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3581
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3582
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3583
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3584
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3585
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3586
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3587
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3588
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3589
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3590
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3591
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3592
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3593
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3594
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3595
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3596
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3597
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3598
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3599
                function_name = (symbol_c*)(new pragma_c("__date_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3600
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3601
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3602
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3603
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3604
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3605
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3606
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3607
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3608
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3609
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3610
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3611
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3612
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3613
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3614
    }/*function_date_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3615
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3616
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3617
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3618
 *DATE_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3619
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3620
    case function_date_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3621
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3622
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3623
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3624
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3625
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3626
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3627
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3628
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3629
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3630
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3631
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3632
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3633
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3634
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3635
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3636
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3637
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3638
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3639
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3640
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3641
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3642
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3643
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3644
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3645
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3646
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3647
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3648
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3649
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3650
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3651
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3652
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3653
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3654
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3655
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3656
    }/*function_date_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3657
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3658
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3659
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3660
 *DATE_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3661
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3662
    case function_date_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3663
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3664
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3665
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3666
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3667
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3668
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3669
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3670
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3671
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3672
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3673
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3674
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3675
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3676
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3677
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3678
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3679
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3680
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3681
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3682
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3683
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3684
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3685
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3686
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3687
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3688
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3689
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3690
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3691
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3692
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3693
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3694
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3695
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3696
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3697
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3698
    }/*function_date_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3699
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3700
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3701
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3702
 *DATE_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3703
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3704
    case function_date_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3705
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3706
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3707
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3708
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3709
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3710
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3711
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3712
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3713
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3714
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3715
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3716
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3717
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3718
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3719
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3720
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3721
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3722
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3723
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3724
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3725
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3726
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3727
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3728
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3729
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3730
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3731
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3732
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3733
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3734
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3735
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3736
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3737
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3738
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3739
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3740
    }/*function_date_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3741
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3742
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3743
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3744
 *DATE_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3745
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3746
    case function_date_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3747
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3748
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3749
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3750
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3751
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3752
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3753
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3754
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3755
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3756
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3757
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3758
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3759
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3760
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3761
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3762
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3763
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3764
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3765
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3766
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3767
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3768
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3769
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3770
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3771
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3772
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3773
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3774
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3775
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3776
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3777
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3778
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3779
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3780
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3781
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3782
    }/*function_date_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3783
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3784
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3785
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3786
 *DATE_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3787
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3788
    case function_date_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3789
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3790
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3791
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3792
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3793
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3794
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3795
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3796
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3797
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3798
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3799
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3800
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3801
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3802
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3803
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3804
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3805
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3806
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3807
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3808
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3809
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3810
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3811
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3812
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3813
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3814
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3815
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3816
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3817
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3818
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3819
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3820
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3821
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3822
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3823
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3824
    }/*function_date_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3825
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3826
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3827
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3828
 *DATE_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3829
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3830
    case function_date_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3831
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3832
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3833
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3834
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3835
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3836
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3837
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3838
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3839
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3840
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3841
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3842
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3843
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3844
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3845
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3846
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3847
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3848
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3849
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3850
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3851
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3852
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3853
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3854
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3855
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3856
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3857
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3858
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3859
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3860
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3861
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3862
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3863
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3864
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3865
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3866
    }/*function_date_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3867
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3868
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3869
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3870
 *DATE_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3871
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3872
    case function_date_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3873
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3874
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3875
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3876
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3877
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3878
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3879
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3880
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3881
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3882
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3883
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3884
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3885
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3886
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3887
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3888
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3889
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3890
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3891
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3892
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3893
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3894
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3895
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3896
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3897
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3898
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3899
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3900
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3901
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3902
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3903
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3904
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3905
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3906
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3907
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3908
    }/*function_date_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3909
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3910
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3911
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3912
 *DWORD_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3913
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3914
    case function_dword_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3915
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3916
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3917
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3918
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3919
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3920
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3921
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3922
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3923
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3924
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3925
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3926
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3927
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3928
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3929
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3930
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3931
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3932
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3933
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3934
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3935
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3936
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3937
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3938
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3939
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3940
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3941
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3942
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3943
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3944
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3945
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3946
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3947
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3948
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3949
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3950
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3951
    }/*function_dword_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3952
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3953
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3954
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3955
 *DWORD_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3956
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3957
    case function_dword_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3958
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3959
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3960
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3961
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3962
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3963
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3964
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3965
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3966
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3967
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3968
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3969
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3970
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3971
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3972
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3973
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3974
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3975
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3976
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3977
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3978
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3979
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3980
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  3981
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3982
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3983
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3984
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  3985
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3986
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3987
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3988
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3989
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3990
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3991
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3992
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3993
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3994
    }/*function_dword_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3995
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3996
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3997
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3998
 *DWORD_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  3999
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4000
    case function_dword_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4001
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4002
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4003
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4004
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4005
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4006
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4007
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4008
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4009
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4010
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4011
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4012
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4013
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4014
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4015
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4016
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4017
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4018
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4019
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4020
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4021
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4022
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4023
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4024
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4025
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4026
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4027
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4028
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4029
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4030
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4031
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4032
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4033
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4034
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4035
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4036
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4037
    }/*function_dword_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4038
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4039
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4040
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4041
 *DWORD_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4042
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4043
    case function_dword_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4044
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4045
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4046
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4047
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4048
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4049
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4050
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4051
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4052
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4053
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4054
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4055
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4056
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4057
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4058
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4059
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4060
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4061
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4062
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4063
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4064
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4065
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4066
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4067
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4068
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4069
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4070
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4071
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4072
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4073
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4074
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4075
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4076
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4077
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4078
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4079
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4080
    }/*function_dword_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4081
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4082
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4083
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4084
 *DWORD_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4085
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4086
    case function_dword_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4087
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4088
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4089
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4090
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4091
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4092
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4093
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4094
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4095
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4096
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4097
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4098
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4099
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4100
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4101
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4102
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4103
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4104
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4105
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4106
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4107
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4108
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4109
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4110
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4111
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4112
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4113
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4114
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4115
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4116
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4117
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4118
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4119
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4120
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4121
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4122
    }/*function_dword_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4123
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4124
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4125
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4126
 *DWORD_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4127
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4128
    case function_dword_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4129
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4130
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4131
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4132
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4133
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4134
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4135
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4136
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4137
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4138
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4139
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4140
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4141
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4142
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4143
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4144
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4145
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4146
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4147
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4148
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4149
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4150
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4151
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4152
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4153
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4154
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4155
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4156
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4157
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4158
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4159
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4160
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4161
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4162
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4163
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4164
    }/*function_dword_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4165
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4166
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4167
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4168
 *DWORD_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4169
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4170
    case function_dword_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4171
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4172
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4173
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4174
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4175
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4176
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4177
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4178
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4179
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4180
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4181
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4182
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4183
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4184
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4185
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4186
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4187
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4188
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4189
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4190
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4191
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4192
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4193
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4194
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4195
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4196
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4197
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4198
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4199
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4200
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4201
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4202
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4203
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4204
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4205
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4206
    }/*function_dword_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4207
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4208
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4209
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4210
 *DWORD_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4211
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4212
    case function_dword_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4213
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4214
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4215
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4216
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4217
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4218
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4219
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4220
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4221
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4222
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4223
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4224
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4225
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4226
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4227
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4228
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4229
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4230
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4231
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4232
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4233
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4234
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4235
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4236
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4237
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4238
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4239
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4240
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4241
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4242
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4243
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4244
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4245
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4246
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4247
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4248
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4249
    }/*function_dword_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4250
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4251
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4252
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4253
 *DWORD_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4254
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4255
    case function_dword_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4256
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4257
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4258
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4259
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4260
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4261
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4262
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4263
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4264
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4265
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4266
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4267
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4268
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4269
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4270
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4271
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4272
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4273
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4274
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4275
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4276
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4277
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4278
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4279
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4280
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4281
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4282
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4283
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4284
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4285
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4286
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4287
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4288
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4289
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4290
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4291
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4292
    }/*function_dword_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4293
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4294
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4295
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4296
 *DWORD_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4297
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4298
    case function_dword_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4299
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4300
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4301
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4302
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4303
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4304
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4305
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4306
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4307
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4308
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4309
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4310
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4311
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4312
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4313
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4314
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4315
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4316
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4317
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4318
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4319
                function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4320
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4321
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4322
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4323
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4324
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4325
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4326
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4327
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4328
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4329
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4330
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4331
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4332
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4333
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4334
    }/*function_dword_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4335
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4336
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4337
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4338
 *DWORD_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4339
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4340
    case function_dword_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4341
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4342
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4343
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4344
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4345
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4346
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4347
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4348
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4349
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4350
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4351
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4352
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4353
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4354
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4355
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4356
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4357
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4358
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4359
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4360
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4361
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4362
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4363
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4364
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4365
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4366
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4367
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4368
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4369
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4370
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4371
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4372
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4373
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4374
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4375
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4376
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4377
    }/*function_dword_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4378
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4379
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4380
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4381
 *DWORD_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4382
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4383
    case function_dword_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4384
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4385
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4386
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4387
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4388
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4389
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4390
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4391
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4392
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4393
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4394
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4395
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4396
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4397
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4398
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4399
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4400
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4401
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4402
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4403
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4404
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4405
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4406
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4407
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4408
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4409
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4410
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4411
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4412
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4413
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4414
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4415
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4416
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4417
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4418
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4419
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4420
    }/*function_dword_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4421
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4422
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4423
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4424
 *DWORD_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4425
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4426
    case function_dword_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4427
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4428
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4429
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4430
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4431
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4432
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4433
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4434
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4435
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4436
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4437
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4438
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4439
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4440
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4441
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4442
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4443
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4444
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4445
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4446
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4447
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4448
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4449
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4450
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4451
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4452
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4453
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4454
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4455
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4456
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4457
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4458
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4459
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4460
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4461
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4462
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4463
    }/*function_dword_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4464
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4465
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4466
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4467
 *DWORD_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4468
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4469
    case function_dword_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4470
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4471
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4472
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4473
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4474
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4475
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4476
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4477
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4478
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4479
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4480
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4481
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4482
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4483
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4484
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4485
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4486
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4487
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4488
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4489
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4490
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4491
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4492
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4493
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4494
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4495
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4496
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4497
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4498
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4499
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4500
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4501
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4502
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4503
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4504
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4505
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4506
    }/*function_dword_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4507
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4508
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4509
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4510
 *DWORD_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4511
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4512
    case function_dword_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4513
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4514
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4515
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4516
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4517
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4518
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4519
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4520
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4521
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4522
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4523
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4524
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4525
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4526
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4527
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4528
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4529
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4530
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4531
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4532
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4533
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4534
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4535
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4536
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4537
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4538
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4539
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4540
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4541
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4542
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4543
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4544
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4545
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4546
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4547
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4548
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4549
    }/*function_dword_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4550
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4551
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4552
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4553
 *DWORD_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4554
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4555
    case function_dword_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4556
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4557
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4558
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4559
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4560
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4561
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4562
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4563
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4564
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4565
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4566
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4567
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4568
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4569
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4570
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4571
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4572
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4573
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4574
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4575
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4576
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4577
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4578
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4579
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4580
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4581
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4582
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4583
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4584
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4585
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4586
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4587
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4588
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4589
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4590
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4591
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4592
    }/*function_dword_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4593
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4594
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4595
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4596
 *DWORD_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4597
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4598
    case function_dword_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4599
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4600
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4601
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4602
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4603
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4604
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4605
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4606
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4607
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4608
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4609
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4610
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4611
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4612
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4613
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4614
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4615
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4616
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4617
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4618
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4619
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4620
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4621
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4622
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4623
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4624
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4625
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4626
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4627
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4628
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4629
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4630
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4631
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4632
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4633
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4634
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4635
    }/*function_dword_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4636
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4637
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4638
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4639
 *DWORD_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4640
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4641
    case function_dword_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4642
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4643
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4644
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4645
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4646
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4647
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4648
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4649
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4650
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4651
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4652
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4653
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4654
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4655
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4656
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4657
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4658
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4659
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4660
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4661
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4662
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4663
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4664
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4665
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4666
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4667
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4668
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4669
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4670
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4671
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4672
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4673
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4674
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4675
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4676
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4677
    }/*function_dword_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4678
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4679
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4680
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4681
 *DWORD_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4682
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4683
    case function_dword_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4684
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4685
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4686
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4687
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4688
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4689
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4690
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4691
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4692
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4693
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4694
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4695
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4696
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4697
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4698
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4699
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4700
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4701
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4702
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4703
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4704
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4705
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4706
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4707
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4708
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4709
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4710
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  4711
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4712
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4713
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4714
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4715
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4716
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4717
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4718
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4719
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4720
    }/*function_dword_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4721
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4722
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4723
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4724
 *DT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4725
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4726
    case function_dt_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4727
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4728
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4729
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4730
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4731
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4732
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4733
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4734
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4735
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4736
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4737
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4738
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4739
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4740
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4741
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4742
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4743
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4744
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4745
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4746
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4747
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4748
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4749
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4750
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4751
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4752
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4753
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4754
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4755
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4756
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4757
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4758
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4759
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4760
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4761
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4762
    }/*function_dt_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4763
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4764
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4765
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4766
 *DT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4767
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4768
    case function_dt_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4769
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4770
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4771
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4772
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4773
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4774
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4775
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4776
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4777
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4778
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4779
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4780
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4781
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4782
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4783
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4784
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4785
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4786
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4787
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4788
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4789
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4790
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4791
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4792
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4793
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4794
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4795
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4796
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4797
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4798
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4799
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4800
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4801
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4802
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4803
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4804
    }/*function_dt_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4805
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4806
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4807
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4808
 *DT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4809
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4810
    case function_dt_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4811
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4812
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4813
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4814
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4815
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4816
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4817
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4818
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4819
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4820
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4821
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4822
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4823
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4824
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4825
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4826
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4827
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4828
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4829
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4830
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4831
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4832
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4833
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4834
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4835
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4836
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4837
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4838
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4839
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4840
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4841
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4842
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4843
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4844
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4845
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4846
    }/*function_dt_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4847
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4848
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4849
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4850
 *DT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4851
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4852
    case function_dt_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4853
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4854
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4855
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4856
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4857
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4858
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4859
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4860
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4861
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4862
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4863
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4864
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4865
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4866
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4867
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4868
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4869
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4870
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4871
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4872
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4873
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4874
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4875
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4876
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4877
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4878
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4879
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4880
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4881
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4882
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4883
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4884
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4885
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4886
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4887
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4888
    }/*function_dt_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4889
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4890
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4891
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4892
 *DT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4893
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4894
    case function_dt_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4895
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4896
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4897
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4898
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4899
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4900
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4901
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4902
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4903
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4904
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4905
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4906
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4907
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4908
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4909
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4910
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4911
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4912
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4913
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4914
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4915
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4916
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4917
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4918
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4919
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4920
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4921
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4922
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4923
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4924
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4925
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4926
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4927
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4928
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4929
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4930
    }/*function_dt_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4931
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4932
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4933
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4934
 *DT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4935
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4936
    case function_dt_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4937
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4938
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4939
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4940
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4941
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4942
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4943
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4944
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4945
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4946
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4947
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4948
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4949
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4950
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4951
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4952
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4953
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4954
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4955
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4956
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4957
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4958
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4959
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4960
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4961
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4962
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4963
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4964
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4965
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4966
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4967
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4968
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4969
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4970
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4971
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4972
    }/*function_dt_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4973
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4974
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4975
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4976
 *DT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4977
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4978
    case function_dt_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4979
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4980
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4981
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4982
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4983
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4984
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4985
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4986
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4987
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4988
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4989
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4990
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4991
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4992
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4993
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4994
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4995
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  4996
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4997
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4998
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  4999
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5000
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5001
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5002
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5003
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5004
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5005
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5006
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5007
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5008
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5009
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5010
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5011
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5012
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5013
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5014
    }/*function_dt_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5015
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5016
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5017
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5018
 *DT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5019
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5020
    case function_dt_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5021
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5022
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5023
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5024
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5025
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5026
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5027
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5028
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5029
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5030
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5031
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5032
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5033
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5034
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5035
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5036
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5037
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5038
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5039
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5040
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5041
                function_name = (symbol_c*)(new pragma_c("__dt_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5042
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5043
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5044
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5045
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5046
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5047
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5048
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5049
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5050
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5051
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5052
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5053
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5054
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5055
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5056
    }/*function_dt_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5057
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5058
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5059
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5060
 *DT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5061
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5062
    case function_dt_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5063
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5064
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5065
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5066
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5067
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5068
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5069
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5070
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5071
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5072
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5073
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5074
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5075
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5076
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5077
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5078
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5079
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5080
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5081
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5082
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5083
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5084
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5085
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5086
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5087
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5088
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5089
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5090
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5091
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5092
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5093
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5094
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5095
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5096
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5097
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5098
    }/*function_dt_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5099
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5100
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5101
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5102
 *DT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5103
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5104
    case function_dt_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5105
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5106
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5107
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5108
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5109
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5110
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5111
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5112
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5113
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5114
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5115
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5116
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5117
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5118
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5119
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5120
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5121
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5122
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5123
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5124
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5125
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5126
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5127
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5128
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5129
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5130
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5131
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5132
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5133
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5134
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5135
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5136
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5137
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5138
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5139
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5140
    }/*function_dt_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5141
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5142
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5143
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5144
 *DT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5145
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5146
    case function_dt_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5147
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5148
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5150
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5151
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5152
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5153
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5154
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5155
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5156
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5157
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5158
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5159
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5160
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5161
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5162
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5163
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5164
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5165
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5166
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5167
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5168
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5169
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5170
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5171
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5172
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5173
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5174
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5175
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5176
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5177
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5178
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5179
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5180
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5181
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5182
    }/*function_dt_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5183
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5184
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5185
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5186
 *DT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5187
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5188
    case function_dt_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5189
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5190
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5191
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5192
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5193
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5194
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5195
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5196
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5197
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5198
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5199
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5200
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5201
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5202
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5203
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5204
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5205
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5206
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5207
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5208
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5209
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5210
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5211
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5212
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5213
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5214
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5215
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5216
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5217
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5218
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5219
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5220
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5221
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5222
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5223
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5224
    }/*function_dt_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5225
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5226
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5227
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5228
 *DT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5229
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5230
    case function_dt_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5231
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5232
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5233
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5234
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5235
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5236
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5237
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5238
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5239
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5240
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5241
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5242
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5243
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5244
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5245
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5246
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5247
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5248
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5249
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5250
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5251
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5252
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5253
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5254
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5255
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5256
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5257
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5258
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5259
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5260
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5261
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5262
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5263
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5264
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5265
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5266
    }/*function_dt_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5267
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5268
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5269
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5270
 *DT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5271
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5272
    case function_dt_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5273
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5274
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5275
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5276
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5277
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5278
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5279
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5280
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5281
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5282
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5283
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5284
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5285
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5286
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5287
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5288
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5289
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5290
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5291
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5292
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5293
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5294
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5295
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5296
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5297
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5298
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5299
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5300
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5301
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5302
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5303
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5304
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5305
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5306
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5307
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5308
    }/*function_dt_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5309
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5310
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5311
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5312
 *DT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5313
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5314
    case function_dt_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5315
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5316
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5317
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5318
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5319
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5320
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5321
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5322
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5323
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5324
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5325
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5326
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5327
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5328
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5329
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5330
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5331
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5332
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5333
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5334
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5335
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5336
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5337
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5338
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5339
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5340
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5341
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5342
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5343
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5344
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5345
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5346
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5347
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5348
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5349
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5350
    }/*function_dt_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5351
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5352
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5353
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5354
 *TOD_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5355
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5356
    case function_tod_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5357
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5358
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5359
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5360
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5361
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5362
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5363
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5364
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5365
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5366
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5367
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5368
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5369
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5370
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5371
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5372
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5373
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5374
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5375
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5376
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5377
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5378
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5379
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5380
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5381
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5382
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5383
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5384
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5385
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5386
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5387
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5388
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5389
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5390
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5391
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5392
    }/*function_tod_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5393
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5394
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5395
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5396
 *TOD_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5397
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5398
    case function_tod_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5399
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5400
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5401
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5402
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5403
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5404
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5405
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5406
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5407
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5408
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5409
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5410
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5411
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5412
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5413
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5414
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5415
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5416
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5417
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5418
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5419
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5420
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5421
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5422
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5423
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5424
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5425
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5426
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5427
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5428
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5429
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5430
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5431
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5432
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5433
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5434
    }/*function_tod_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5435
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5436
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5437
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5438
 *TOD_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5439
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5440
    case function_tod_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5441
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5442
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5443
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5444
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5445
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5446
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5447
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5448
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5449
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5450
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5451
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5452
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5453
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5454
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5455
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5456
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5457
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5458
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5459
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5460
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5461
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5462
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5463
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5464
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5465
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5466
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5467
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5468
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5469
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5470
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5471
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5472
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5473
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5474
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5475
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5476
    }/*function_tod_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5477
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5478
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5479
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5480
 *TOD_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5481
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5482
    case function_tod_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5483
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5484
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5485
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5486
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5487
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5488
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5489
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5490
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5491
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5492
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5493
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5494
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5495
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5496
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5497
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5498
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5499
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5500
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5501
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5502
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5503
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5504
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5505
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5506
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5507
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5508
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5509
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5510
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5511
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5512
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5513
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5514
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5515
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5516
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5517
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5518
    }/*function_tod_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5519
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5520
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5521
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5522
 *TOD_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5523
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5524
    case function_tod_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5525
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5526
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5527
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5528
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5529
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5530
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5531
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5532
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5533
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5534
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5535
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5536
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5537
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5538
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5539
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5540
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5541
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5542
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5543
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5544
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5545
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5546
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5547
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5548
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5549
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5550
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5551
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5552
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5553
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5554
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5555
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5556
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5557
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5558
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5559
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5560
    }/*function_tod_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5561
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5562
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5563
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5564
 *TOD_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5565
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5566
    case function_tod_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5567
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5568
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5569
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5570
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5571
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5572
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5573
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5574
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5575
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5576
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5577
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5578
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5579
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5580
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5581
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5582
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5583
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5584
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5585
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5586
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5587
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5588
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5589
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5590
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5591
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5592
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5593
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5594
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5595
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5596
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5597
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5598
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5599
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5600
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5601
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5602
    }/*function_tod_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5603
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5604
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5605
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5606
 *TOD_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5607
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5608
    case function_tod_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5609
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5610
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5611
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5612
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5613
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5614
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5615
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5616
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5617
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5618
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5619
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5620
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5621
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5622
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5623
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5624
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5625
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5626
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5627
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5628
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5629
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5630
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5631
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5632
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5633
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5634
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5635
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5636
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5637
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5638
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5639
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5640
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5641
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5642
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5643
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5644
    }/*function_tod_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5645
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5646
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5647
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5648
 *TOD_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5649
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5650
    case function_tod_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5651
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5652
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5653
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5654
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5655
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5656
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5657
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5658
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5659
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5660
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5661
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5662
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5663
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5664
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5665
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5666
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5667
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5668
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5669
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5670
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5671
                function_name = (symbol_c*)(new pragma_c("__tod_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5672
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5673
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5674
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5675
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5676
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5677
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5678
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5679
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5680
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5681
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5682
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5683
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5684
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5685
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5686
    }/*function_tod_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5687
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5688
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5689
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5690
 *TOD_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5691
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5692
    case function_tod_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5693
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5694
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5695
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5696
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5697
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5698
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5699
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5700
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5701
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5702
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5703
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5704
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5705
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5706
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5707
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5708
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5709
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5710
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5711
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5712
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5713
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5714
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5715
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5716
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5717
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5718
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5719
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5720
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5721
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5722
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5723
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5724
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5725
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5726
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5727
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5728
    }/*function_tod_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5729
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5730
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5731
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5732
 *TOD_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5733
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5734
    case function_tod_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5735
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5736
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5737
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5738
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5739
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5740
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5741
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5742
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5743
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5744
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5745
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5746
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5747
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5748
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5749
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5750
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5751
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5752
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5753
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5754
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5755
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5756
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5757
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5758
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5759
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5760
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5761
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5762
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5763
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5764
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5765
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5766
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5767
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5768
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5769
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5770
    }/*function_tod_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5771
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5772
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5773
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5774
 *TOD_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5775
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5776
    case function_tod_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5777
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5778
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5779
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5780
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5781
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5782
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5783
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5784
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5785
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5786
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5787
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5788
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5789
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5790
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5791
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5792
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5793
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5794
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5795
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5796
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5797
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5798
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5799
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5800
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5801
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5802
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5803
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5804
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5805
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5806
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5807
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5808
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5809
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5810
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5811
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5812
    }/*function_tod_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5813
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5814
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5815
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5816
 *TOD_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5817
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5818
    case function_tod_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5819
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5820
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5821
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5822
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5823
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5824
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5825
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5826
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5827
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5828
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5829
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5830
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5831
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5832
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5833
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5834
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5835
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5836
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5837
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5838
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5839
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5840
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5841
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5842
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5843
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5844
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5845
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5846
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5847
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5848
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5849
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5850
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5851
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5852
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5853
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5854
    }/*function_tod_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5855
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5856
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5857
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5858
 *TOD_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5859
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5860
    case function_tod_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5861
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5862
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5863
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5864
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5865
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5866
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5867
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5868
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5869
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5870
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5871
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5872
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5873
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5874
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5875
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5876
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5877
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5878
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5879
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5880
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5881
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5882
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5883
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5884
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5885
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5886
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5887
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5888
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5889
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5890
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5891
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5892
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5893
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5894
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5895
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5896
    }/*function_tod_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5897
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5898
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5899
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5900
 *TOD_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5901
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5902
    case function_tod_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5903
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5904
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5905
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5906
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5907
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5908
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5909
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5910
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5911
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5912
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5913
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5914
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5915
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5916
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5917
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5918
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5919
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5920
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5921
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5922
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5923
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5924
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5925
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5926
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5927
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5928
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5929
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5930
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5931
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5932
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5933
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5934
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5935
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5936
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5937
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5938
    }/*function_tod_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5939
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5940
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5941
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5942
 *TOD_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5943
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5944
    case function_tod_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5945
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5946
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5947
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5948
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5949
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5950
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5951
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5952
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5953
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5954
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5955
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5956
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5957
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5958
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5959
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5960
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5961
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5962
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5963
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5964
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5965
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5966
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5967
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5968
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5969
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5970
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5971
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5972
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5973
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5974
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5975
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5976
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5977
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5978
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5979
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5980
    }/*function_tod_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5981
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5982
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5983
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5984
 *UDINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5985
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5986
    case function_udint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5987
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5988
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5989
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5990
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5991
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5992
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  5993
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5994
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5995
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5996
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5997
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5998
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  5999
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6000
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6001
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6002
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6003
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6004
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6005
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6006
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6007
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6008
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6009
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6010
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6011
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6012
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6013
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6014
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6015
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6016
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6017
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6018
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6019
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6020
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6021
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6022
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6023
    }/*function_udint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6024
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6025
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6026
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6027
 *UDINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6028
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6029
    case function_udint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6030
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6031
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6032
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6033
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6034
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6035
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6036
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6037
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6038
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6039
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6040
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6041
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6042
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6043
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6044
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6045
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6046
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6047
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6048
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6049
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6050
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6051
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6052
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6053
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6054
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6055
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6056
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6057
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6058
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6059
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6060
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6061
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6062
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6063
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6064
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6065
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6066
    }/*function_udint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6067
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6068
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6069
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6070
 *UDINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6071
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6072
    case function_udint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6073
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6074
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6075
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6076
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6077
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6078
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6079
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6080
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6081
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6082
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6083
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6084
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6085
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6086
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6087
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6088
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6089
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6090
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6091
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6092
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6093
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6094
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6095
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6096
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6097
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6098
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6099
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6100
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6101
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6102
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6103
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6104
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6105
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6106
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6107
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6108
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6109
    }/*function_udint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6110
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6111
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6112
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6113
 *UDINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6114
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6115
    case function_udint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6116
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6117
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6118
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6119
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6120
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6121
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6122
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6123
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6124
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6125
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6126
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6127
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6128
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6129
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6130
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6131
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6132
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6133
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6134
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6135
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6136
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6137
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6138
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6139
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6140
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6141
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6142
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6143
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6144
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6145
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6146
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6147
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6148
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6149
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6150
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6151
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6152
    }/*function_udint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6153
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6154
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6155
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6156
 *UDINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6157
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6158
    case function_udint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6159
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6160
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6161
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6162
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6163
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6164
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6165
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6166
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6167
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6168
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6169
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6170
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6171
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6172
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6173
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6174
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6175
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6176
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6177
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6178
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6179
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6180
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6181
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6182
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6183
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6184
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6185
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6186
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6187
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6188
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6189
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6190
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6191
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6192
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6193
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6194
    }/*function_udint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6195
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6196
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6197
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6198
 *UDINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6199
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6200
    case function_udint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6201
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6202
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6203
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6204
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6205
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6206
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6207
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6208
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6209
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6210
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6211
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6212
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6213
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6214
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6215
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6216
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6217
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6218
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6219
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6220
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6221
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6222
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6223
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6224
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6225
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6226
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6227
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6228
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6229
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6230
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6231
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6232
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6233
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6234
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6235
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6236
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6237
    }/*function_udint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6238
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6239
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6240
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6241
 *UDINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6242
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6243
    case function_udint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6244
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6245
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6246
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6247
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6248
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6249
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6250
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6251
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6252
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6253
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6254
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6255
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6256
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6257
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6258
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6259
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6260
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6261
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6262
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6263
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6264
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6265
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6266
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6267
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6268
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6269
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6270
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6271
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6272
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6273
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6274
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6275
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6276
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6277
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6278
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6279
    }/*function_udint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6280
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6281
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6282
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6283
 *UDINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6284
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6285
    case function_udint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6286
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6287
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6288
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6289
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6290
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6291
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6292
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6293
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6294
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6295
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6296
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6297
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6298
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6299
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6300
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6301
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6302
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6303
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6304
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6305
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6306
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6307
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6308
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6309
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6310
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6311
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6312
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6313
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6314
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6315
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6316
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6317
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6318
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6319
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6320
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6321
    }/*function_udint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6322
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6323
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6324
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6325
 *UDINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6326
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6327
    case function_udint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6328
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6329
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6330
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6331
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6332
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6333
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6334
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6335
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6336
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6337
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6338
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6339
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6340
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6341
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6342
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6343
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6344
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6345
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6346
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6347
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6348
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6349
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6350
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6351
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6352
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6353
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6354
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6355
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6356
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6357
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6358
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6359
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6360
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6361
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6362
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6363
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6364
    }/*function_udint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6365
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6366
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6367
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6368
 *UDINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6369
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6370
    case function_udint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6371
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6372
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6373
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6374
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6375
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6376
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6377
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6378
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6379
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6380
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6381
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6382
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6383
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6384
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6385
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6386
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6387
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6388
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6389
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6390
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6391
                function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6392
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6393
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6394
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6395
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6396
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6397
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6398
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6399
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6400
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6401
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6402
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6403
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6404
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6405
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6406
    }/*function_udint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6407
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6408
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6409
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6410
 *UDINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6411
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6412
    case function_udint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6413
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6414
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6415
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6416
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6417
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6418
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6419
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6420
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6421
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6422
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6423
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6424
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6425
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6426
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6427
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6428
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6429
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6430
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6431
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6432
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6433
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6434
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6435
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6436
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6437
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6438
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6439
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6440
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6441
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6442
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6443
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6444
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6445
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6446
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6447
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6448
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6449
    }/*function_udint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6450
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6451
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6452
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6453
 *UDINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6454
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6455
    case function_udint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6456
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6457
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6458
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6459
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6460
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6461
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6462
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6463
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6464
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6465
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6466
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6467
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6468
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6469
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6470
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6471
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6472
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6473
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6474
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6475
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6476
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6477
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6478
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6479
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6480
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6481
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6482
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6483
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6484
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6485
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6486
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6487
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6488
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6489
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6490
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6491
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6492
    }/*function_udint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6493
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6494
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6495
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6496
 *UDINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6497
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6498
    case function_udint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6499
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6500
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6501
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6502
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6503
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6504
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6505
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6506
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6507
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6508
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6509
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6510
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6511
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6512
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6513
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6514
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6515
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6516
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6517
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6518
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6519
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6520
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6521
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6522
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6523
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6524
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6525
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6526
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6527
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6528
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6529
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6530
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6531
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6532
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6533
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6534
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6535
    }/*function_udint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6536
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6537
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6538
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6539
 *UDINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6540
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6541
    case function_udint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6542
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6543
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6544
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6545
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6546
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6547
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6548
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6549
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6550
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6551
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6552
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6553
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6554
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6555
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6556
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6557
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6558
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6559
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6560
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6561
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6562
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6563
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6564
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6565
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6566
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6567
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6568
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6569
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6570
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6571
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6572
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6573
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6574
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6575
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6576
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6577
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6578
    }/*function_udint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6579
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6580
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6581
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6582
 *UDINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6583
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6584
    case function_udint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6585
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6586
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6587
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6588
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6589
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6590
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6591
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6592
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6593
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6594
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6595
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6596
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6597
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6598
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6599
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6600
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6601
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6602
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6603
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6604
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6605
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6606
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6607
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6608
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6609
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6610
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6611
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6612
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6613
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6614
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6615
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6616
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6617
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6618
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6619
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6620
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6621
    }/*function_udint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6622
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6623
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6624
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6625
 *UDINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6626
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6627
    case function_udint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6628
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6629
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6630
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6631
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6632
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6633
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6634
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6635
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6636
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6637
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6638
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6639
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6640
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6641
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6642
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6643
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6644
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6645
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6646
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6647
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6648
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6649
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6650
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6651
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6652
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6653
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6654
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6655
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6656
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6657
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6658
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6659
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6660
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6661
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6662
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6663
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6664
    }/*function_udint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6665
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6666
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6667
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6668
 *UDINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6669
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6670
    case function_udint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6671
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6672
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6673
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6674
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6675
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6676
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6677
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6678
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6679
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6680
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6681
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6682
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6683
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6684
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6685
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6686
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6687
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6688
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6689
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6690
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6691
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6692
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6693
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6694
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6695
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6696
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6697
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6698
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6699
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6700
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6701
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6702
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6703
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6704
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6705
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6706
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6707
    }/*function_udint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6708
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6709
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6710
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6711
 *UDINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6712
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6713
    case function_udint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6714
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6715
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6716
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6717
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6718
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6719
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6720
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6721
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6722
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6723
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6724
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6725
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6726
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6727
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6728
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6729
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6730
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6731
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6732
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6733
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6734
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6735
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6736
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6737
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6738
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6739
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6740
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6741
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6742
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6743
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6744
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6745
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6746
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6747
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6748
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6749
    }/*function_udint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6750
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6751
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6752
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6753
 *UDINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6754
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6755
    case function_udint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6756
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6757
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6758
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6759
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6760
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6761
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6762
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6763
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6764
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6765
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6766
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6767
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6768
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6769
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6770
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6771
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6772
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6773
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6774
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6775
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6776
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6777
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6778
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6779
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6780
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6781
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6782
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6783
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6784
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6785
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6786
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6787
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6788
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6789
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6790
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6791
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6792
    }/*function_udint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6793
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6794
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6795
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6796
 *WORD_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6797
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6798
    case function_word_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6799
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6800
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6801
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6802
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6803
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6804
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6805
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6806
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6807
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6808
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6809
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6810
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6811
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6812
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6813
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6814
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6815
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6816
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6817
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6818
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6819
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6820
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6821
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6822
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6823
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6824
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6825
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6826
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6827
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6828
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6829
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6830
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6831
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6832
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6833
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6834
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6835
    }/*function_word_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6836
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6837
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6838
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6839
 *WORD_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6840
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6841
    case function_word_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6842
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6843
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6844
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6845
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6846
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6847
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6848
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6849
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6850
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6851
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6852
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6853
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6854
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6855
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6856
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6857
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6858
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6859
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6860
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6861
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6862
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6863
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6864
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6865
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6866
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6867
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6868
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6869
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6870
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6871
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6872
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6873
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6874
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6875
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6876
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6877
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6878
    }/*function_word_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6879
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6880
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6881
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6882
 *WORD_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6883
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6884
    case function_word_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6885
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6886
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6887
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6888
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6889
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6890
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6891
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6892
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6893
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6894
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6895
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6896
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6897
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6898
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6899
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6900
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6901
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6902
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6903
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6904
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6905
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6906
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6907
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6908
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6909
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6910
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6911
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6912
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6913
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6914
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6915
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6916
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6917
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6918
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6919
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6920
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6921
    }/*function_word_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6922
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6923
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6924
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6925
 *WORD_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6926
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6927
    case function_word_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6928
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6929
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6930
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6931
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6932
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6933
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6934
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6935
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6936
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6937
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6938
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6939
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6940
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6941
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6942
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6943
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6944
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6945
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6946
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6947
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6948
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6949
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6950
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6951
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6952
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6953
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6954
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  6955
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6956
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6957
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6958
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6959
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6960
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6961
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6962
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6963
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6964
    }/*function_word_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6965
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6966
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6967
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6968
 *WORD_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6969
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6970
    case function_word_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6971
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6972
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6973
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6974
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6975
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6976
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6977
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6978
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6979
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6980
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6981
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6982
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6983
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6984
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6985
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6986
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6987
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6988
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6989
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6990
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6991
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6992
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6993
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  6994
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6995
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6996
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6997
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6998
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  6999
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7000
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7001
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7002
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7003
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7004
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7005
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7006
    }/*function_word_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7007
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7008
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7009
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7010
 *WORD_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7011
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7012
    case function_word_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7013
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7014
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7015
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7016
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7017
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7018
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7019
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7020
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7021
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7022
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7023
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7024
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7025
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7026
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7027
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7028
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7029
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7030
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7031
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7032
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7033
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7034
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7035
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7036
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7037
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7038
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7039
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7040
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7041
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7042
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7043
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7044
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7045
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7046
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7047
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7048
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7049
    }/*function_word_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7050
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7051
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7052
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7053
 *WORD_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7054
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7055
    case function_word_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7056
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7057
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7058
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7059
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7060
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7061
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7062
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7063
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7064
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7065
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7066
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7067
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7068
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7069
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7070
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7071
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7072
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7073
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7074
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7075
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7076
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7077
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7078
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7079
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7080
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7081
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7082
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7083
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7084
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7085
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7086
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7087
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7088
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7089
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7090
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7091
    }/*function_word_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7092
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7093
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7094
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7095
 *WORD_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7096
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7097
    case function_word_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7098
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7099
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7100
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7101
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7102
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7103
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7104
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7105
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7106
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7107
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7108
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7109
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7110
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7111
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7112
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7113
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7114
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7115
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7116
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7117
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7118
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7119
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7120
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7121
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7122
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7123
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7124
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7125
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7126
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7127
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7128
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7129
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7130
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7131
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7132
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7133
    }/*function_word_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7134
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7135
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7136
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7137
 *WORD_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7138
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7139
    case function_word_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7140
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7141
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7142
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7143
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7144
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7145
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7146
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7147
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7148
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7149
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7150
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7151
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7152
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7153
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7154
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7155
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7156
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7157
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7158
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7159
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7160
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7161
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7162
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7163
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7164
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7165
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7166
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7167
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7168
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7169
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7170
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7171
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7172
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7173
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7174
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7175
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7176
    }/*function_word_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7177
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7178
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7179
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7180
 *WORD_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7181
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7182
    case function_word_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7183
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7184
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7185
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7186
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7187
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7188
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7189
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7190
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7191
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7192
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7193
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7194
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7195
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7196
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7197
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7198
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7199
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7200
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7201
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7202
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7203
                function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7204
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7205
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7206
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7207
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7208
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7209
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7210
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7211
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7212
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7213
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7214
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7215
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7216
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7217
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7218
    }/*function_word_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7219
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7220
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7221
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7222
 *WORD_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7223
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7224
    case function_word_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7225
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7226
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7227
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7228
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7229
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7230
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7231
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7232
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7233
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7234
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7235
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7236
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7237
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7238
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7239
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7240
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7241
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7242
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7243
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7244
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7245
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7246
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7247
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7248
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7249
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7250
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7251
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7252
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7253
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7254
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7255
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7256
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7257
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7258
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7259
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7260
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7261
    }/*function_word_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7262
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7263
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7264
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7265
 *WORD_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7266
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7267
    case function_word_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7268
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7269
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7270
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7271
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7272
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7273
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7274
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7275
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7276
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7277
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7278
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7279
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7280
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7281
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7282
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7283
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7284
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7285
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7286
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7287
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7288
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7289
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7290
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7291
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7292
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7293
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7294
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7295
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7296
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7297
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7298
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7299
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7300
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7301
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7302
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7303
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7304
    }/*function_word_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7305
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7306
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7307
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7308
 *WORD_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7309
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7310
    case function_word_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7311
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7312
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7313
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7314
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7315
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7316
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7317
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7318
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7319
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7320
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7321
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7322
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7323
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7324
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7325
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7326
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7327
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7328
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7329
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7330
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7331
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7332
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7333
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7334
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7335
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7336
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7337
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7338
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7339
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7340
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7341
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7342
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7343
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7344
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7345
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7346
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7347
    }/*function_word_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7348
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7349
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7350
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7351
 *WORD_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7352
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7353
    case function_word_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7354
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7355
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7356
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7357
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7358
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7359
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7360
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7361
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7362
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7363
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7364
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7365
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7366
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7367
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7368
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7369
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7370
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7371
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7372
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7373
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7374
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7375
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7376
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7377
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7378
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7379
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7380
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7381
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7382
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7383
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7384
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7385
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7386
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7387
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7388
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7389
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7390
    }/*function_word_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7391
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7392
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7393
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7394
 *WORD_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7395
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7396
    case function_word_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7397
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7398
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7399
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7400
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7401
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7402
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7403
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7404
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7405
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7406
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7407
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7408
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7409
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7410
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7411
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7412
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7413
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7414
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7415
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7416
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7417
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7418
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7419
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7420
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7421
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7422
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7423
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7424
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7425
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7426
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7427
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7428
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7429
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7430
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7431
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7432
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7433
    }/*function_word_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7434
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7435
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7436
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7437
 *WORD_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7438
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7439
    case function_word_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7440
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7441
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7442
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7443
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7444
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7445
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7446
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7447
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7448
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7449
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7450
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7451
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7452
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7453
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7454
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7455
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7456
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7457
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7458
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7459
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7460
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7461
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7462
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7463
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7464
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7465
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7466
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7467
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7468
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7469
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7470
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7471
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7472
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7473
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7474
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7475
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7476
    }/*function_word_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7477
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7478
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7479
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7480
 *WORD_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7481
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7482
    case function_word_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7483
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7484
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7485
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7486
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7487
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7488
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7489
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7490
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7491
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7492
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7493
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7494
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7495
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7496
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7497
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7498
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7499
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7500
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7501
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7502
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7503
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7504
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7505
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7506
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7507
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7508
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7509
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7510
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7511
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7512
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7513
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7514
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7515
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7516
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7517
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7518
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7519
    }/*function_word_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7520
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7521
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7522
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7523
 *WORD_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7524
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7525
    case function_word_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7526
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7527
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7528
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7529
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7530
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7531
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7532
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7533
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7534
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7535
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7536
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7537
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7538
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7539
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7540
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7541
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7542
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7543
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7544
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7545
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7546
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7547
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7548
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7549
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7550
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7551
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7552
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7553
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7554
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7555
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7556
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7557
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7558
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7559
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7560
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7561
    }/*function_word_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7562
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7563
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7564
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7565
 *WORD_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7566
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7567
    case function_word_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7568
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7569
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7570
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7571
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7572
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7573
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7574
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7575
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7576
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7577
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7578
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7579
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7580
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7581
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7582
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7583
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7584
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7585
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7586
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7587
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7588
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7589
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7590
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7591
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7592
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7593
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7594
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  7595
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7596
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7597
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7598
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7599
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7600
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7601
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7602
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7603
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7604
    }/*function_word_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7605
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7606
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7607
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7608
 *STRING_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7609
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7610
    case function_string_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7611
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7612
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7613
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7614
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7615
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7616
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7617
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7618
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7619
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7620
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7621
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7622
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7623
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7624
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7625
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7626
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7627
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7628
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7629
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7630
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7631
                function_name = (symbol_c*)(new pragma_c("__string_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7632
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7633
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7634
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7635
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7636
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7637
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7638
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7639
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7640
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7641
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7642
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7643
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7644
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7645
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7646
    }/*function_string_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7647
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7648
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7649
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7650
 *STRING_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7651
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7652
    case function_string_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7653
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7654
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7655
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7656
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7657
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7658
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7659
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7660
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7661
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7662
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7663
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7664
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7665
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7666
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7667
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7668
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7669
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7670
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7671
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7672
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7673
                function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7674
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7675
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7676
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7677
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7678
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7679
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7680
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7681
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7682
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7683
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7684
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7685
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7686
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7687
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7688
    }/*function_string_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7689
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7690
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7691
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7692
 *STRING_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7693
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7694
    case function_string_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7695
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7696
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7697
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7698
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7699
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7700
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7701
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7702
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7703
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7704
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7705
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7706
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7707
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7708
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7709
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7710
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7711
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7712
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7713
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7714
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7715
                function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7716
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7717
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7718
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7719
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7720
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7721
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7722
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7723
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7724
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7725
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7726
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7727
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7728
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7729
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7730
    }/*function_string_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7731
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7732
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7733
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7734
 *STRING_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7735
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7736
    case function_string_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7737
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7738
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7739
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7740
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7741
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7742
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7743
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7744
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7745
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7746
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7747
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7748
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7749
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7750
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7751
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7752
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7753
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7754
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7755
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7756
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7757
                function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7758
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7759
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7760
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7761
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7762
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7763
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7764
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7765
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7766
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7767
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7768
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7769
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7770
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7771
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7772
    }/*function_string_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7773
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7774
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7775
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7776
 *STRING_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7777
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7778
    case function_string_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7779
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7780
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7781
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7782
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7783
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7784
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7785
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7786
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7787
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7788
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7789
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7790
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7791
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7792
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7793
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7794
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7795
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7796
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7797
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7798
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7799
                function_name = (symbol_c*)(new pragma_c("__string_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7800
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7801
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7802
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7803
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7804
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7805
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7806
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7807
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7808
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7809
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7810
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7811
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7812
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7813
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7814
    }/*function_string_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7815
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7816
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7817
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7818
 *STRING_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7819
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7820
    case function_string_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7821
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7822
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7823
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7824
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7825
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7826
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7827
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7828
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7829
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7830
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7831
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7832
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7833
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7834
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7835
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7836
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7837
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7838
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7839
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7840
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7841
                function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7842
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7843
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7844
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7845
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7846
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7847
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7848
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7849
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7850
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7851
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7852
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7853
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7854
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7855
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7856
    }/*function_string_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7857
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7858
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7859
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7860
 *STRING_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7861
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7862
    case function_string_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7863
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7864
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7865
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7866
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7867
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7868
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7869
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7870
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7871
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7872
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7873
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7874
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7875
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7876
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7877
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7878
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7879
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7880
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7881
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7882
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7883
                function_name = (symbol_c*)(new pragma_c("__string_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7884
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7885
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7886
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7887
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7888
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7889
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7890
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7891
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7892
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7893
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7894
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7895
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7896
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7897
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7898
    }/*function_string_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7899
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7900
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7901
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7902
 *STRING_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7903
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7904
    case function_string_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7905
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7906
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7907
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7908
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7909
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7910
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7911
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7912
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7913
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7914
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7915
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7916
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7917
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7918
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7919
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7920
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7921
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7922
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7923
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7924
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7925
                function_name = (symbol_c*)(new pragma_c("__string_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7926
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7927
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7928
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7929
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7930
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7931
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7932
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7933
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7934
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7935
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7936
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7937
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7938
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7939
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7940
    }/*function_string_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7941
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7942
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7943
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7944
 *STRING_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7945
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7946
    case function_string_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7947
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7948
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7949
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7950
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7951
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7952
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7953
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7954
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7955
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7956
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7957
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7958
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7959
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7960
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7961
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7962
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7963
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7964
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7965
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7966
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7967
                function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7968
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7969
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7970
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7971
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7972
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7973
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7974
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7975
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7976
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7977
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7978
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7979
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7980
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7981
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7982
    }/*function_string_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7983
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7984
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7985
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7986
 *STRING_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7987
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7988
    case function_string_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7989
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7990
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7991
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7992
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7993
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7994
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  7995
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7996
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7997
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7998
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  7999
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8000
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8001
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8002
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8003
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8004
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8005
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8006
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8007
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8008
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8009
                function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8010
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8011
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8012
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8013
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8014
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8015
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8016
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8017
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8018
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8019
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8020
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8021
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8022
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8023
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8024
    }/*function_string_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8025
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8026
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8027
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8028
 *STRING_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8029
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8030
    case function_string_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8031
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8032
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8033
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8034
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8035
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8036
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8037
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8038
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8039
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8040
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8041
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8042
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8043
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8044
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8045
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8046
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8047
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8048
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8049
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8050
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8051
                function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8052
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8053
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8054
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8055
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8056
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8057
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8058
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8059
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8060
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8061
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8062
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8063
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8064
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8065
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8066
    }/*function_string_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8067
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8068
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8069
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8070
 *STRING_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8071
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8072
    case function_string_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8073
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8074
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8075
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8076
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8077
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8078
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8079
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8080
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8081
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8082
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8083
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8084
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8085
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8086
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8087
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8088
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8089
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8090
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8091
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8092
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8093
                function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8094
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8095
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8096
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8097
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8098
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8099
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8100
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8101
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8102
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8103
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8104
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8105
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8106
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8107
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8108
    }/*function_string_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8109
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8110
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8111
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8112
 *STRING_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8113
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8114
    case function_string_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8115
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8116
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8117
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8118
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8119
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8120
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8121
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8122
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8123
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8124
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8125
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8126
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8127
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8128
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8129
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8130
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8131
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8132
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8133
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8134
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8135
                function_name = (symbol_c*)(new pragma_c("__string_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8136
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8137
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8138
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8139
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8140
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8141
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8142
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8143
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8144
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8145
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8146
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8147
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8148
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8149
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8150
    }/*function_string_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8151
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8152
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8153
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8154
 *STRING_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8155
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8156
    case function_string_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8157
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8158
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8159
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8160
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8161
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8162
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8163
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8164
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8165
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8166
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8167
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8168
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8169
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8170
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8171
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8172
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8173
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8174
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8175
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8176
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8177
                function_name = (symbol_c*)(new pragma_c("__string_to_bit"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8178
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8179
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8180
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8181
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8182
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8183
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8184
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8185
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8186
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8187
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8188
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8189
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8190
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8191
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8192
    }/*function_string_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8193
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8194
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8195
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8196
 *STRING_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8197
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8198
    case function_string_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8199
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8200
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8201
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8202
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8203
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8204
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8205
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8206
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8207
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8208
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8209
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8210
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8211
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8212
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8213
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8214
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8215
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8216
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8217
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8218
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8219
                function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8220
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8221
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8222
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8223
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8224
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8225
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8226
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8227
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8228
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8229
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8230
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8231
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8232
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8233
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8234
    }/*function_string_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8235
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8236
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8237
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8238
 *STRING_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8239
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8240
    case function_string_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8241
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8242
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8243
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8244
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8245
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8246
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8247
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8248
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8249
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8250
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8251
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8252
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8253
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8254
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8255
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8256
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8257
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8258
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8259
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8260
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8261
                function_name = (symbol_c*)(new pragma_c("__string_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8262
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8263
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8264
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8265
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8266
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8267
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8268
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8269
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8270
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8271
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8272
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8273
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8274
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8275
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8276
    }/*function_string_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8277
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8278
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8279
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8280
 *STRING_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8281
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8282
    case function_string_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8283
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8284
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8285
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8286
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8287
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8288
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8289
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8290
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8291
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8292
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8293
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8294
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8295
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8296
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8297
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8298
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8299
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8300
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8301
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8302
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8303
                function_name = (symbol_c*)(new pragma_c("__string_to_bool"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8304
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8305
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8306
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8307
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8308
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8309
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8310
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8311
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8312
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8313
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8314
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8315
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8316
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8317
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8318
    }/*function_string_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8319
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8320
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8321
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8322
 *STRING_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8323
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8324
    case function_string_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8325
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8326
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8327
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8328
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8329
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8330
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8331
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8332
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8333
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8334
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8335
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8336
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8337
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8338
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8339
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8340
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8341
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8342
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8343
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8344
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8345
                function_name = (symbol_c*)(new pragma_c("__string_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8346
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8347
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8348
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8349
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8350
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8351
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8352
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8353
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8354
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8355
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8356
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8357
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8358
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8359
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8360
    }/*function_string_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8361
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8362
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8363
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8364
 *STRING_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8365
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8366
    case function_string_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8367
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8368
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8369
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8370
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8371
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8372
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8373
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8374
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8375
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8376
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8377
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8378
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8379
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8380
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8381
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8382
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8383
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8384
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8385
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8386
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8387
                function_name = (symbol_c*)(new pragma_c("__string_to_sint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8388
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8389
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8390
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8391
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8392
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8393
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8394
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8395
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8396
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8397
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8398
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8399
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8400
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8401
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8402
    }/*function_string_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8403
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8404
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8405
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8406
 *LWORD_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8407
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8408
    case function_lword_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8409
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8410
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8411
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8412
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8413
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8414
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8415
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8416
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8417
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8418
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8419
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8420
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8421
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8422
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8423
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8424
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8425
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8426
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8427
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8428
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8429
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8430
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8431
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8432
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8433
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8434
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8435
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8436
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8437
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8438
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8439
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8440
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8441
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8442
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8443
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8444
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8445
    }/*function_lword_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8446
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8447
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8448
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8449
 *LWORD_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8450
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8451
    case function_lword_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8452
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8453
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8454
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8455
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8456
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8457
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8458
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8459
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8460
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8461
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8462
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8463
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8464
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8465
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8466
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8467
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8468
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8469
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8470
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8471
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8472
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8473
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8474
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8475
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8476
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8477
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8478
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8479
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8480
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8481
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8482
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8483
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8484
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8485
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8486
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8487
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8488
    }/*function_lword_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8489
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8490
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8491
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8492
 *LWORD_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8493
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8494
    case function_lword_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8495
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8496
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8497
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8498
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8499
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8500
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8501
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8502
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8503
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8504
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8505
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8506
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8507
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8508
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8509
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8510
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8511
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8512
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8513
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8514
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8515
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8516
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8517
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8518
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8519
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8520
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8521
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8522
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8523
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8524
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8525
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8526
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8527
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8528
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8529
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8530
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8531
    }/*function_lword_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8532
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8533
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8534
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8535
 *LWORD_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8536
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8537
    case function_lword_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8538
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8539
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8540
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8541
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8542
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8543
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8544
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8545
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8546
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8547
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8548
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8549
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8550
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8551
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8552
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8553
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8554
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8555
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8556
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8557
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8558
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8559
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8560
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8561
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8562
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8563
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8564
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8565
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8566
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8567
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8568
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8569
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8570
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8571
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8572
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8573
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8574
    }/*function_lword_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8575
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8576
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8577
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8578
 *LWORD_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8579
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8580
    case function_lword_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8581
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8582
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8583
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8584
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8585
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8586
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8587
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8588
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8589
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8590
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8591
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8592
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8593
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8594
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8595
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8596
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8597
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8598
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8599
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8600
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8601
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8602
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8603
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8604
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8605
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8606
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8607
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8608
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8609
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8610
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8611
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8612
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8613
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8614
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8615
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8616
    }/*function_lword_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8617
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8618
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8619
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8620
 *LWORD_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8621
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8622
    case function_lword_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8623
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8624
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8625
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8626
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8627
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8628
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8629
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8630
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8631
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8632
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8633
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8634
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8635
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8636
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8637
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8638
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8639
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8640
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8641
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8642
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8643
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8644
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8645
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8646
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8647
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8648
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8649
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8650
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8651
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8652
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8653
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8654
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8655
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8656
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8657
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8658
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8659
    }/*function_lword_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8660
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8661
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8662
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8663
 *LWORD_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8664
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8665
    case function_lword_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8666
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8667
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8668
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8669
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8670
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8671
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8672
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8673
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8674
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8675
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8676
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8677
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8678
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8679
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8680
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8681
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8682
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8683
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8684
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8685
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8686
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8687
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8688
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8689
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8690
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8691
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8692
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8693
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8694
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8695
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8696
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8697
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8698
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8699
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8700
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8701
    }/*function_lword_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8702
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8703
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8704
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8705
 *LWORD_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8706
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8707
    case function_lword_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8708
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8709
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8710
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8711
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8712
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8713
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8714
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8715
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8716
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8717
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8718
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8719
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8720
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8721
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8722
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8723
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8724
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8725
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8726
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8727
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8728
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8729
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8730
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8731
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8732
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8733
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8734
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8735
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8736
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8737
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8738
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8739
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8740
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8741
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8742
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8743
    }/*function_lword_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8744
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8745
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8746
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8747
 *LWORD_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8748
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8749
    case function_lword_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8750
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8751
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8752
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8753
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8754
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8755
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8756
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8757
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8758
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8759
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8760
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8761
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8762
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8763
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8764
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8765
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8766
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8767
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8768
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8769
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8770
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8771
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8772
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8773
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8774
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8775
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8776
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8777
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8778
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8779
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8780
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8781
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8782
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8783
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8784
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8785
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8786
    }/*function_lword_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8787
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8788
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8789
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8790
 *LWORD_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8791
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8792
    case function_lword_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8793
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8794
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8795
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8796
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8797
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8798
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8799
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8800
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8801
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8802
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8803
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8804
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8805
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8806
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8807
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8808
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8809
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8810
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8811
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8812
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8813
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8814
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8815
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8816
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8817
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8818
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8819
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8820
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8821
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8822
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8823
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8824
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8825
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8826
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8827
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8828
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8829
    }/*function_lword_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8830
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8831
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8832
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8833
 *LWORD_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8834
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8835
    case function_lword_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8836
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8837
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8838
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8839
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8840
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8841
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8842
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8843
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8844
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8845
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8846
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8847
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8848
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8849
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8850
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8851
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8852
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8853
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8854
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8855
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8856
                function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8857
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8858
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8859
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8860
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8861
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8862
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8863
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8864
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8865
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8866
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8867
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8868
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8869
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8870
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8871
    }/*function_lword_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8872
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8873
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8874
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8875
 *LWORD_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8876
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8877
    case function_lword_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8878
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8879
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8880
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8881
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8882
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8883
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8884
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8885
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8886
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8887
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8888
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8889
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8890
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8891
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8892
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8893
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8894
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8895
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8896
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8897
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8898
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8899
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8900
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8901
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8902
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8903
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8904
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8905
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8906
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8907
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8908
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8909
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8910
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8911
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8912
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8913
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8914
    }/*function_lword_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8915
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8916
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8917
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8918
 *LWORD_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8919
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8920
    case function_lword_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8921
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8922
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8923
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8924
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8925
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8926
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8927
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8928
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8929
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8930
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8931
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8932
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8933
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8934
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8935
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8936
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8937
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8938
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8939
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8940
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8941
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8942
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8943
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8944
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8945
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8946
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8947
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8948
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8949
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8950
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8951
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8952
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8953
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8954
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8955
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8956
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8957
    }/*function_lword_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8958
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8959
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8960
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8961
 *LWORD_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8962
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8963
    case function_lword_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8964
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8965
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8966
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8967
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8968
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8969
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8970
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8971
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8972
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8973
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8974
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8975
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8976
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8977
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8978
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8979
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8980
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8981
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8982
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8983
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8984
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8985
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8986
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  8987
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8988
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8989
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8990
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  8991
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8992
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8993
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8994
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8995
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8996
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8997
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8998
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  8999
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9000
    }/*function_lword_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9001
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9002
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9003
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9004
 *LWORD_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9005
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9006
    case function_lword_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9007
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9008
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9009
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9010
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9011
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9012
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9013
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9014
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9015
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9016
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9017
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9018
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9019
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9020
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9021
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9022
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9023
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9024
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9025
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9026
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9027
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9028
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9029
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9030
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9031
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9032
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9033
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9034
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9035
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9036
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9037
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9038
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9039
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9040
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9041
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9042
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9043
    }/*function_lword_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9044
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9045
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9046
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9047
 *LWORD_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9048
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9049
    case function_lword_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9050
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9051
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9052
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9053
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9054
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9055
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9056
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9057
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9058
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9059
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9060
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9061
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9062
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9063
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9064
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9065
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9066
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9067
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9068
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9069
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9070
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9071
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9072
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9073
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9074
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9075
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9076
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9077
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9078
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9079
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9080
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9081
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9082
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9083
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9084
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9085
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9086
    }/*function_lword_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9087
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9088
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9089
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9090
 *LWORD_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9091
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9092
    case function_lword_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9093
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9094
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9095
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9096
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9097
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9098
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9099
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9100
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9101
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9102
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9103
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9104
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9105
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9106
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9107
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9108
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9109
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9110
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9111
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9112
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9113
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9114
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9115
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9116
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9117
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9118
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9119
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9120
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9121
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9122
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9123
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9124
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9125
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9126
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9127
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9128
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9129
    }/*function_lword_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9130
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9131
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9132
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9133
 *LWORD_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9134
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9135
    case function_lword_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9136
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9137
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9138
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9139
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9140
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9141
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9142
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9143
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9144
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9145
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9146
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9147
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9148
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9149
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9150
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9151
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9152
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9153
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9154
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9155
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9156
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9157
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9158
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9159
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9160
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9161
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9162
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9163
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9164
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9165
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9166
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9167
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9168
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9169
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9170
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9171
    }/*function_lword_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9172
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9173
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9174
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9175
 *LWORD_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9176
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9177
    case function_lword_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9178
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9179
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9180
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9181
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9182
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9183
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9184
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9185
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9186
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9187
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9188
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9189
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9190
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9191
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9192
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9193
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9194
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9195
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9196
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9197
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9198
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9199
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9200
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9201
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9202
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9203
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9204
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9205
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9206
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9207
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9208
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9209
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9210
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9211
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9212
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9213
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9214
    }/*function_lword_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9215
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9216
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9217
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9218
 *UINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9219
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9220
    case function_uint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9221
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9222
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9223
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9224
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9225
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9226
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9227
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9228
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9229
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9230
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9231
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9232
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9233
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9234
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9235
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9236
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9237
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9238
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9239
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9240
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9241
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9242
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9243
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9244
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9245
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9246
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9247
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9248
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9249
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9250
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9251
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9252
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9253
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9254
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9255
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9256
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9257
    }/*function_uint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9258
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9259
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9260
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9261
 *UINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9262
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9263
    case function_uint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9264
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9265
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9266
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9267
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9268
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9269
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9270
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9271
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9272
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9273
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9274
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9275
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9276
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9277
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9278
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9279
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9280
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9281
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9282
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9283
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9284
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9285
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9286
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9287
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9288
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9289
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9290
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9291
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9292
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9293
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9294
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9295
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9296
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9297
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9298
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9299
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9300
    }/*function_uint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9301
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9302
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9303
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9304
 *UINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9305
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9306
    case function_uint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9307
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9308
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9309
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9310
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9311
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9312
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9313
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9314
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9315
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9316
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9317
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9318
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9319
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9320
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9321
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9322
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9323
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9324
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9325
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9326
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9327
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9328
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9329
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9330
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9331
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9332
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9333
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9334
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9335
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9336
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9337
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9338
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9339
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9340
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9341
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9342
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9343
    }/*function_uint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9344
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9345
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9346
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9347
 *UINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9348
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9349
    case function_uint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9350
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9351
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9352
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9353
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9354
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9355
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9356
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9357
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9358
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9359
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9360
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9361
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9362
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9363
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9364
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9365
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9366
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9367
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9368
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9369
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9370
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9371
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9372
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9373
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9374
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9375
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9376
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9377
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9378
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9379
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9380
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9381
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9382
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9383
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9384
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9385
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9386
    }/*function_uint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9387
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9388
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9389
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9390
 *UINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9391
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9392
    case function_uint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9393
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9394
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9395
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9396
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9397
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9398
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9399
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9400
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9401
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9402
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9403
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9404
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9405
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9406
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9407
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9408
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9409
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9410
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9411
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9412
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9413
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9414
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9415
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9416
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9417
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9418
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9419
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9420
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9421
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9422
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9423
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9424
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9425
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9426
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9427
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9428
    }/*function_uint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9429
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9430
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9431
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9432
 *UINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9433
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9434
    case function_uint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9435
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9436
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9437
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9438
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9439
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9440
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9441
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9442
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9443
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9444
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9445
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9446
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9447
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9448
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9449
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9450
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9451
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9452
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9453
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9454
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9455
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9456
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9457
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9458
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9459
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9460
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9461
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9462
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9463
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9464
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9465
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9466
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9467
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9468
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9469
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9470
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9471
    }/*function_uint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9472
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9473
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9474
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9475
 *UINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9476
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9477
    case function_uint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9478
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9479
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9480
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9481
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9482
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9483
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9484
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9485
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9486
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9487
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9488
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9489
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9490
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9491
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9492
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9493
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9494
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9495
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9496
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9497
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9498
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9499
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9500
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9501
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9502
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9503
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9504
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9505
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9506
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9507
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9508
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9509
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9510
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9511
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9512
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9513
    }/*function_uint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9514
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9515
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9516
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9517
 *UINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9518
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9519
    case function_uint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9520
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9521
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9522
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9523
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9524
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9525
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9526
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9527
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9528
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9529
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9530
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9531
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9532
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9533
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9534
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9535
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9536
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9537
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9538
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9539
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9540
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9541
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9542
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9543
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9544
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9545
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9546
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9547
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9548
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9549
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9550
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9551
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9552
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9553
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9554
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9555
    }/*function_uint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9556
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9557
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9558
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9559
 *UINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9560
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9561
    case function_uint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9562
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9563
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9564
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9565
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9566
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9567
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9568
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9569
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9570
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9571
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9572
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9573
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9574
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9575
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9576
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9577
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9578
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9579
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9580
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9581
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9582
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9583
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9584
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9585
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9586
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9587
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9588
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9589
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9590
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9591
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9592
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9593
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9594
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9595
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9596
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9597
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9598
    }/*function_uint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9599
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9600
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9601
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9602
 *UINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9603
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9604
    case function_uint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9605
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9606
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9607
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9608
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9609
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9610
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9611
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9612
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9613
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9614
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9615
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9616
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9617
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9618
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9619
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9620
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9621
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9622
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9623
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9624
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9625
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9626
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9627
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9628
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9629
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9630
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9631
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9632
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9633
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9634
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9635
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9636
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9637
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9638
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9639
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9640
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9641
    }/*function_uint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9642
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9643
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9644
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9645
 *UINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9646
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9647
    case function_uint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9648
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9649
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9650
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9651
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9652
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9653
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9654
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9655
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9656
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9657
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9658
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9659
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9660
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9661
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9662
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9663
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9664
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9665
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9666
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9667
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9668
                function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9669
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9670
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9671
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9672
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9673
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9674
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9675
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9676
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9677
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9678
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9679
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9680
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9681
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9682
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9683
    }/*function_uint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9684
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9685
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9686
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9687
 *UINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9688
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9689
    case function_uint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9690
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9691
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9692
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9693
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9694
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9695
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9696
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9697
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9698
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9699
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9700
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9701
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9702
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9703
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9704
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9705
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9706
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9707
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9708
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9709
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9710
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9711
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9712
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9713
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9714
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9715
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9716
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9717
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9718
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9719
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9720
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9721
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9722
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9723
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9724
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9725
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9726
    }/*function_uint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9727
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9728
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9729
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9730
 *UINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9731
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9732
    case function_uint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9733
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9734
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9735
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9736
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9737
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9738
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9739
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9740
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9741
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9742
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9743
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9744
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9745
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9746
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9747
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9748
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9749
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9750
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9751
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9752
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9753
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9754
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9755
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9756
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9757
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9758
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9759
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9760
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9761
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9762
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9763
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9764
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9765
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9766
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9767
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9768
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9769
    }/*function_uint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9770
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9771
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9772
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9773
 *UINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9774
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9775
    case function_uint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9776
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9777
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9778
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9779
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9780
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9781
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9782
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9783
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9784
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9785
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9786
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9787
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9788
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9789
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9790
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9791
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9792
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9793
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9794
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9795
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9796
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9797
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9798
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9799
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9800
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9801
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9802
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9803
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9804
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9805
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9806
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9807
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9808
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9809
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9810
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9811
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9812
    }/*function_uint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9813
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9814
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9815
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9816
 *UINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9817
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9818
    case function_uint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9819
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9820
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9821
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9822
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9823
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9824
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9825
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9826
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9827
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9828
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9829
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9830
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9831
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9832
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9833
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9834
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9835
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9836
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9837
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9838
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9839
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9840
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9841
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9842
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9843
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9844
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9845
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9846
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9847
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9848
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9849
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9850
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9851
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9852
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9853
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9854
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9855
    }/*function_uint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9856
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9857
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9858
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9859
 *UINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9860
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9861
    case function_uint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9862
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9863
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9864
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9865
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9866
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9867
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9868
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9869
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9870
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9871
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9872
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9873
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9874
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9875
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9876
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9877
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9878
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9879
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9880
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9881
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9882
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9883
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9884
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9885
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9886
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9887
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9888
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9889
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9890
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9891
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9892
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9893
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9894
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9895
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9896
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9897
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9898
    }/*function_uint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9899
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9900
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9901
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9902
 *UINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9903
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9904
    case function_uint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9905
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9906
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9907
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9908
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9909
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9910
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9911
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9912
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9913
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9914
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9915
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9916
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9917
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9918
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9919
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9920
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9921
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9922
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9923
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9924
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9925
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9926
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9927
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9928
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9929
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9930
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9931
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
  9932
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9933
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9934
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9935
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9936
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9937
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9938
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9939
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9940
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9941
    }/*function_uint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9942
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9943
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9944
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9945
 *UINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9946
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9947
    case function_uint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9948
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9949
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9950
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9951
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9952
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9953
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9954
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9955
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9956
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9957
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9958
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9959
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9960
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9961
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9962
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9963
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9964
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9965
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9966
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9967
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9968
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9969
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9970
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9971
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9972
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9973
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9974
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9975
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9976
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9977
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9978
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9979
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9980
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9981
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9982
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9983
    }/*function_uint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9984
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9985
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9986
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9987
 *UINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9988
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9989
    case function_uint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9990
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9991
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9992
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9993
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9994
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9995
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  9996
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9997
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9998
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  9999
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10000
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10001
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10002
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10003
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10004
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10005
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10006
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10007
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10008
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10009
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10010
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10011
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10012
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10013
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10014
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10015
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10016
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10017
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10018
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10019
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10020
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10021
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10022
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10023
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10024
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10025
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10026
    }/*function_uint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10027
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10028
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10029
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10030
 *LREAL_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10031
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10032
    case function_lreal_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10033
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10034
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10035
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10036
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10037
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10038
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10039
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10040
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10041
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10042
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10043
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10044
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10045
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10046
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10047
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10048
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10049
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10050
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10051
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10052
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10053
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10054
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10055
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10056
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10057
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10058
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10059
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10060
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10061
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10062
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10063
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10064
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10065
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10066
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10067
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10068
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10069
    }/*function_lreal_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10070
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10071
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10072
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10073
 *LREAL_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10074
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10075
    case function_lreal_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10076
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10077
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10078
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10079
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10080
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10081
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10082
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10083
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10084
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10085
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10086
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10087
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10088
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10089
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10090
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10091
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10092
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10093
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10094
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10095
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10096
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10097
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10098
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10099
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10100
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10101
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10102
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10103
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10104
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10105
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10106
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10107
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10108
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10109
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10110
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10111
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10112
    }/*function_lreal_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10113
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10114
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10115
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10116
 *LREAL_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10117
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10118
    case function_lreal_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10119
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10120
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10121
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10122
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10123
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10124
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10125
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10126
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10127
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10128
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10129
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10130
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10131
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10132
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10133
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10134
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10135
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10136
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10137
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10138
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10139
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10140
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10141
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10142
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10143
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10144
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10145
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10146
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10147
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10148
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10149
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10150
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10151
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10152
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10153
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10154
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10155
    }/*function_lreal_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10156
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10157
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10158
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10159
 *LREAL_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10160
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10161
    case function_lreal_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10162
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10163
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10164
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10165
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10166
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10167
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10168
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10169
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10170
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10171
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10172
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10173
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10174
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10175
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10176
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10177
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10178
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10179
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10180
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10181
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10182
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10183
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10184
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10185
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10186
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10187
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10188
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10189
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10190
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10191
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10192
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10193
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10194
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10195
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10196
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10197
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10198
    }/*function_lreal_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10199
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10200
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10201
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10202
 *LREAL_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10203
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10204
    case function_lreal_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10205
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10206
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10207
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10208
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10209
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10210
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10211
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10212
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10213
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10214
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10215
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10216
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10217
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10218
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10219
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10220
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10221
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10222
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10223
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10224
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10225
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10226
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10227
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10228
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10229
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10230
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10231
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10232
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10233
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10234
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10235
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10236
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10237
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10238
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10239
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10240
    }/*function_lreal_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10241
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10242
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10243
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10244
 *LREAL_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10245
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10246
    case function_lreal_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10247
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10248
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10249
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10250
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10251
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10252
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10253
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10254
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10255
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10256
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10257
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10258
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10259
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10260
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10261
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10262
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10263
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10264
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10265
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10266
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10267
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10268
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10269
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10270
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10271
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10272
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10273
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10274
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10275
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10276
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10277
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10278
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10279
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10280
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10281
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10282
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10283
    }/*function_lreal_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10284
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10285
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10286
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10287
 *LREAL_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10288
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10289
    case function_lreal_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10290
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10291
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10292
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10293
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10294
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10295
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10296
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10297
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10298
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10299
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10300
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10301
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10302
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10303
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10304
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10305
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10306
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10307
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10308
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10309
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10310
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10311
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10312
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10313
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10314
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10315
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10316
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10317
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10318
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10319
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10320
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10321
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10322
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10323
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10324
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10325
    }/*function_lreal_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10326
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10327
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10328
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10329
 *LREAL_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10330
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10331
    case function_lreal_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10332
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10333
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10334
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10335
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10336
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10337
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10338
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10339
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10340
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10341
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10342
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10343
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10344
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10345
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10346
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10347
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10348
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10349
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10350
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10351
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10352
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10353
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10354
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10355
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10356
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10357
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10358
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10359
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10360
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10361
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10362
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10363
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10364
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10365
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10366
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10367
    }/*function_lreal_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10368
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10369
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10370
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10371
 *LREAL_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10372
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10373
    case function_lreal_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10374
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10375
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10376
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10377
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10378
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10379
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10380
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10381
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10382
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10383
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10384
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10385
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10386
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10387
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10388
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10389
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10390
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10391
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10392
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10393
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10394
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10395
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10396
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10397
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10398
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10399
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10400
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10401
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10402
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10403
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10404
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10405
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10406
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10407
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10408
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10409
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10410
    }/*function_lreal_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10411
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10412
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10413
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10414
 *LREAL_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10415
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10416
    case function_lreal_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10417
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10418
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10419
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10420
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10421
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10422
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10423
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10424
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10425
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10426
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10427
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10428
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10429
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10430
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10431
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10432
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10433
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10434
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10435
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10436
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10437
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10438
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10439
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10440
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10441
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10442
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10443
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10444
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10445
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10446
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10447
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10448
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10449
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10450
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10451
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10452
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10453
    }/*function_lreal_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10454
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10455
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10456
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10457
 *LREAL_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10458
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10459
    case function_lreal_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10460
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10461
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10462
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10463
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10464
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10465
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10466
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10467
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10468
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10469
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10470
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10471
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10472
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10473
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10474
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10475
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10476
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10477
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10478
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10479
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10480
                function_name = (symbol_c*)(new pragma_c("__real_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10481
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10482
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10483
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10484
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10485
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10486
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10487
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10488
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10489
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10490
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10491
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10492
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10493
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10494
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10495
    }/*function_lreal_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10496
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10497
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10498
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10499
 *LREAL_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10500
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10501
    case function_lreal_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10502
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10503
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10504
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10505
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10506
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10507
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10508
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10509
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10510
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10511
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10512
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10513
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10514
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10515
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10516
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10517
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10518
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10519
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10520
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10521
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10522
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10523
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10524
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10525
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10526
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10527
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10528
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10529
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10530
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10531
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10532
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10533
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10534
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10535
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10536
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10537
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10538
    }/*function_lreal_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10539
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10540
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10541
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10542
 *LREAL_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10543
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10544
    case function_lreal_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10545
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10546
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10547
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10548
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10549
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10550
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10551
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10552
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10553
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10554
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10555
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10556
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10557
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10558
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10559
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10560
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10561
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10562
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10563
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10564
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10565
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10566
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10567
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10568
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10569
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10570
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10571
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10572
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10573
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10574
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10575
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10576
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10577
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10578
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10579
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10580
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10581
    }/*function_lreal_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10582
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10583
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10584
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10585
 *LREAL_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10586
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10587
    case function_lreal_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10588
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10589
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10590
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10591
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10592
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10593
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10594
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10595
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10596
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10597
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10598
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10599
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10600
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10601
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10602
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10603
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10604
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10605
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10606
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10607
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10608
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10609
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10610
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10611
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10612
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10613
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10614
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10615
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10616
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10617
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10618
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10619
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10620
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10621
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10622
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10623
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10624
    }/*function_lreal_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10625
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10626
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10627
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10628
 *LREAL_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10629
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10630
    case function_lreal_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10631
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10632
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10633
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10634
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10635
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10636
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10637
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10638
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10639
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10640
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10641
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10642
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10643
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10644
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10645
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10646
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10647
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10648
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10649
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10650
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10651
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10652
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10653
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10654
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10655
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10656
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10657
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10658
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10659
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10660
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10661
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10662
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10663
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10664
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10665
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10666
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10667
    }/*function_lreal_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10668
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10669
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10670
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10671
 *LREAL_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10672
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10673
    case function_lreal_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10674
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10675
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10676
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10677
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10678
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10679
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10680
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10681
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10682
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10683
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10684
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10685
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10686
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10687
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10688
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10689
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10690
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10691
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10692
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10693
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10694
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10695
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10696
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10697
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10698
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10699
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10700
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10701
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10702
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10703
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10704
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10705
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10706
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10707
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10708
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10709
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10710
    }/*function_lreal_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10711
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10712
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10713
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10714
 *LREAL_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10715
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10716
    case function_lreal_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10717
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10718
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10719
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10720
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10721
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10722
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10723
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10724
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10725
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10726
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10727
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10728
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10729
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10730
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10731
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10732
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10733
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10734
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10735
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10736
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10737
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10738
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10739
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10740
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10741
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10742
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10743
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10744
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10745
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10746
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10747
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10748
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10749
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10750
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10751
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10752
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10753
    }/*function_lreal_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10754
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10755
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10756
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10757
 *LREAL_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10758
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10759
    case function_lreal_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10760
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10761
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10762
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10763
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10764
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10765
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10766
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10767
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10768
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10769
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10770
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10771
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10772
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10773
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10774
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10775
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10776
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10777
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10778
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10779
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10780
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10781
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10782
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10783
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10784
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10785
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10786
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10787
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10788
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10789
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10790
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10791
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10792
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10793
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10794
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10795
    }/*function_lreal_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10796
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10797
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10798
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10799
 *LREAL_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10800
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10801
    case function_lreal_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10802
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10803
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10804
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10805
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10806
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10807
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10808
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10809
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10810
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10811
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10812
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10813
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10814
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10815
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10816
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10817
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10818
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10819
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lreal_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10820
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10821
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10822
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10823
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10824
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10825
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10826
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10827
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10828
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10829
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10830
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10831
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10832
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10833
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10834
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10835
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10836
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10837
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10838
    }/*function_lreal_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10839
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10840
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10841
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10842
 *BYTE_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10843
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10844
    case function_byte_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10845
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10846
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10847
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10848
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10849
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10850
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10851
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10852
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10853
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10854
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10855
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10856
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10857
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10858
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10859
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10860
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10861
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10862
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10863
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10864
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10865
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10866
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10867
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10868
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10869
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10870
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10871
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10872
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10873
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10874
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10875
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10876
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10877
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10878
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10879
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10880
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10881
    }/*function_byte_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10882
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10883
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10884
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10885
 *BYTE_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10886
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10887
    case function_byte_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10888
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10889
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10890
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10891
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10892
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10893
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10894
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10895
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10896
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10897
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10898
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10899
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10900
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10901
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10902
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10903
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10904
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10905
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10906
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10907
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10908
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10909
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10910
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10911
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10912
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10913
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10914
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10915
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10916
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10917
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10918
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10919
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10920
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10921
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10922
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10923
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10924
    }/*function_byte_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10925
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10926
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10927
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10928
 *BYTE_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10929
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10930
    case function_byte_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10931
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10932
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10933
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10934
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10935
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10936
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10937
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10938
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10939
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10940
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10941
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10942
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10943
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10944
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10945
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10946
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10947
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10948
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10949
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10950
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10951
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10952
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10953
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10954
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10955
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10956
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10957
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10958
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10959
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10960
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10961
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10962
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10963
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10964
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10965
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10966
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10967
    }/*function_byte_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10968
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10969
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10970
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10971
 *BYTE_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10972
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10973
    case function_byte_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10974
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10975
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10976
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10977
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10978
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10979
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10980
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10981
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10982
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10983
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10984
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10985
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10986
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10987
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10988
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10989
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10990
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10991
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10992
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10993
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 10994
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10995
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10996
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 10997
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10998
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 10999
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11000
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11001
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11002
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11003
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11004
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11005
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11006
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11007
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11008
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11009
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11010
    }/*function_byte_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11011
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11012
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11013
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11014
 *BYTE_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11015
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11016
    case function_byte_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11017
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11018
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11019
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11020
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11021
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11022
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11023
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11024
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11025
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11026
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11027
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11028
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11029
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11030
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11031
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11032
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11033
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11034
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11035
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11036
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11037
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11038
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11039
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11040
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11041
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11042
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11043
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11044
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11045
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11046
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11047
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11048
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11049
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11050
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11051
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11052
    }/*function_byte_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11053
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11054
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11055
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11056
 *BYTE_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11057
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11058
    case function_byte_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11059
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11060
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11061
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11062
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11063
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11064
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11065
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11066
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11067
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11068
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11069
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11070
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11071
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11072
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11073
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11074
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11075
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11076
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11077
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11078
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11079
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11080
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11081
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11082
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11083
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11084
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11085
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11086
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11087
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11088
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11089
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11090
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11091
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11092
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11093
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11094
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11095
    }/*function_byte_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11096
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11097
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11098
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11099
 *BYTE_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11100
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11101
    case function_byte_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11102
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11103
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11104
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11105
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11106
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11107
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11108
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11109
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11110
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11111
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11112
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11113
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11114
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11115
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11116
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11117
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11118
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11119
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11120
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11121
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11122
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11123
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11124
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11125
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11126
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11127
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11128
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11129
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11130
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11131
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11132
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11133
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11134
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11135
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11136
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11137
    }/*function_byte_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11138
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11139
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11140
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11141
 *BYTE_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11142
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11143
    case function_byte_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11144
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11145
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11146
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11147
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11148
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11149
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11150
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11151
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11152
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11153
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11154
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11155
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11156
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11157
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11158
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11159
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11160
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11161
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11162
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11163
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11164
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11165
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11166
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11167
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11168
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11169
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11170
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11171
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11172
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11173
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11174
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11175
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11176
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11177
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11178
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11179
    }/*function_byte_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11180
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11181
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11182
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11183
 *BYTE_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11184
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11185
    case function_byte_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11186
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11187
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11188
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11189
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11190
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11191
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11192
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11193
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11194
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11195
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11196
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11197
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11198
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11199
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11200
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11201
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11202
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11203
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11204
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11205
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11206
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11207
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11208
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11209
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11210
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11211
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11212
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11213
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11214
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11215
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11216
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11217
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11218
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11219
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11220
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11221
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11222
    }/*function_byte_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11223
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11224
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11225
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11226
 *BYTE_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11227
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11228
    case function_byte_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11229
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11230
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11231
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11232
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11233
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11234
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11235
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11236
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11237
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11238
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11239
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11240
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11241
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11242
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11243
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11244
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11245
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11246
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11247
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11248
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11249
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11250
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11251
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11252
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11253
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11254
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11255
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11256
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11257
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11258
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11259
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11260
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11261
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11262
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11263
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11264
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11265
    }/*function_byte_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11266
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11267
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11268
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11269
 *BYTE_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11270
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11271
    case function_byte_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11272
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11273
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11274
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11275
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11276
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11277
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11278
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11279
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11280
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11281
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11282
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11283
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11284
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11285
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11286
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11287
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11288
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11289
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11290
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11291
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11292
                function_name = (symbol_c*)(new pragma_c("__bit_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11293
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11294
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11295
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11296
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11297
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11298
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11299
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11300
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11301
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11302
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11303
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11304
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11305
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11306
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11307
    }/*function_byte_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11308
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11309
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11310
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11311
 *BYTE_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11312
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11313
    case function_byte_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11314
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11315
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11316
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11317
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11318
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11319
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11320
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11321
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11322
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11323
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11324
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11325
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11326
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11327
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11328
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11329
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11330
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11331
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11332
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11333
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11334
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11335
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11336
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11337
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11338
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11339
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11340
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11341
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11342
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11343
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11344
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11345
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11346
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11347
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11348
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11349
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11350
    }/*function_byte_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11351
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11352
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11353
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11354
 *BYTE_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11355
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11356
    case function_byte_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11357
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11358
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11359
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11360
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11361
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11362
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11363
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11364
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11365
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11366
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11367
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11368
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11369
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11370
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11371
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11372
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11373
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11374
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11375
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11376
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11377
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11378
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11379
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11380
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11381
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11382
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11383
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11384
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11385
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11386
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11387
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11388
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11389
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11390
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11391
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11392
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11393
    }/*function_byte_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11394
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11395
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11396
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11397
 *BYTE_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11398
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11399
    case function_byte_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11400
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11401
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11402
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11403
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11404
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11405
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11406
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11407
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11408
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11409
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11410
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11411
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11412
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11413
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11414
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11415
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11416
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11417
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11418
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11419
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11420
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11421
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11422
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11423
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11424
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11425
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11426
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11427
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11428
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11429
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11430
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11431
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11432
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11433
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11434
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11435
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11436
    }/*function_byte_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11437
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11438
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11439
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11440
 *BYTE_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11441
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11442
    case function_byte_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11443
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11444
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11445
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11446
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11447
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11448
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11449
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11450
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11451
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11452
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11453
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11454
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11455
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11456
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11457
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11458
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11459
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11460
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11461
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11462
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11463
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11464
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11465
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11466
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11467
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11468
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11469
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11470
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11471
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11472
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11473
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11474
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11475
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11476
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11477
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11478
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11479
    }/*function_byte_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11480
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11481
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11482
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11483
 *BYTE_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11484
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11485
    case function_byte_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11486
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11487
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11488
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11489
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11490
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11491
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11492
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11493
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11494
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11495
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11496
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11497
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11498
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11499
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11500
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11501
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11502
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11503
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11504
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11505
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11506
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11507
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11508
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11509
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11510
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11511
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11512
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11513
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11514
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11515
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11516
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11517
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11518
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11519
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11520
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11521
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11522
    }/*function_byte_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11523
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11524
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11525
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11526
 *BYTE_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11527
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11528
    case function_byte_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11529
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11530
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11531
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11532
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11533
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11534
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11535
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11536
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11537
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11538
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11539
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11540
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11541
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11542
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11543
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11544
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11545
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11546
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11547
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11548
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11549
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11550
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11551
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11552
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11553
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11554
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11555
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11556
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11557
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11558
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11559
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11560
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11561
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11562
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11563
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11564
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11565
    }/*function_byte_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11566
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11567
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11568
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11569
 *BYTE_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11570
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11571
    case function_byte_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11572
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11573
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11574
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11575
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11576
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11577
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11578
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11579
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11580
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11581
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11582
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11583
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11584
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11585
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11586
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11587
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11588
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11589
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11590
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11591
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11592
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11593
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11594
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11595
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11596
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11597
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11598
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11599
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11600
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11601
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11602
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11603
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11604
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11605
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11606
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11607
    }/*function_byte_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11608
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11609
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11610
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11611
 *BYTE_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11612
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11613
    case function_byte_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11614
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11615
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11616
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11617
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11618
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11619
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11620
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11621
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11622
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11623
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11624
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11625
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11626
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11627
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11628
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11629
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11630
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11631
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11632
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11633
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11634
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11635
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11636
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11637
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11638
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11639
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11640
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11641
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11642
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11643
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11644
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11645
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11646
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11647
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11648
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11649
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11650
    }/*function_byte_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11651
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11652
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11653
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11654
 *USINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11655
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11656
    case function_usint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11657
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11658
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11659
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11660
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11661
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11662
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11663
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11664
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11665
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11666
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11667
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11668
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11669
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11670
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11671
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11672
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11673
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11674
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11675
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11676
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11677
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11678
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11679
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11680
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11681
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11682
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11683
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11684
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11685
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11686
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11687
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11688
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11689
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11690
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11691
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11692
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11693
    }/*function_usint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11694
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11695
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11696
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11697
 *USINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11698
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11699
    case function_usint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11700
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11701
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11702
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11703
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11704
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11705
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11706
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11707
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11708
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11709
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11710
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11711
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11712
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11713
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11714
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11715
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11716
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11717
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11718
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11719
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11720
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11721
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11722
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11723
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11724
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11725
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11726
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11727
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11728
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11729
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11730
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11731
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11732
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11733
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11734
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11735
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11736
    }/*function_usint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11737
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11738
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11739
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11740
 *USINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11741
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11742
    case function_usint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11743
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11744
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11745
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11746
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11747
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11748
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11749
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11750
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11751
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11752
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11753
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11754
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11755
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11756
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11757
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11758
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11759
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11760
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11761
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11762
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11763
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11764
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11765
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11766
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11767
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11768
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11769
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11770
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11771
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11772
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11773
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11774
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11775
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11776
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11777
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11778
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11779
    }/*function_usint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11780
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11781
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11782
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11783
 *USINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11784
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11785
    case function_usint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11786
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11787
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11788
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11789
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11790
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11791
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11792
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11793
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11794
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11795
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11796
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11797
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11798
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11799
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11800
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11801
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11802
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11803
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11804
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11805
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11806
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11807
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11808
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11809
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11810
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11811
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11812
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11813
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11814
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11815
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11816
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11817
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11818
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11819
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11820
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11821
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11822
    }/*function_usint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11823
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11824
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11825
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11826
 *USINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11827
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11828
    case function_usint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11829
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11830
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11831
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11832
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11833
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11834
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11835
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11836
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11837
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11838
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11839
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11840
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11841
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11842
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11843
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11844
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11845
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11846
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11847
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11848
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11849
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11850
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11851
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11852
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11853
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11854
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11855
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11856
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11857
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11858
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11859
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11860
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11861
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11862
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11863
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11864
    }/*function_usint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11865
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11866
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11867
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11868
 *USINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11869
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11870
    case function_usint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11871
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11872
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11873
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11874
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11875
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11876
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11877
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11878
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11879
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11880
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11881
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11882
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11883
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11884
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11885
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11886
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11887
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11888
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11889
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11890
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11891
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11892
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11893
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11894
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11895
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11896
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11897
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 11898
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11899
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11900
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11901
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11902
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11903
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11904
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11905
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11906
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11907
    }/*function_usint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11908
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11909
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11910
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11911
 *USINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11912
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11913
    case function_usint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11914
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11915
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11916
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11917
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11918
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11919
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11920
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11921
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11922
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11923
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11924
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11925
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11926
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11927
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11928
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11929
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11930
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11931
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11932
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11933
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11934
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11935
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11936
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11937
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11938
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11939
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11940
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11941
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11942
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11943
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11944
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11945
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11946
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11947
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11948
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11949
    }/*function_usint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11950
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11951
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11952
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11953
 *USINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11954
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11955
    case function_usint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11956
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11957
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11958
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11959
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11960
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11961
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11962
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11963
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11964
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11965
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11966
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11967
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11968
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11969
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11970
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11971
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11972
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11973
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11974
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11975
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11976
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11977
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11978
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 11979
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11980
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11981
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11982
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11983
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11984
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11985
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11986
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11987
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11988
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11989
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11990
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11991
    }/*function_usint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11992
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11993
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11994
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11995
 *USINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11996
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11997
    case function_usint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11998
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 11999
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12000
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12001
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12002
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12003
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12004
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12005
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12006
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12007
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12008
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12009
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12010
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12011
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12012
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12013
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12014
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12015
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12016
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12017
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12018
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12019
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12020
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12021
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12022
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12023
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12024
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12025
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12026
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12027
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12028
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12029
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12030
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12031
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12032
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12033
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12034
    }/*function_usint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12035
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12036
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12037
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12038
 *USINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12039
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12040
    case function_usint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12041
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12042
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12043
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12044
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12045
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12046
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12047
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12048
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12049
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12050
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12051
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12052
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12053
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12054
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12055
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12056
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12057
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12058
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12059
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12060
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12061
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12062
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12063
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12064
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12065
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12066
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12067
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12068
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12069
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12070
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12071
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12072
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12073
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12074
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12075
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12076
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12077
    }/*function_usint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12078
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12079
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12080
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12081
 *USINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12082
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12083
    case function_usint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12084
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12085
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12086
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12087
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12088
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12089
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12090
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12091
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12092
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12093
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12094
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12095
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12096
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12097
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12098
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12099
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12100
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12101
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12102
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12103
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12104
                function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12105
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12106
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12107
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12108
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12109
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12110
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12111
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12112
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12113
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12114
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12115
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12116
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12117
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12118
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12119
    }/*function_usint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12120
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12121
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12122
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12123
 *USINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12124
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12125
    case function_usint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12126
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12127
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12128
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12129
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12130
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12131
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12132
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12133
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12134
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12135
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12136
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12137
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12138
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12139
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12140
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12141
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12142
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12143
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12144
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12145
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12146
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12147
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12148
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12149
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12150
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12151
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12152
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12153
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12154
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12155
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12156
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12157
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12158
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12159
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12160
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12161
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12162
    }/*function_usint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12163
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12164
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12165
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12166
 *USINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12167
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12168
    case function_usint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12169
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12170
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12171
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12172
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12173
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12174
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12175
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12176
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12177
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12178
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12179
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12180
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12181
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12182
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12183
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12184
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12185
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12186
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12187
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12188
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12189
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12190
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12191
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12192
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12193
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12194
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12195
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12196
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12197
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12198
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12199
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12200
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12201
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12202
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12203
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12204
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12205
    }/*function_usint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12206
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12207
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12208
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12209
 *USINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12210
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12211
    case function_usint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12212
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12213
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12214
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12215
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12216
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12217
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12218
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12219
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12220
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12221
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12222
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12223
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12224
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12225
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12226
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12227
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12228
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12229
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12230
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12231
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12232
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12233
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12234
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12235
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12236
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12237
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12238
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12239
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12240
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12241
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12242
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12243
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12244
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12245
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12246
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12247
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12248
    }/*function_usint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12249
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12250
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12251
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12252
 *USINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12253
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12254
    case function_usint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12255
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12256
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12257
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12258
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12259
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12260
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12261
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12262
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12263
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12264
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12265
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12266
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12267
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12268
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12269
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12270
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12271
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12272
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12273
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12274
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12275
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12276
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12277
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12278
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12279
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12280
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12281
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12282
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12283
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12284
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12285
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12286
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12287
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12288
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12289
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12290
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12291
    }/*function_usint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12292
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12293
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12294
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12295
 *USINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12296
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12297
    case function_usint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12298
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12299
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12300
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12301
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12302
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12303
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12304
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12305
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12306
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12307
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12308
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12309
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12310
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12311
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12312
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12313
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12314
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12315
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12316
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12317
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12318
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12319
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12320
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12321
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12322
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12323
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12324
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12325
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12326
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12327
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12328
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12329
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12330
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12331
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12332
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12333
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12334
    }/*function_usint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12335
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12336
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12337
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12338
 *USINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12339
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12340
    case function_usint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12341
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12342
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12343
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12344
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12345
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12346
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12347
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12348
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12349
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12350
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12351
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12352
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12353
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12354
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12355
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12356
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12357
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12358
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12359
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12360
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12361
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12362
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12363
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12364
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12365
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12366
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12367
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12368
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12369
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12370
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12371
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12372
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12373
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12374
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12375
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12376
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12377
    }/*function_usint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12378
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12379
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12380
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12381
 *USINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12382
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12383
    case function_usint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12384
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12385
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12386
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12387
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12388
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12389
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12390
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12391
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12392
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12393
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12394
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12395
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12396
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12397
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12398
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12399
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12400
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12401
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12402
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12403
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12404
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12405
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12406
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12407
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12408
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12409
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12410
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12411
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12412
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12413
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12414
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12415
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12416
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12417
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12418
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12419
    }/*function_usint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12420
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12421
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12422
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12423
 *USINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12424
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12425
    case function_usint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12426
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12427
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12428
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12429
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12430
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12431
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12432
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12433
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12434
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12435
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12436
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12437
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12438
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12439
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12440
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12441
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12442
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12443
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12444
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12445
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12446
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12447
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12448
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12449
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12450
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12451
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12452
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12453
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12454
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12455
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12456
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12457
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12458
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12459
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12460
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12461
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12462
    }/*function_usint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12463
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12464
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12465
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12466
 *ULINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12467
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12468
    case function_ulint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12469
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12470
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12471
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12472
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12473
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12474
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12475
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12476
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12477
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12478
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12479
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12480
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12481
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12482
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12483
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12484
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12485
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12486
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12487
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12488
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12489
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12490
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12491
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12492
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12493
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12494
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12495
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12496
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12497
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12498
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12499
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12500
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12501
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12502
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12503
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12504
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12505
    }/*function_ulint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12506
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12507
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12508
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12509
 *ULINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12510
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12511
    case function_ulint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12512
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12513
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12514
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12515
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12516
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12517
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12518
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12519
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12520
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12521
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12522
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12523
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12524
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12525
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12526
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12527
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12528
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12529
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12530
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12531
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12532
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12533
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12534
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12535
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12536
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12537
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12538
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12539
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12540
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12541
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12542
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12543
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12544
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12545
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12546
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12547
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12548
    }/*function_ulint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12549
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12550
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12551
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12552
 *ULINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12553
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12554
    case function_ulint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12555
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12556
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12557
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12558
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12559
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12560
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12561
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12562
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12563
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12564
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12565
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12566
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12567
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12568
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12569
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12570
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12571
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12572
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12573
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12574
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12575
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12576
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12577
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12578
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12579
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12580
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12581
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12582
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12583
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12584
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12585
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12586
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12587
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12588
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12589
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12590
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12591
    }/*function_ulint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12592
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12593
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12594
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12595
 *ULINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12596
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12597
    case function_ulint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12598
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12599
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12600
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12601
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12602
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12603
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12604
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12605
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12606
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12607
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12608
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12609
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12610
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12611
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12612
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12613
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12614
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12615
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12616
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12617
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12618
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12619
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12620
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12621
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12622
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12623
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12624
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12625
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12626
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12627
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12628
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12629
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12630
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12631
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12632
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12633
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12634
    }/*function_ulint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12635
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12636
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12637
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12638
 *ULINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12639
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12640
    case function_ulint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12641
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12642
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12643
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12644
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12645
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12646
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12647
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12648
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12649
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12650
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12651
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12652
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12653
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12654
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12655
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12656
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12657
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12658
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12659
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12660
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12661
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12662
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12663
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12664
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12665
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12666
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12667
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12668
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12669
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12670
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12671
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12672
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12673
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12674
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12675
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12676
    }/*function_ulint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12677
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12678
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12679
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12680
 *ULINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12681
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12682
    case function_ulint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12683
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12684
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12685
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12686
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12687
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12688
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12689
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12690
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12691
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12692
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12693
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12694
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12695
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12696
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12697
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12698
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12699
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12700
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12701
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12702
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12703
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12704
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12705
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12706
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12707
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12708
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12709
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12710
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12711
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12712
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12713
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12714
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12715
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12716
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12717
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12718
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12719
    }/*function_ulint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12720
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12721
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12722
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12723
 *ULINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12724
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12725
    case function_ulint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12726
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12727
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12728
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12729
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12730
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12731
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12732
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12733
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12734
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12735
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12736
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12737
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12738
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12739
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12740
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12741
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12742
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12743
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12744
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12745
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12746
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12747
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12748
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12749
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12750
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12751
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12752
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12753
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12754
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12755
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12756
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12757
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12758
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12759
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12760
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12761
    }/*function_ulint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12762
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12763
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12764
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12765
 *ULINT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12766
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12767
    case function_ulint_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12768
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12769
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12770
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12771
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12772
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12773
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12774
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12775
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12776
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12777
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12778
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12779
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12780
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12781
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12782
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12783
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12784
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12785
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12786
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12787
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12788
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12789
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12790
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12791
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12792
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12793
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12794
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12795
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12796
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12797
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12798
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12799
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12800
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12801
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12802
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12803
    }/*function_ulint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12804
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12805
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12806
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12807
 *ULINT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12808
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12809
    case function_ulint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12810
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12811
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12812
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12813
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12814
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12815
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12816
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12817
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12818
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12819
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12820
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12821
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12822
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12823
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12824
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12825
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12826
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12827
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12828
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12829
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12830
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12831
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12832
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12833
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12834
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12835
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12836
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12837
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12838
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12839
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12840
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12841
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12842
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12843
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12844
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12845
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12846
    }/*function_ulint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12847
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12848
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12849
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12850
 *ULINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12851
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12852
    case function_ulint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12853
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12854
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12855
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12856
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12857
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12858
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12859
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12860
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12861
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12862
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12863
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12864
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12865
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12866
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12867
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12868
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12869
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12870
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12871
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12872
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12873
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12874
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12875
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12876
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12877
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12878
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12879
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12880
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12881
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12882
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12883
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12884
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12885
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12886
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12887
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12888
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12889
    }/*function_ulint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12890
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12891
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12892
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12893
 *ULINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12894
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12895
    case function_ulint_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12896
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12897
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12898
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12899
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12900
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12901
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12902
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12903
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12904
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12905
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12906
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12907
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12908
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12909
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12910
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12911
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12912
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12913
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12914
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12915
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12916
                function_name = (symbol_c*)(new pragma_c("__uint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12917
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12918
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12919
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12920
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12921
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12922
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12923
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12924
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12925
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12926
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12927
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12928
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12929
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12930
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12931
    }/*function_ulint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12932
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12933
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12934
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12935
 *ULINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12936
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12937
    case function_ulint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12938
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12939
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12940
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12941
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12942
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12943
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12944
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12945
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12946
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12947
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12948
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12949
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12950
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12951
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12952
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12953
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12954
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12955
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12956
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12957
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12958
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12959
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12960
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12961
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12962
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12963
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12964
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 12965
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12966
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12967
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12968
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12969
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12970
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12971
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12972
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12973
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12974
    }/*function_ulint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12975
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12976
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12977
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12978
 *ULINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12979
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12980
    case function_ulint_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12981
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12982
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12983
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12984
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12985
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12986
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 12987
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12988
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12989
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12990
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12991
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12992
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12993
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12994
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12995
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12996
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12997
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12998
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 12999
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13000
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13001
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13002
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13003
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13004
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13005
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13006
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13007
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13008
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13009
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13010
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13011
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13012
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13013
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13014
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13015
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13016
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13017
    }/*function_ulint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13018
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13019
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13020
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13021
 *ULINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13022
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13023
    case function_ulint_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13024
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13025
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13026
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13027
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13028
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13029
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13030
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13031
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13032
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13033
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13034
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13035
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13036
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13037
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13038
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13039
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13040
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13041
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13042
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13043
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13044
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13045
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13046
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13047
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13048
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13049
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13050
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13051
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13052
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13053
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13054
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13055
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13056
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13057
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13058
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13059
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13060
    }/*function_ulint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13061
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13062
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13063
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13064
 *ULINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13065
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13066
    case function_ulint_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13067
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13068
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13069
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13070
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13071
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13072
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13073
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13074
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13075
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13076
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13077
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13078
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13079
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13080
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13081
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13082
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13083
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13084
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13085
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13086
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13087
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13088
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13089
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13090
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13091
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13092
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13093
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13094
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13095
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13096
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13097
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13098
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13099
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13100
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13101
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13102
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13103
    }/*function_ulint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13104
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13105
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13106
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13107
 *ULINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13108
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13109
    case function_ulint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13110
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13111
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13112
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13113
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13114
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13115
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13116
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13117
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13118
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13119
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13120
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13121
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13122
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13123
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13124
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13125
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13126
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13127
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13128
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13129
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13130
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13131
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13132
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13133
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13134
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13135
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13136
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13137
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13138
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13139
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13140
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13141
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13142
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13143
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13144
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13145
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13146
    }/*function_ulint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13147
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13148
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13149
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13150
 *ULINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13151
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13152
    case function_ulint_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13153
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13154
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13155
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13156
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13157
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13158
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13159
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13160
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13161
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13162
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13163
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13164
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13165
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13166
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13167
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13168
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13169
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13170
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13171
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13172
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13173
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13174
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13175
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13176
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13177
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13178
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13179
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13180
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13181
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13182
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13183
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13184
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13185
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13186
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13187
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13188
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13189
    }/*function_ulint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13190
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13191
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13192
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13193
 *ULINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13194
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13195
    case function_ulint_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13196
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13197
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13198
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13199
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13200
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13201
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13202
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13203
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13204
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13205
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13206
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13207
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13208
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13209
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13210
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13211
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13212
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13213
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13214
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13215
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13216
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13217
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13218
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13219
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13220
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13221
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13222
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13223
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13224
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13225
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13226
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13227
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13228
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13229
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13230
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13231
    }/*function_ulint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13232
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13233
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13234
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13235
 *ULINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13236
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13237
    case function_ulint_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13238
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13239
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13240
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13241
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13242
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13243
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13244
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13245
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13246
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13247
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13248
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13249
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13250
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13251
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13252
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13253
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13254
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13255
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13256
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13257
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13258
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13259
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13260
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13261
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13262
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13263
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13264
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13265
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13266
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13267
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13268
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13269
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13270
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13271
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13272
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13273
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13274
    }/*function_ulint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13275
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13276
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13277
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13278
 *BOOL_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13279
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13280
    case function_bool_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13281
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13282
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13283
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13284
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13285
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13286
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13287
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13288
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13289
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13290
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13291
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13292
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13293
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13294
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13295
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13296
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13297
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13298
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13299
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13300
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13301
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13302
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13303
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13304
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13305
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13306
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13307
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13308
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13309
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13310
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13311
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13312
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13313
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13314
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13315
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13316
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13317
    }/*function_bool_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13318
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13319
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13320
/****
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13321
 *BOOL_TO_SINT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13322
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13323
    case function_bool_to_sint :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13324
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13325
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13326
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13327
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13328
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13329
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13330
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13331
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13332
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13333
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13334
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13335
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13336
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13337
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13338
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13339
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13340
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13341
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13342
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13343
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13344
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13345
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13346
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13347
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13348
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13349
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13350
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13351
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13352
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13353
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13354
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13355
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13356
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13357
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13358
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13359
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13360
    }/*function_bool_to_sint*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13361
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13362
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 13363
/****
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13364
 *BOOL_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13365
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13366
    case function_bool_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13367
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13368
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13369
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13370
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13371
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13372
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13373
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13374
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13375
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13376
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13377
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13378
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13379
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13380
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13381
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13382
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13383
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13384
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13385
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13386
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13387
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13388
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13389
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13390
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13391
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13392
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13393
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13394
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13395
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13396
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13397
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13398
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13399
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13400
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13401
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13402
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13403
    }/*function_bool_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13404
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13405
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13406
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13407
 *BOOL_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13408
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13409
    case function_bool_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13410
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13411
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13412
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13413
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13414
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13415
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13416
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13417
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13418
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13419
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13420
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13421
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13422
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13423
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13424
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13425
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13426
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13427
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13428
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13429
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13430
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13431
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13432
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13433
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13434
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13435
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13436
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13437
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13438
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13439
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13440
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13441
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13442
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13443
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13444
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13445
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13446
    }/*function_bool_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13447
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13448
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13449
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13450
 *BOOL_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13451
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13452
    case function_bool_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13453
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13454
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13455
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13456
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13457
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13458
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13459
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13460
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13461
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13462
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13463
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13464
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13465
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13466
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13467
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13468
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13469
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13470
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13471
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13472
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13473
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13474
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13475
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13476
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13477
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13478
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13479
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13480
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13481
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13482
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13483
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13484
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13485
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13486
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13487
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13488
    }/*function_bool_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13489
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13490
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13491
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13492
 *BOOL_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13493
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13494
    case function_bool_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13495
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13496
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13497
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13498
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13499
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13500
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13501
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13502
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13503
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13504
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13505
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13506
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13507
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13508
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13509
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13510
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13511
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13512
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13513
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13514
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13515
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13516
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13517
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13518
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13519
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13520
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13521
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13522
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13523
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13524
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13525
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13526
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13527
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13528
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13529
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13530
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13531
    }/*function_bool_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13532
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13533
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13534
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13535
 *BOOL_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13536
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13537
    case function_bool_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13538
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13539
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13540
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13541
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13542
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13543
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13544
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13545
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13546
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13547
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13548
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13549
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13550
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13551
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13552
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13553
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13554
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13555
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13556
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13557
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13558
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13559
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13560
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13561
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13562
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13563
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13564
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13565
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13566
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13567
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13568
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13569
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13570
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13571
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13572
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13573
    }/*function_bool_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13574
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13575
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13576
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13577
 *BOOL_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13578
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13579
    case function_bool_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13580
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13581
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13582
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13583
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13584
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13585
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13586
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13587
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13588
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13589
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13590
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13591
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13592
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13593
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13594
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13595
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13596
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13597
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13598
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13599
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13600
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13601
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13602
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13603
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13604
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13605
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13606
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13607
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13608
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13609
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13610
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13611
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13612
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13613
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13614
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13615
    }/*function_bool_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13616
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13617
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13618
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13619
 *BOOL_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13620
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13621
    case function_bool_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13622
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13623
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13624
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13625
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13626
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13627
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13628
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13629
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13630
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13631
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13632
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13633
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13634
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13635
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13636
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13637
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13638
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13639
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13640
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13641
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13642
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13643
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13644
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13645
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13646
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13647
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13648
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13649
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13650
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13651
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13652
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13653
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13654
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13655
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13656
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13657
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13658
    }/*function_bool_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13659
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13660
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13661
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13662
 *BOOL_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13663
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13664
    case function_bool_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13665
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13666
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13667
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13668
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13669
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13670
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13671
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13672
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13673
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13674
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13675
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13676
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13677
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13678
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13679
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13680
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13681
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13682
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13683
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13684
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13685
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13686
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13687
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13688
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13689
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13690
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13691
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13692
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13693
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13694
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13695
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13696
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13697
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13698
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13699
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13700
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13701
    }/*function_bool_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13702
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13703
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13704
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13705
 *BOOL_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13706
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13707
    case function_bool_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13708
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13709
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13710
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13711
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13712
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13713
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13714
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13715
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13716
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13717
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13718
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13719
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13720
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13721
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13722
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13723
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13724
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13725
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13726
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13727
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13728
                function_name = (symbol_c*)(new pragma_c("__bool_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13729
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13730
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13731
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13732
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13733
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13734
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13735
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13736
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13737
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13738
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13739
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13740
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13741
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13742
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13743
    }/*function_bool_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13744
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13745
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13746
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13747
 *BOOL_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13748
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13749
    case function_bool_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13750
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13751
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13752
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13753
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13754
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13755
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13756
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13757
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13758
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13759
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13760
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13761
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13762
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13763
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13764
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13765
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13766
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13767
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13768
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13769
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13770
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13771
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13772
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13773
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13774
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13775
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13776
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13777
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13778
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13779
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13780
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13781
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13782
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13783
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13784
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13785
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13786
    }/*function_bool_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13787
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13788
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13789
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13790
 *BOOL_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13791
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13792
    case function_bool_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13793
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13794
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13795
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13796
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13797
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13798
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13799
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13800
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13801
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13802
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13803
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13804
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13805
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13806
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13807
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13808
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13809
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13810
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13811
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13812
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13813
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13814
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13815
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13816
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13817
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13818
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13819
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13820
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13821
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13822
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13823
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13824
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13825
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13826
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13827
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13828
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13829
    }/*function_bool_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13830
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13831
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13832
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13833
 *BOOL_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13834
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13835
    case function_bool_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13836
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13837
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13838
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13839
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13840
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13841
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13842
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13843
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13844
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13845
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13846
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13847
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13848
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13849
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13850
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13851
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13852
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13853
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13854
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13855
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13856
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13857
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13858
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13859
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13860
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13861
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13862
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13863
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13864
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13865
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13866
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13867
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13868
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13869
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13870
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13871
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13872
    }/*function_bool_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13873
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13874
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13875
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13876
 *BOOL_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13877
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13878
    case function_bool_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13879
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13880
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13881
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13882
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13883
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13884
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13885
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13886
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13887
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13888
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13889
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13890
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13891
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13892
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13893
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13894
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13895
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13896
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13897
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13898
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13899
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13900
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13901
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13902
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13903
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13904
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13905
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13906
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13907
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13908
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13909
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13910
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13911
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13912
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13913
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13914
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13915
    }/*function_bool_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13916
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13917
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13918
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13919
 *BOOL_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13920
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13921
    case function_bool_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13922
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13923
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13924
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13925
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13926
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13927
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13928
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13929
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13930
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13931
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13932
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13933
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13934
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13935
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13936
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13937
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13938
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13939
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13940
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13941
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13942
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13943
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13944
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13945
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13946
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13947
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13948
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13949
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13950
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13951
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13952
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13953
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13954
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13955
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13956
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13957
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13958
    }/*function_bool_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13959
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13960
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13961
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13962
 *BOOL_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13963
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13964
    case function_bool_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13965
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13966
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13967
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13968
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13969
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13970
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13971
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13972
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13973
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13974
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13975
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13976
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13977
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13978
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13979
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13980
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13981
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13982
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13983
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13984
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13985
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13986
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13987
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 13988
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13989
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13990
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13991
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 13992
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13993
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13994
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13995
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13996
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13997
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13998
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 13999
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14000
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14001
    }/*function_bool_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14002
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14003
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14004
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14005
 *BOOL_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14006
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14007
    case function_bool_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14008
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14009
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14010
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14011
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14012
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14013
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14014
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14015
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14016
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14017
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14018
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14019
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14020
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14021
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14022
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14023
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14024
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14025
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14026
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14027
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14028
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14029
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14030
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14031
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14032
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14033
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14034
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14035
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14036
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14037
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14038
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14039
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14040
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14041
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14042
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14043
    }/*function_bool_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14044
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14045
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14046
/****
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14047
 *BOOL_TO_INT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14048
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14049
    case function_bool_to_int :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14050
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14051
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14052
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14053
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14054
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14055
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14056
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14057
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14058
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14059
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14060
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14061
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14062
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14063
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14064
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14065
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14066
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14067
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14068
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14069
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14070
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14071
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14072
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14073
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14074
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14075
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14076
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14077
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14078
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14079
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14080
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14081
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14082
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14083
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14084
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14085
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14086
    }/*function_bool_to_int*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14087
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14088
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14089
/****
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14090
 *TIME_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14091
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14092
    case function_time_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14093
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14094
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14095
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14096
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14097
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14098
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14099
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14100
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14101
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14102
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14103
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14104
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14105
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14106
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14107
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14108
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14109
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14110
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14111
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14112
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14113
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14114
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14115
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14116
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14117
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14118
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14119
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14120
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14121
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14122
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14123
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14124
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14125
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14126
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14127
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14128
    }/*function_time_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14129
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14130
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14131
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14132
 *TIME_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14133
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14134
    case function_time_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14135
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14136
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14137
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14138
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14139
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14140
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14141
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14142
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14143
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14144
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14145
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14146
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14147
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14148
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14149
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14150
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14151
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14152
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14153
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14154
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14155
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14156
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14157
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14158
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14159
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14160
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14161
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14162
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14163
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14164
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14165
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14166
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14167
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14168
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14169
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14170
    }/*function_time_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14171
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14172
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14173
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14174
 *TIME_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14175
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14176
    case function_time_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14177
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14178
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14179
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14180
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14181
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14182
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14183
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14184
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14185
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14186
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14187
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14188
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14189
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14190
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14191
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14192
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14193
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14194
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14195
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14196
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14197
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14198
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14199
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14200
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14201
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14202
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14203
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14204
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14205
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14206
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14207
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14208
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14209
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14210
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14211
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14212
    }/*function_time_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14213
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14214
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14215
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14216
 *TIME_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14217
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14218
    case function_time_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14219
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14220
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14221
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14222
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14223
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14224
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14225
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14226
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14227
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14228
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14229
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14230
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14231
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14232
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14233
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14234
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14235
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14236
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14237
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14238
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14239
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14240
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14241
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14242
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14243
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14244
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14245
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14246
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14247
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14248
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14249
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14250
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14251
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14252
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14253
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14254
    }/*function_time_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14255
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14256
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14257
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14258
 *TIME_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14259
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14260
    case function_time_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14261
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14262
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14263
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14264
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14265
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14266
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14267
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14268
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14269
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14270
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14271
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14272
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14273
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14274
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14275
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14276
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14277
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14278
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14279
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14280
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14281
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14282
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14283
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14284
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14285
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14286
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14287
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14288
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14289
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14290
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14291
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14292
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14293
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14294
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14295
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14296
    }/*function_time_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14297
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14298
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14299
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14300
 *TIME_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14301
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14302
    case function_time_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14303
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14304
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14305
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14306
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14307
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14308
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14309
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14310
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14311
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14312
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14313
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14314
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14315
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14316
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14317
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14318
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14319
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14320
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14321
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14322
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14323
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14324
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14325
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14326
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14327
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14328
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14329
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14330
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14331
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14332
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14333
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14334
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14335
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14336
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14337
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14338
    }/*function_time_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14339
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14340
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14341
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14342
 *TIME_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14343
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14344
    case function_time_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14345
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14346
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14347
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14348
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14349
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14350
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14351
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14352
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14353
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14354
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14355
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14356
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14357
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14358
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14359
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14360
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14361
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14362
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14363
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14364
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14365
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14366
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14367
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14368
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14369
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14370
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14371
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14372
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14373
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14374
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14375
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14376
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14377
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14378
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14379
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14380
    }/*function_time_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14381
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14382
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14383
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14384
 *TIME_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14385
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14386
    case function_time_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14387
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14388
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14389
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14390
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14391
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14392
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14393
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14394
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14395
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14396
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14397
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14398
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14399
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14400
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14401
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14402
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14403
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14404
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14405
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14406
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14407
                function_name = (symbol_c*)(new pragma_c("__time_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14408
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14409
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14410
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14411
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14412
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14413
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14414
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14415
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14416
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14417
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14418
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14419
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14420
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14421
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14422
    }/*function_time_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14423
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14424
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14425
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14426
 *TIME_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14427
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14428
    case function_time_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14429
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14430
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14431
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14432
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14433
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14434
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14435
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14436
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14437
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14438
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14439
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14440
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14441
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14442
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14443
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14444
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14445
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14446
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14447
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14448
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14449
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14450
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14451
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14452
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14453
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14454
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14455
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14456
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14457
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14458
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14459
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14460
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14461
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14462
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14463
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14464
    }/*function_time_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14465
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14466
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14467
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14468
 *TIME_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14469
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14470
    case function_time_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14471
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14472
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14473
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14474
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14475
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14476
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14477
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14478
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14479
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14480
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14481
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14482
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14483
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14484
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14485
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14486
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14487
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14488
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14489
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14490
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14491
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14492
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14493
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14494
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14495
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14496
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14497
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14498
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14499
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14500
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14501
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14502
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14503
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14504
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14505
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14506
    }/*function_time_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14507
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14508
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14509
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14510
 *TIME_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14511
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14512
    case function_time_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14513
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14514
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14515
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14516
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14517
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14518
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14519
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14520
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14521
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14522
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14523
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14524
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14525
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14526
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14527
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14528
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14529
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14530
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14531
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14532
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14533
                function_name = (symbol_c*)(new pragma_c("__time_to_real"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14534
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14535
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14536
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14537
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14538
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14539
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14540
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14541
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14542
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14543
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14544
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14545
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14546
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14547
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14548
    }/*function_time_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14549
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14550
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14551
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14552
 *TIME_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14553
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14554
    case function_time_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14555
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14556
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14557
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14558
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14559
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14560
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14561
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14562
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14563
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14564
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14565
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14566
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14567
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14568
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14569
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14570
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14571
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14572
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14573
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14574
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14575
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14576
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14577
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14578
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14579
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14580
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14581
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14582
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14583
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14584
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14585
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14586
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14587
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14588
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14589
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14590
    }/*function_time_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14591
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14592
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14593
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14594
 *TIME_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14595
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14596
    case function_time_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14597
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14598
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14599
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14600
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14601
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14602
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14603
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14604
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14605
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14606
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14607
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14608
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14609
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14610
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14611
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14612
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14613
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14614
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14615
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14616
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14617
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14618
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14619
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14620
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14621
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14622
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14623
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14624
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14625
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14626
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14627
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14628
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14629
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14630
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14631
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14632
    }/*function_time_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14633
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14634
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14635
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14636
 *TIME_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14637
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14638
    case function_time_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14639
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14640
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14641
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14642
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14643
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14644
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14645
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14646
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14647
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14648
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14649
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14650
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14651
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14652
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14653
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14654
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14655
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14656
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14657
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14658
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14659
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14660
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14661
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14662
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14663
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14664
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14665
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14666
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14667
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14668
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14669
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14670
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14671
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14672
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14673
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14674
    }/*function_time_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14675
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14676
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14677
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14678
 *TIME_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14679
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14680
    case function_time_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14681
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14682
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14683
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14684
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14685
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14686
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14687
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14688
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14689
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14690
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14691
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14692
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14693
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14694
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14695
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14696
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14697
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14698
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14699
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14700
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14701
                function_name = (symbol_c*)(new pragma_c("__time_to_int"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14702
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14703
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14704
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14705
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14706
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14707
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14708
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14709
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14710
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14711
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14712
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14713
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14714
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14715
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14716
    }/*function_time_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14717
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14718
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14719
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14720
 *INT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14721
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14722
    case function_int_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14723
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14724
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14725
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14726
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14727
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14728
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14729
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14730
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14731
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14732
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14733
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14734
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14735
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14736
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14737
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14738
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14739
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14740
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14741
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14742
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14743
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14744
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14745
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14746
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14747
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14748
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14749
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14750
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14751
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14752
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14753
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14754
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14755
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14756
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14757
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14758
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14759
    }/*function_int_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14760
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14761
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14762
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14763
 *INT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14764
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14765
    case function_int_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14766
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14767
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14768
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14769
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14770
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14771
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14772
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14773
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14774
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14775
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14776
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14777
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14778
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14779
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14780
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14781
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14782
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14783
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14784
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14785
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14786
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14787
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14788
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14789
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14790
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14791
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14792
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14793
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14794
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14795
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14796
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14797
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14798
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14799
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14800
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14801
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14802
    }/*function_int_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14803
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14804
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14805
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14806
 *INT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14807
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14808
    case function_int_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14809
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14810
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14811
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14812
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14813
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14814
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14815
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14816
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14817
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14818
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14819
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14820
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14821
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14822
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14823
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14824
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14825
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14826
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14827
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14828
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14829
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14830
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14831
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14832
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14833
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 14834
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14835
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14836
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14837
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14838
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14839
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14840
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14841
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14842
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14843
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14844
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14845
    }/*function_int_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14846
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14847
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14848
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14849
 *INT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14850
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14851
    case function_int_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14852
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14853
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14854
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14855
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14856
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14857
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14858
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14859
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14860
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14861
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14862
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14863
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14864
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14865
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14866
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14867
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14868
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14869
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14870
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14871
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14872
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14873
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14874
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14875
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14876
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14877
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14878
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14879
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14880
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14881
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14882
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14883
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14884
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14885
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14886
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14887
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14888
    }/*function_int_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14889
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14890
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14891
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14892
 *INT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14893
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14894
    case function_int_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14895
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14896
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14897
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14898
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14899
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14900
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14901
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14902
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14903
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14904
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14905
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14906
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14907
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14908
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14909
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14910
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14911
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14912
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14913
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14914
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14915
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14916
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14917
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14918
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14919
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14920
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14921
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14922
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14923
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14924
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14925
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14926
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14927
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14928
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14929
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14930
    }/*function_int_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14931
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14932
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14933
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14934
 *INT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14935
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14936
    case function_int_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14937
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14938
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14939
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14940
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14941
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14942
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14943
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14944
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14945
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14946
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14947
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14948
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14949
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14950
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14951
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14952
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14953
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14954
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14955
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14956
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14957
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14958
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14959
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14960
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14961
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14962
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14963
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 14964
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14965
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14966
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14967
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14968
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14969
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14970
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14971
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14972
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14973
    }/*function_int_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14974
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14975
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14976
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14977
 *INT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14978
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14979
    case function_int_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14980
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14981
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14982
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14983
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14984
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14985
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14986
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14987
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14988
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14989
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14990
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14991
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14992
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14993
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14994
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14995
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14996
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 14997
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14998
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 14999
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15000
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15001
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15002
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15003
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15004
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15005
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15006
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15007
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15008
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15009
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15010
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15011
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15012
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15013
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15014
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15015
    }/*function_int_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15016
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15017
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15018
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15019
 *INT_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15020
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15021
    case function_int_to_tod :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15022
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15023
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15024
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15025
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15026
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15027
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15028
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15029
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15030
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15031
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15032
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15033
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15034
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15035
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15036
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15037
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15038
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15039
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15040
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15041
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15042
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15043
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15044
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15045
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15046
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15047
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15048
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15049
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15050
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15051
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15052
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15053
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15054
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15055
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15056
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15057
    }/*function_int_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15058
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15059
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15060
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15061
 *INT_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15062
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15063
    case function_int_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15064
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15065
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15066
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15067
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15068
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15069
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15070
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15071
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15072
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15073
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15074
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15075
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15076
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15077
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15078
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15079
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15080
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15081
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15082
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15083
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15084
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15085
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15086
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15087
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15088
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15089
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15090
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15091
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15092
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15093
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15094
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15095
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15096
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15097
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15098
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15099
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15100
    }/*function_int_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15101
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15102
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15103
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15104
 *INT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15105
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15106
    case function_int_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15107
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15108
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15109
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15110
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15111
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15112
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15113
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15114
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15115
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15116
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15117
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15118
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15119
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15120
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15121
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15122
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15123
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15124
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15125
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15126
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15127
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15128
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15129
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15130
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15131
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15132
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15133
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15134
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15135
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15136
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15137
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15138
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15139
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15140
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15141
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15142
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15143
    }/*function_int_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15144
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15145
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15146
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15147
 *INT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15148
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15149
    case function_int_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15150
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15151
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15152
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15153
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15154
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15155
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15156
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15157
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15158
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15159
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15160
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15161
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15162
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15163
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15164
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15165
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15166
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15167
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15168
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15169
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15170
                function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15171
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15172
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15173
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15174
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15175
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15176
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15177
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15178
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15179
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15180
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15181
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15182
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15183
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15184
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15185
    }/*function_int_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15186
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15187
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15188
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15189
 *INT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15190
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15191
    case function_int_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15192
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15193
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15194
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15195
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15196
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15197
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15198
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15199
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15200
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15201
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15202
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15203
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15204
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15205
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15206
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15207
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15208
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15209
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15210
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15211
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15212
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15213
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15214
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15215
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15216
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15217
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15218
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15219
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15220
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15221
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15222
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15223
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15224
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15225
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15226
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15227
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15228
    }/*function_int_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15229
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15230
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15231
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15232
 *INT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15233
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15234
    case function_int_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15235
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15236
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15237
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15238
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15239
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15240
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15241
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15242
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15243
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15244
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15245
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15246
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15247
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15248
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15249
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15250
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15251
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15252
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15253
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15254
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15255
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15256
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15257
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15258
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15259
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15260
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15261
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15262
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15263
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15264
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15265
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15266
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15267
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15268
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15269
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15270
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15271
    }/*function_int_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15272
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15273
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15274
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15275
 *INT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15276
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15277
    case function_int_to_lreal :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15278
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15279
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15280
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15281
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15282
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15283
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15284
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15285
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15286
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15287
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15288
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15289
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15290
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15291
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15292
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15293
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15294
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15295
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15296
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15297
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15298
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15299
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15300
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15301
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15302
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15303
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15304
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15305
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15306
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15307
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15308
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15309
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15310
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15311
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15312
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15313
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15314
    }/*function_int_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15315
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15316
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15317
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15318
 *INT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15319
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15320
    case function_int_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15321
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15322
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15323
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15324
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15325
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15326
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15327
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15328
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15329
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15330
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15331
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15332
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15333
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15334
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15335
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15336
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15337
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15338
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15339
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15340
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15341
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15342
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15343
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15344
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15345
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15346
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15347
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15348
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15349
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15350
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15351
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15352
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15353
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15354
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15355
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15356
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15357
    }/*function_int_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15358
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15359
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15360
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15361
 *INT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15362
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15363
    case function_int_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15364
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15365
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15366
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15367
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15368
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15369
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15370
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15371
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15372
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15373
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15374
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15375
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15376
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15377
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15378
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15379
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15380
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15381
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15382
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15383
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15384
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15385
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15386
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15387
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15388
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 15389
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15390
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15391
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15392
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15393
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15394
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15395
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15396
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15397
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15398
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15399
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15400
    }/*function_int_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15401
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15402
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15403
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15404
 *INT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15405
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15406
    case function_int_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15407
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15408
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15409
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15410
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15411
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15412
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15413
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15414
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15415
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15416
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15417
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15418
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15419
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15420
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15421
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15422
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15423
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15424
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15425
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15426
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15427
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15428
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15429
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15430
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15431
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15432
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15433
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15434
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15435
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15436
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15437
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15438
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15439
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15440
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15441
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15442
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15443
    }/*function_int_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15444
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15445
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15446
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15447
 *INT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15448
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15449
    case function_int_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15450
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15451
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15452
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15453
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15454
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15455
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15456
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15457
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15458
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15459
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15460
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15461
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15462
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15463
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15464
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15465
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15466
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15467
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15468
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15469
        
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15470
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15471
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15472
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15473
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15474
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15475
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15476
                function_type_prefix = return_type_symbol;
199
b075f28ec081 Bug with type conversion EN/ENO not evaluated fixed
laurent
parents: 169
diff changeset
 15477
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15478
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15479
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15480
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15481
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15482
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15483
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15484
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15485
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15486
    }/*function_int_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15487
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15488
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15489
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15490
 *INT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15491
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15492
    case function_int_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15493
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15494
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15495
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15496
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15497
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15498
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15499
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15500
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15501
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15502
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15503
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15504
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15505
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15506
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15507
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15508
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15509
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15510
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::int_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15511
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15512
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15513
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15514
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15515
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15516
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15517
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15518
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15519
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15520
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15521
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15522
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15523
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15524
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15525
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15526
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15527
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15528
    }/*function_int_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15529
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15530
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15531
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15532
 *TRUNC
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15533
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15534
    case function_trunc :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15535
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15536
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15537
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15538
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15539
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15540
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15541
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15542
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15543
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15544
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15545
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15546
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15547
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15548
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15549
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15550
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15551
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15552
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15553
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15554
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15555
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15556
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15557
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15558
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15559
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15560
                function_type_prefix = (symbol_c*)(new pragma_c("int"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15561
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15562
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15563
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15564
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15565
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15566
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15567
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15568
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15569
    }/*function_trunc*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15570
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15571
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15572
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15573
 *BCD_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15574
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15575
    case function_bcd_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15576
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15577
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15578
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15579
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15580
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15581
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15582
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15583
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15584
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15585
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15586
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15587
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15588
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15589
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15590
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15591
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15592
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15593
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15594
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15595
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15596
                function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15597
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15598
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15599
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15600
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15601
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15602
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15603
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15604
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15605
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15606
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15607
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15608
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15609
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15610
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15611
    }/*function_bcd_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15612
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15613
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15614
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15615
 *BCD_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15616
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15617
    case function_bcd_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15618
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15619
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15620
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15621
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15622
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15623
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15624
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15625
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15626
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15627
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15628
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15629
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15630
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15631
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15632
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15633
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15634
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15635
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::word_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15636
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15637
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15638
                function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15639
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15640
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15641
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15642
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 15643
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15644
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15645
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15646
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15647
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15648
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15649
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15650
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15651
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15652
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15653
    }/*function_bcd_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15654
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15655
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15656
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15657
 *BCD_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15658
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15659
    case function_bcd_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15660
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15661
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15662
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15663
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15664
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15665
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15666
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15667
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15668
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15669
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15670
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15671
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15672
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15673
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15674
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15675
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15676
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15677
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lword_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15678
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15679
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15680
                function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15681
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15682
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15683
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15684
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 15685
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15686
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15687
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15688
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15689
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15690
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15691
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15692
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15693
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15694
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15695
    }/*function_bcd_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15696
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15697
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15698
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15699
 *BCD_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15700
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15701
    case function_bcd_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15702
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15703
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15704
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15705
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15706
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15707
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15708
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15709
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15710
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15711
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15712
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15713
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15714
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15715
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15716
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15717
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15718
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15719
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::byte_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15720
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15721
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15722
                function_name = (symbol_c*)(new pragma_c("__bcd_to_uint"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15723
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15724
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15725
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15726
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15727
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15728
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15729
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15730
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15731
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15732
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15733
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15734
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15735
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15736
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15737
    }/*function_bcd_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15738
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15739
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15740
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15741
 *UDINT_TO_BCD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15742
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15743
    case function_udint_to_bcd :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15744
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15745
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15746
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15747
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15748
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15749
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15750
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15751
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15752
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15753
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15754
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15755
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15756
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15757
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15758
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15759
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15760
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15761
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::udint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15762
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15763
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15764
                function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15765
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15766
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15767
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15768
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15769
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15770
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15771
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15772
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15773
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15774
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15775
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15776
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15777
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15778
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15779
    }/*function_udint_to_bcd*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15780
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15781
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15782
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15783
 *UINT_TO_BCD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15784
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15785
    case function_uint_to_bcd :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15786
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15787
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15788
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15789
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15790
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15791
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15792
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15793
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15794
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15795
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15796
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15797
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15798
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15799
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15800
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15801
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15802
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15803
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::uint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15804
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15805
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15806
                function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15807
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15808
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15809
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15810
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15811
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15812
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15813
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15814
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15815
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15816
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15817
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15818
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15819
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15820
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15821
    }/*function_uint_to_bcd*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15822
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15823
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15824
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15825
 *USINT_TO_BCD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15826
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15827
    case function_usint_to_bcd :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15828
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15829
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15830
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15831
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15832
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15833
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15834
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15835
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15836
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15837
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15838
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15839
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15840
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15841
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15842
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15843
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15844
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15845
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::usint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15846
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15847
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15848
                function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15849
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15850
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15851
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15852
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15853
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15854
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15855
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15856
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15857
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15858
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15859
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15860
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15861
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15862
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15863
    }/*function_usint_to_bcd*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15864
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15865
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15866
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15867
 *ULINT_TO_BCD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15868
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15869
    case function_ulint_to_bcd :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15870
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15871
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15872
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15873
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15874
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15875
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15876
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15877
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15878
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15879
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15880
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15881
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15882
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15883
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15884
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15885
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15886
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15887
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::ulint_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15888
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15889
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15890
                function_name = (symbol_c*)(new pragma_c("__uint_to_bcd"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15891
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15892
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15893
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15894
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15895
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15896
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15897
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15898
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15899
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15900
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15901
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15902
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15903
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15904
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15905
    }/*function_ulint_to_bcd*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15906
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15907
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15908
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15909
 *DATE_AND_TIME_TO_TIME_OF_DAY
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15910
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15911
    case function_date_and_time_to_time_of_day :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15912
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15913
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15914
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15915
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15916
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15917
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15918
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15919
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15920
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15921
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15922
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15923
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15924
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15925
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15926
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15927
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15928
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15929
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15930
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15931
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15932
                function_name = (symbol_c*)(new pragma_c("__date_and_time_to_time_of_day"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15933
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15934
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15935
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15936
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15937
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15938
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15939
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15940
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15941
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15942
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15943
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15944
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15945
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15946
    }/*function_date_and_time_to_time_of_day*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15947
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15948
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15949
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15950
 *DATE_AND_TIME_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15951
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15952
    case function_date_and_time_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15953
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15954
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15955
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15956
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15957
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15958
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15959
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15960
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15961
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15962
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15963
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15964
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15965
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15966
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15967
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15968
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15969
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15970
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15971
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15972
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15973
                function_name = (symbol_c*)(new pragma_c("__date_and_time_to_date"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15974
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15975
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 15976
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15977
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 15978
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15979
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15980
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15981
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15982
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15983
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15984
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15985
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15986
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15987
    }/*function_date_and_time_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15988
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15989
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15990
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15991
 *ABS
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15992
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15993
    case function_abs :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15994
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15995
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15996
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15997
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15998
            identifier_c param_name("IN");
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 15999
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16000
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16001
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16002
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16003
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16004
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16005
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16006
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16007
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16008
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16009
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16010
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16011
            if(IN_type_symbol == NULL || search_expression_type->is_num_type(IN_type_symbol))
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16012
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16013
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16014
                function_name = (symbol_c*)(new pragma_c("__abs_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16015
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16016
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16017
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16018
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16019
                symbol_c * return_type_symbol = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16020
                function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16021
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16022
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16023
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16024
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16025
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16026
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16027
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16028
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16029
    }/*function_abs*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16030
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16031
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16032
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16033
 *SQRT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16034
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16035
    case function_sqrt :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16036
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16037
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16038
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16039
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16040
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16041
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16042
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16043
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16044
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16045
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16046
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16047
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16048
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16049
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16050
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16051
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16052
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16053
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16054
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16055
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16056
                function_name = (symbol_c*)(new pragma_c("__sqrt_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16057
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16058
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16059
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16060
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16061
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16062
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16063
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16064
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16065
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16066
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16067
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16068
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16069
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16070
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16071
    }/*function_sqrt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16072
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16073
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16074
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16075
 *LN
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16076
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16077
    case function_ln :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16078
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16079
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16080
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16081
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16082
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16083
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16084
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16085
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16086
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16087
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16088
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16089
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16090
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16091
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16092
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16093
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16094
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16095
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16096
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16097
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16098
                function_name = (symbol_c*)(new pragma_c("__ln_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16099
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16100
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16101
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16102
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16103
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16104
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16105
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16106
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16107
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16108
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16109
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16110
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16111
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16112
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16113
    }/*function_ln*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16114
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16115
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16116
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16117
 *LOG
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16118
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16119
    case function_log :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16120
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16121
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16122
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16123
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16124
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16125
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16126
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16127
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16128
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16129
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16130
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16131
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16132
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16133
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16134
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16135
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16136
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16137
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16138
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16139
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16140
                function_name = (symbol_c*)(new pragma_c("__log_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16141
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16142
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16143
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16144
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16145
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16146
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16147
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16148
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16149
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16150
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16151
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16152
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16153
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16154
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16155
    }/*function_log*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16156
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16157
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16158
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16159
 *EXP
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16160
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16161
    case function_exp :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16162
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16163
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16164
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16165
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16166
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16167
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16168
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16169
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16170
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16171
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16172
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16173
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16174
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16175
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16176
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16177
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16178
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16179
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16180
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16181
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16182
                function_name = (symbol_c*)(new pragma_c("__exp_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16183
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16184
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16185
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16186
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16187
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16188
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16189
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16190
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16191
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16192
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16193
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16194
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16195
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16196
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16197
    }/*function_exp*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16198
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16199
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16200
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16201
 *SIN
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16202
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16203
    case function_sin :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16204
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16205
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16206
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16207
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16208
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16209
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16210
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16211
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16212
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16213
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16214
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16215
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16216
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16217
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16218
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16219
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16220
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16221
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16222
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16223
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16224
                function_name = (symbol_c*)(new pragma_c("__sin_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16225
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16226
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16227
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16228
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16229
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16230
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16231
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16232
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16233
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16234
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16235
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16236
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16237
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16238
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16239
    }/*function_sin*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16240
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16241
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16242
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16243
 *COS
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16244
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16245
    case function_cos :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16246
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16247
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16248
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16249
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16250
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16251
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16252
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16253
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16254
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16255
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16256
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16257
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16258
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16259
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16260
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16261
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16262
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16263
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16264
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16265
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16266
                function_name = (symbol_c*)(new pragma_c("__cos_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16267
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16268
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16269
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16270
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16271
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16272
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16273
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16274
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16275
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16276
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16277
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16278
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16279
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16280
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16281
    }/*function_cos*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16282
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16283
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16284
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16285
 *TAN
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16286
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16287
    case function_tan :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16288
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16289
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16290
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16291
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16292
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16293
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16294
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16295
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16296
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16297
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16298
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16299
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16300
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16301
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16302
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16303
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16304
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16305
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16306
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16307
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16308
                function_name = (symbol_c*)(new pragma_c("__tan_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16309
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16310
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16311
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16312
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16313
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16314
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16315
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16316
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16317
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16318
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16319
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16320
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16321
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16322
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16323
    }/*function_tan*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16324
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16325
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16326
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16327
 *ASIN
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16328
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16329
    case function_asin :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16330
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16331
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16332
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16333
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16334
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16335
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16336
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16337
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16338
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16339
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16340
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16341
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16342
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16343
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16344
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16345
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16346
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16347
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16348
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16349
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16350
                function_name = (symbol_c*)(new pragma_c("__asin_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16351
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16352
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16353
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16354
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16355
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16356
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16357
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16358
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16359
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16360
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16361
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16362
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16363
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16364
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16365
    }/*function_asin*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16366
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16367
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16368
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16369
 *ACOS
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16370
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16371
    case function_acos :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16372
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16373
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16374
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16375
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16376
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16377
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16378
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16379
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16380
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16381
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16382
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16383
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16384
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16385
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16386
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16387
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16388
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16389
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16390
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16391
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16392
                function_name = (symbol_c*)(new pragma_c("__acos_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16393
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16394
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16395
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16396
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16397
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16398
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16399
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16400
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16401
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16402
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16403
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16404
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16405
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16406
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16407
    }/*function_acos*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16408
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16409
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16410
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16411
 *ATAN
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16412
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16413
    case function_atan :
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16414
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16415
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16416
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16417
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16418
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16419
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16420
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16421
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16422
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16423
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16424
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16425
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16426
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16427
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16428
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16429
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16430
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16431
            if(IN_type_symbol == NULL || search_expression_type->is_real_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16432
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16433
        
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16434
                function_name = (symbol_c*)(new pragma_c("__atan_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16435
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16436
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16437
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16438
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16439
                symbol_c * return_type_symbol = IN_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 16440
                function_type_suffix = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16441
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16442
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16443
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16444
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16445
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16446
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16447
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16448
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16449
    }/*function_atan*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16450
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16451
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16452
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16453
 *ADD
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16454
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16455
    case function_add :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16456
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16457
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16458
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16459
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16460
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16461
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16462
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16463
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16464
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16465
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16466
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16467
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16468
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16469
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16470
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16471
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16472
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16473
            if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16474
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16475
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16476
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16477
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16478
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16479
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16480
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16481
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16482
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16483
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16484
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16485
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16486
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16487
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16488
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16489
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16490
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16491
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16492
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16493
                        function_name = (symbol_c*)(new pragma_c("__add_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16494
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16495
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16496
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 16497
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16498
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 16499
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16500
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16501
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16502
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16503
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16504
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16505
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16506
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16507
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16508
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16509
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16510
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16511
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16512
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16513
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16514
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16515
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16516
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16517
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16518
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16519
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16520
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16521
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16522
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16523
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16524
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16525
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16526
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16527
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16528
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16529
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16530
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16531
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16532
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16533
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16534
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16535
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16536
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16537
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16538
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16539
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16540
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16541
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16542
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16543
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16544
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16545
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16546
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16547
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16548
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16549
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16550
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16551
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16552
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16553
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16554
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16555
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16556
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16557
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16558
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16559
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16560
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16561
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16562
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16563
                        function_name = (symbol_c*)(new pragma_c("__time_add"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16564
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16565
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16566
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16567
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16568
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16569
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16570
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16571
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16572
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16573
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16574
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16575
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16576
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16577
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16578
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16579
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16580
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16581
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16582
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16583
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16584
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16585
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16586
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16587
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16588
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16589
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16590
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16591
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16592
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16593
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16594
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16595
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16596
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16597
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16598
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16599
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16600
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16601
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16602
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16603
                        function_name = (symbol_c*)(new pragma_c("__time_add"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16604
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16605
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16606
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16607
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16608
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16609
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16610
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16611
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16612
                        symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16613
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16614
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16615
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16616
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16617
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16618
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16619
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16620
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16621
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16622
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16623
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16624
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16625
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16626
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16627
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16628
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16629
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16630
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16631
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16632
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16633
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16634
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16635
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16636
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16637
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16638
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16639
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16640
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16641
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16642
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16643
                        function_name = (symbol_c*)(new pragma_c("__time_add"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16644
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16645
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16646
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16647
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16648
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16649
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16650
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16651
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16652
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16653
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16654
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16655
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16656
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16657
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16658
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16659
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16660
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16661
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16662
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16663
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16664
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16665
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16666
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16667
    }/*function_add*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16668
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16669
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16670
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16671
 *MUL
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16672
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16673
    case function_mul :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16674
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16675
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16676
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16677
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16678
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16679
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16680
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16681
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16682
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16683
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16684
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16685
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16686
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16687
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16688
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16689
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16690
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16691
            if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16692
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16693
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16694
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16695
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16696
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16697
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16698
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16699
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16700
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16701
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16702
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16703
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16704
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16705
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16706
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16707
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16708
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16709
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16710
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16711
                        function_name = (symbol_c*)(new pragma_c("__mul_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16712
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16713
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16714
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 16715
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16716
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 16717
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16718
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16719
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16720
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16721
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16722
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16723
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16724
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16725
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16726
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16727
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16728
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16729
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16730
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16731
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16732
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16733
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16734
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16735
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16736
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16737
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16738
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16739
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16740
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16741
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16742
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16743
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16744
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16745
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16746
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16747
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16748
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16749
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16750
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16751
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16752
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16753
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16754
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16755
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16756
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16757
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16758
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16759
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16760
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16761
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16762
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16763
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16764
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16765
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16766
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16767
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16768
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16769
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16770
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16771
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16772
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16773
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16774
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16775
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16776
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16777
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16778
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16779
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16780
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16781
                        function_name = (symbol_c*)(new pragma_c("__time_mul"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16782
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16783
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16784
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16785
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16786
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16787
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16788
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16789
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16790
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16791
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16792
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16793
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16794
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16795
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16796
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16797
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16798
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16799
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16800
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16801
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16802
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16803
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16804
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16805
    }/*function_mul*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16806
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16807
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16808
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16809
 *SUB
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16810
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16811
    case function_sub :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16812
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16813
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16814
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16815
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16816
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16817
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16818
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16819
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16820
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16821
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16822
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16823
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16824
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16825
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16826
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16827
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16828
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16829
            if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16830
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16831
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16832
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16833
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16834
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16835
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16836
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16837
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16838
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16839
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16840
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16841
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16842
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16843
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16844
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16845
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16846
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16847
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16848
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16849
                        function_name = (symbol_c*)(new pragma_c("__sub_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16850
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16851
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16852
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16853
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16854
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16855
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16856
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16857
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16858
                        symbol_c * return_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16859
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16860
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16861
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16862
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16863
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16864
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16865
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16866
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16867
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16868
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16869
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16870
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16871
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16872
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16873
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16874
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16875
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16876
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16877
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16878
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16879
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16880
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16881
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16882
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16883
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16884
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16885
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16886
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16887
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16888
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16889
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16890
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16891
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16892
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16893
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16894
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16895
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16896
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16897
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16898
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16899
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16900
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16901
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16902
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16903
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16904
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16905
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16906
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16907
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16908
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16909
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16910
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16911
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16912
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16913
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16914
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16915
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16916
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16917
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16918
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16919
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16920
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16921
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16922
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16923
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16924
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16925
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16926
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16927
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::dt_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16928
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16929
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16930
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16931
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16932
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16933
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16934
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16935
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16936
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16937
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16938
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16939
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16940
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16941
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16942
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16943
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16944
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16945
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16946
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16947
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16948
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16949
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16950
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16951
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16952
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16953
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16954
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16955
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16956
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16957
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16958
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16959
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16960
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16961
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16962
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16963
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16964
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16965
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16966
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16967
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16968
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16969
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16970
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16971
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16972
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16973
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16974
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16975
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16976
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16977
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16978
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16979
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16980
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16981
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16982
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16983
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16984
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16985
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16986
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16987
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16988
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16989
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16990
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16991
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16992
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16993
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 16994
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16995
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16996
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 16997
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16998
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 16999
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17000
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17001
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17002
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17003
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17004
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17005
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17006
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17007
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17008
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17009
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17010
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17011
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17012
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17013
                        symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17014
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17015
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17016
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17017
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17018
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17019
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17020
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17021
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17022
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17023
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17024
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17025
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17026
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17027
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17028
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17029
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17030
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17031
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17032
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17033
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17034
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17035
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17036
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17037
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17038
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17039
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17040
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17041
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17042
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17043
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17044
                        function_name = (symbol_c*)(new pragma_c("__time_sub"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17045
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17046
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17047
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17048
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17049
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17050
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17051
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17052
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17053
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17054
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17055
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17056
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17057
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17058
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17059
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17060
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17061
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17062
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17063
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17064
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17065
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17066
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17067
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17068
    }/*function_sub*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17069
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17070
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17071
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17072
 *DIV
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17073
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17074
    case function_div :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17075
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17076
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17077
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17078
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17079
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17080
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17081
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17082
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17083
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17084
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17085
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17086
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17087
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17088
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17089
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17090
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17091
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17092
            if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17093
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17094
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17095
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17096
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17097
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17098
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17099
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17100
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17101
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17102
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17103
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17104
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17105
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17106
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17107
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17108
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17109
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17110
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17111
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17112
                        function_name = (symbol_c*)(new pragma_c("__div_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17113
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17114
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17115
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17116
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17117
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17118
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17119
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17120
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17121
                        symbol_c * return_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17122
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17123
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17124
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17125
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17126
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17127
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17128
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17129
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17130
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17131
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17132
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17133
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::time_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17134
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17135
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17136
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17137
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17138
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17139
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17140
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17141
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17142
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17143
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17144
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17145
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17146
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17147
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17148
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17149
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17150
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17151
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17152
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17153
                        function_name = (symbol_c*)(new pragma_c("__time_div"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17154
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17155
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17156
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17157
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17158
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17159
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17160
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17161
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17162
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17163
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17164
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17165
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17166
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17167
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17168
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17169
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17170
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17171
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17172
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17173
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17174
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17175
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17176
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17177
    }/*function_div*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17178
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17179
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17180
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17181
 *MOD
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17182
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17183
    case function_mod :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17184
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17185
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17186
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17187
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17188
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17189
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17190
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17191
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17192
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17193
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17194
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17195
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17196
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17197
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17198
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17199
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17200
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17201
            if(IN1_type_symbol == NULL || search_expression_type->is_num_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17202
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17203
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17204
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17205
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17206
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17207
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17208
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17209
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17210
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17211
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17212
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17213
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17214
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17215
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17216
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17217
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17218
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17219
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17220
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17221
                        function_name = (symbol_c*)(new pragma_c("__mod_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17222
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17223
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17224
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17225
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17226
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17227
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17228
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17229
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17230
                        symbol_c * return_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17231
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17232
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17233
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17234
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17235
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17236
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17237
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17238
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17239
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17240
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17241
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17242
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17243
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17244
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17245
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17246
    }/*function_mod*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17247
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17248
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17249
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17250
 *EXPT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17251
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17252
    case function_expt :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17253
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17254
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17255
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17256
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17257
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17258
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17259
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17260
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17261
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17262
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17263
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17264
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17265
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17266
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17267
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17268
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17269
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17270
            if(IN1_type_symbol == NULL || search_expression_type->is_real_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17271
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17272
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17273
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17274
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17275
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17276
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17277
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17278
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17279
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17280
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17281
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17282
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17283
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17284
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17285
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17286
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17287
                    if(IN2_type_symbol == NULL || search_expression_type->is_num_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17288
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17289
                
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 17290
                        function_name = (symbol_c*)(new pragma_c("__expt_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17291
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17292
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17293
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17294
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17295
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17296
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17297
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17298
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17299
                        symbol_c * return_type_symbol = last_type_symbol;
165
83963465b773 Bug on standard function not defined with EN/ENO fixed
lbessard
parents: 154
diff changeset
 17300
                        function_type_suffix = IN1_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17301
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17302
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17303
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17304
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17305
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17306
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17307
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17308
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17309
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17310
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17311
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17312
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17313
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17314
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17315
    }/*function_expt*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17316
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17317
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17318
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17319
 *MOVE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17320
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17321
    case function_move :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17322
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17323
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17324
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17325
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17326
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17327
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17328
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17329
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17330
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17331
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17332
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17333
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17334
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17335
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17336
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17337
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17338
            
153
6aed920024f9 Modifying MOVE interface
greg
parents: 149
diff changeset
 17339
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17340
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17341
        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17342
                function_name = (symbol_c*)(new pragma_c("__move_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17343
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17344
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17345
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17346
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17347
                symbol_c * return_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17348
                function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17349
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17350
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17351
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17352
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17353
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17354
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17355
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17356
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17357
    }/*function_move*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17358
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17359
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17360
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17361
 *SHL
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17362
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17363
    case function_shl :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17364
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17365
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17366
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17367
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17368
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17369
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17370
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17371
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17372
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17373
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17374
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17375
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17376
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17377
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17378
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17379
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17380
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17381
            if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17382
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17383
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17384
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17385
                    identifier_c param_name("N");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17386
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17387
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17388
                    symbol_c *N_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17389
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17390
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17391
                    if (N_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17392
                      N_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17393
                    if (N_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17394
                      N_type_symbol = search_expression_type->get_type(N_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17395
                      last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17396
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17397
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17398
                    if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17399
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17400
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17401
                        function_name = (symbol_c*)(new pragma_c("__shl_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17402
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17403
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17404
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17405
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17406
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17407
                        if (N_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17408
                          N_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17409
                        ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17410
                        symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17411
                        function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17412
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17413
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17414
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17415
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17416
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17417
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17418
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17419
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17420
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17421
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17422
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17423
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17424
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17425
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17426
    }/*function_shl*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17427
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17428
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17429
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17430
 *SHR
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17431
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17432
    case function_shr :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17433
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17434
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17435
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17436
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17437
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17438
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17439
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17440
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17441
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17442
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17443
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17444
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17445
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17446
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17447
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17448
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17449
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17450
            if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17451
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17452
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17453
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17454
                    identifier_c param_name("N");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17455
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17456
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17457
                    symbol_c *N_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17458
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17459
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17460
                    if (N_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17461
                      N_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17462
                    if (N_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17463
                      N_type_symbol = search_expression_type->get_type(N_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17464
                      last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17465
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17466
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17467
                    if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17468
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17469
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17470
                        function_name = (symbol_c*)(new pragma_c("__shr_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17471
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17472
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17473
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17474
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17475
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17476
                        if (N_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17477
                          N_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17478
                        ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17479
                        symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17480
                        function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17481
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17482
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17483
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17484
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17485
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17486
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17487
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17488
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17489
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17490
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17491
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17492
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17493
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17494
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17495
    }/*function_shr*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17496
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17497
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17498
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17499
 *ROR
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17500
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17501
    case function_ror :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17502
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17503
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17504
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17505
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17506
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17507
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17508
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17509
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17510
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17511
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17512
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17513
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17514
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17515
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17516
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17517
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17518
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17519
            if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17520
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17521
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17522
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17523
                    identifier_c param_name("N");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17524
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17525
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17526
                    symbol_c *N_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17527
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17528
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17529
                    if (N_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17530
                      N_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17531
                    if (N_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17532
                      N_type_symbol = search_expression_type->get_type(N_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17533
                      last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17534
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17535
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17536
                    if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17537
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17538
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17539
                        function_name = (symbol_c*)(new pragma_c("__ror_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17540
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17541
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17542
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17543
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17544
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17545
                        if (N_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17546
                          N_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17547
                        ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17548
                        symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17549
                        function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17550
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17551
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17552
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17553
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17554
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17555
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17556
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17557
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17558
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17559
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17560
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17561
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17562
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17563
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17564
    }/*function_ror*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17565
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17566
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17567
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17568
 *ROL
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17569
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17570
    case function_rol :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17571
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17572
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17573
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17574
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17575
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17576
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17577
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17578
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17579
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17580
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17581
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17582
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17583
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17584
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17585
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17586
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17587
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17588
            if(IN_type_symbol == NULL || search_expression_type->is_nbinary_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17589
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17590
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17591
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17592
                    identifier_c param_name("N");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17593
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17594
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17595
                    symbol_c *N_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17596
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17597
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17598
                    if (N_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17599
                      N_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17600
                    if (N_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17601
                      N_type_symbol = search_expression_type->get_type(N_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17602
                      last_type_symbol = last_type_symbol && N_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17603
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17604
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17605
                    if(N_type_symbol == NULL || search_expression_type->is_integer_type(N_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17606
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17607
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17608
                        function_name = (symbol_c*)(new pragma_c("__rol_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17609
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17610
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17611
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17612
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17613
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17614
                        if (N_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17615
                          N_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17616
                        ADD_PARAM_LIST(N_param_value, N_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17617
                        symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17618
                        function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17619
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17620
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17621
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17622
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17623
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17624
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17625
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17626
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17627
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17628
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17629
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17630
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17631
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17632
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17633
    }/*function_rol*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17634
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17635
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17636
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17637
 *AND
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17638
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17639
    case function_and :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17640
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17641
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17642
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17643
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17644
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17645
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17646
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17647
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17648
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17649
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17650
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17651
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17652
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17653
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17654
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17655
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17656
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17657
            if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17658
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17659
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17660
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17661
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17662
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17663
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17664
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17665
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17666
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17667
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17668
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17669
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17670
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17671
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17672
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17673
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17674
                    if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17675
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17676
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17677
                        function_name = (symbol_c*)(new pragma_c("__and_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17678
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17679
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17680
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17681
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17682
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17683
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17684
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17685
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17686
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17687
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17688
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17689
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17690
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17691
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17692
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17693
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17694
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17695
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17696
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17697
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17698
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17699
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17700
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17701
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17702
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17703
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17704
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17705
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17706
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17707
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17708
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17709
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17710
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17711
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17712
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17713
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17714
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17715
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17716
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17717
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17718
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17719
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17720
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17721
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17722
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17723
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17724
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17725
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17726
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17727
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17728
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17729
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17730
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17731
    }/*function_and*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17732
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17733
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17734
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17735
 *OR
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17736
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17737
    case function_or :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17738
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17739
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17740
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17741
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17742
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17743
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17744
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17745
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17746
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17747
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17748
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17749
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17750
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17751
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17752
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17753
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17754
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17755
            if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17756
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17757
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17758
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17759
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17760
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17761
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17762
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17763
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17764
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17765
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17766
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17767
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17768
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17769
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17770
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17771
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17772
                    if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17773
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17774
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17775
                        function_name = (symbol_c*)(new pragma_c("__or_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17776
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17777
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17778
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17779
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17780
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17781
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17782
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17783
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17784
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17785
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17786
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17787
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17788
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17789
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17790
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17791
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17792
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17793
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17794
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17795
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17796
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17797
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17798
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17799
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17800
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17801
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17802
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17803
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17804
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17805
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17806
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17807
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17808
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17809
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17810
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17811
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17812
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17813
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17814
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17815
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17816
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17817
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17818
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17819
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17820
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17821
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17822
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17823
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17824
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17825
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17826
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17827
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17828
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17829
    }/*function_or*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17830
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17831
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17832
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17833
 *XOR
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17834
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17835
    case function_xor :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17836
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17837
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17838
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17839
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17840
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17841
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17842
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17843
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17844
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17845
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17846
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17847
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17848
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17849
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17850
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17851
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17852
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17853
            if(IN1_type_symbol == NULL || search_expression_type->is_binary_type(IN1_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17854
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17855
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17856
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17857
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17858
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17859
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17860
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17861
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17862
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17863
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17864
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17865
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17866
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17867
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17868
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17869
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17870
                    if(IN2_type_symbol == NULL || search_expression_type->is_binary_type(IN2_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17871
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17872
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17873
                        function_name = (symbol_c*)(new pragma_c("__xor_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17874
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17875
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17876
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17877
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17878
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 17879
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17880
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17881
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17882
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17883
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17884
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17885
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17886
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17887
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17888
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17889
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17890
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17891
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17892
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17893
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17894
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17895
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17896
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17897
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17898
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17899
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17900
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17901
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17902
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17903
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17904
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17905
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17906
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17907
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17908
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17909
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17910
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17911
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17912
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17913
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17914
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17915
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17916
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17917
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17918
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17919
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17920
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17921
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17922
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17923
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17924
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17925
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17926
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17927
    }/*function_xor*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17928
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17929
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17930
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17931
 *NOT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17932
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17933
    case function_not :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17934
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17935
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17936
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17937
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17938
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17939
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17940
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17941
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17942
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17943
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17944
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17945
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17946
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17947
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17948
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17949
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17950
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17951
            if(IN_type_symbol == NULL || search_expression_type->is_binary_type(IN_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17952
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17953
        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17954
                function_name = (symbol_c*)(new pragma_c("__not_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17955
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17956
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17957
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17958
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17959
                symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17960
                function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17961
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17962
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17963
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 17964
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17965
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17966
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17967
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17968
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17969
    }/*function_not*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17970
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17971
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17972
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17973
 *SEL
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17974
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17975
    case function_sel :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17976
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17977
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17978
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17979
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17980
            identifier_c param_name("G");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17981
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17982
            symbol_c *G_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17983
            symbol_c *G_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17984
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17985
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17986
            if (G_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17987
              G_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17988
            if (G_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17989
              G_type_symbol = search_expression_type->get_type(G_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17990
              last_type_symbol = last_type_symbol && G_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17991
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17992
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 17993
            if(G_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::bool_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17994
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17995
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17996
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17997
                    identifier_c param_name("IN0");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17998
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 17999
                    symbol_c *IN0_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18000
                    symbol_c *IN0_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18001
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18002
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18003
                    if (IN0_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18004
                      IN0_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18005
                    if (IN0_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18006
                      IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18007
                      last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18008
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18009
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18010
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18011
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18012
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18013
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18014
                            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18015
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18016
                            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18017
                            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18018
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18019
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18020
                            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18021
                              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18022
                            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18023
                              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18024
                              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18025
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18026
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18027
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18028
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18029
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18030
                                function_name = (symbol_c*)(new pragma_c("__sel_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18031
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18032
                                if (G_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18033
                                  G_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18034
                                ADD_PARAM_LIST(G_param_value, G_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18035
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18036
                                if (IN0_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18037
                                  IN0_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18038
                                ADD_PARAM_LIST(IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18039
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18040
                                if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18041
                                  IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18042
                                ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18043
                                symbol_c * return_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18044
                                function_type_suffix = IN0_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18045
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18046
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18047
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18048
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18049
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18050
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18051
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18052
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18053
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18054
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18055
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18056
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18057
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18058
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18059
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18060
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18061
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18062
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18063
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18064
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18065
    }/*function_sel*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18066
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18067
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18068
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18069
 *MAX
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18070
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18071
    case function_max :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18072
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18073
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18074
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18075
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18076
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18077
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18078
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18079
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18080
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18081
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18082
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18083
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18084
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18085
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18086
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18087
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18088
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18089
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18090
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18091
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18092
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18093
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18094
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18095
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18096
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18097
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18098
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18099
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18100
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18101
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18102
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18103
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18104
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18105
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18106
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18107
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18108
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18109
                        function_name = (symbol_c*)(new pragma_c("__max_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18110
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18111
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18112
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18113
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18114
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18115
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18116
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18117
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18118
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18119
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18120
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18121
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18122
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18123
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18124
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18125
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18126
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18127
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18128
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18129
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18130
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18131
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18132
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18133
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18134
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18135
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18136
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18137
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18138
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18139
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18140
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18141
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18142
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18143
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18144
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18145
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18146
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18147
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18148
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18149
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18150
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18151
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18152
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18153
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18154
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18155
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18156
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18157
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18158
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18159
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18160
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18161
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18162
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18163
    }/*function_max*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18164
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18165
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18166
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18167
 *MIN
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18168
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18169
    case function_min :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18170
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18171
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18172
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18173
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18174
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18175
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18176
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18177
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18178
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18179
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18180
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18181
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18182
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18183
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18184
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18185
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18186
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18187
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18188
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18189
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18190
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18191
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18192
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18193
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18194
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18195
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18196
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18197
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18198
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18199
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18200
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18201
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18202
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18203
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18204
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18205
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18206
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18207
                        function_name = (symbol_c*)(new pragma_c("__min_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18208
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18209
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18210
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18211
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18212
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18213
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18214
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18215
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18216
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18217
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18218
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18219
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18220
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18221
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18222
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18223
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18224
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18225
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18226
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18227
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18228
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18229
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18230
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18231
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18232
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18233
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18234
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18235
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18236
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18237
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18238
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18239
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18240
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18241
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18242
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18243
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18244
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18245
                        symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18246
                        function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18247
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18248
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18249
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18250
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18251
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18252
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18253
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18254
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18255
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18256
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18257
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18258
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18259
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18260
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18261
    }/*function_min*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18262
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18263
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18264
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18265
 *LIMIT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18266
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18267
    case function_limit :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18268
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18269
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18270
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18271
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18272
            identifier_c param_name("MN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18273
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18274
            symbol_c *MN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18275
            symbol_c *MN_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18276
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18277
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18278
            if (MN_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18279
              MN_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18280
            if (MN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18281
              MN_type_symbol = search_expression_type->get_type(MN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18282
              last_type_symbol = last_type_symbol && MN_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18283
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18284
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18285
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18286
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18287
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18288
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18289
                    identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18290
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18291
                    symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18292
                    symbol_c *IN_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18293
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18294
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18295
                    if (IN_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18296
                      IN_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18297
                    if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18298
                      IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18299
                      last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18300
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18301
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18302
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18303
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18304
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18305
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18306
                            identifier_c param_name("MX");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18307
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18308
                            symbol_c *MX_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18309
                            symbol_c *MX_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18310
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18311
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18312
                            if (MX_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18313
                              MX_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18314
                            if (MX_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18315
                              MX_type_symbol = search_expression_type->get_type(MX_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18316
                              last_type_symbol = last_type_symbol && MX_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18317
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18318
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18319
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18320
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18321
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18322
                                function_name = (symbol_c*)(new pragma_c("__limit_"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18323
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18324
                                if (MN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18325
                                  MN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18326
                                ADD_PARAM_LIST(MN_param_value, MN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18327
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18328
                                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18329
                                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18330
                                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18331
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18332
                                if (MX_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18333
                                  MX_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18334
                                ADD_PARAM_LIST(MX_param_value, MX_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18335
                                symbol_c * return_type_symbol = IN_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18336
                                function_type_suffix = IN_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18337
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18338
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18339
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18340
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18341
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18342
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18343
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18344
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18345
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18346
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18347
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18348
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18349
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18350
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18351
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18352
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18353
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18354
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18355
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18356
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18357
    }/*function_limit*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18358
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18359
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18360
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18361
 *MUX
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18362
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18363
    case function_mux :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18364
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18365
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18366
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18367
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18368
            identifier_c param_name("K");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18369
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18370
            symbol_c *K_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18371
            symbol_c *K_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18372
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18373
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18374
            if (K_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18375
              K_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18376
            if (K_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18377
              K_type_symbol = search_expression_type->get_type(K_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18378
              last_type_symbol = last_type_symbol && K_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18379
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18380
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18381
            if(K_type_symbol == NULL || search_expression_type->is_integer_type(K_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18382
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18383
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18384
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18385
                    identifier_c param_name("IN0");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18386
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18387
                    symbol_c *IN0_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18388
                    symbol_c *IN0_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18389
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18390
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18391
                    if (IN0_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18392
                      IN0_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18393
                    if (IN0_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18394
                      IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18395
                      last_type_symbol = last_type_symbol && IN0_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18396
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18397
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18398
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18399
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18400
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18401
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18402
                            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18403
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18404
                            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18405
                            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18406
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18407
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18408
                            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18409
                              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18410
                            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18411
                              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18412
                              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18413
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18414
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18415
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18416
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18417
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18418
                                function_name = (symbol_c*)(new pragma_c("__mux_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18419
                                
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18420
                                if (nb_param < 3)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18421
                                  nb_param = 3;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18422
                                char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18423
                                sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18424
                                ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18425
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18426
                                if (K_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18427
                                  K_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18428
                                ADD_PARAM_LIST(K_param_value, K_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18429
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18430
                                if (IN0_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18431
                                  IN0_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18432
                                ADD_PARAM_LIST(IN0_param_value, IN0_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18433
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18434
                                if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18435
                                  IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18436
                                ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18437
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18438
                                int base_num = 2;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18439
                                symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18440
                                do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18441
                                    char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18442
                                    sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18443
                                    identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18444
                                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18445
                                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18446
                                    param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18447
                                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18448
                                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18449
                                    if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18450
                                      param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18451
                                    if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18452
                                        symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18453
                                        last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18454
                                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18455
                                        /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18456
                                        ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18457
                                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18458
                                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18459
                                }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18460
                                symbol_c * return_type_symbol = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18461
                                function_type_suffix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18462
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18463
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18464
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18465
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18466
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18467
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18468
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18469
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18470
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18471
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18472
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18473
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18474
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18475
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18476
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18477
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18478
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18479
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18480
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18481
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18482
    }/*function_mux*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18483
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18484
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18485
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18486
 *GT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18487
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18488
    case function_gt :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18489
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18490
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18491
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18492
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18493
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18494
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18495
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18496
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18497
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18498
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18499
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18500
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18501
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18502
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18503
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18504
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18505
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18506
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18507
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18508
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18509
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18510
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18511
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18512
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18513
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18514
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18515
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18516
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18517
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18518
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18519
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18520
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18521
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18522
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18523
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18524
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18525
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18526
                        function_name = (symbol_c*)(new pragma_c("__gt_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18527
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18528
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18529
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18530
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18531
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18532
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18533
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18534
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18535
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18536
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18537
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18538
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18539
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18540
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18541
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18542
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18543
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18544
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18545
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18546
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18547
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18548
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18549
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18550
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18551
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18552
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18553
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18554
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18555
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18556
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18557
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18558
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18559
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18560
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18561
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18562
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18563
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18564
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18565
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18566
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18567
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18568
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18569
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18570
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18571
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18572
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18573
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18574
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18575
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18576
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18577
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18578
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18579
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18580
    }/*function_gt*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18581
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18582
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18583
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18584
 *GE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18585
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18586
    case function_ge :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18587
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18588
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18589
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18590
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18591
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18592
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18593
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18594
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18595
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18596
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18597
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18598
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18599
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18600
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18601
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18602
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18603
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18604
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18605
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18606
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18607
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18608
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18609
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18610
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18611
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18612
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18613
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18614
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18615
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18616
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18617
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18618
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18619
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18620
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18621
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18622
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18623
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18624
                        function_name = (symbol_c*)(new pragma_c("__ge_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18625
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18626
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18627
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18628
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18629
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18630
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18631
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18632
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18633
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18634
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18635
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18636
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18637
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18638
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18639
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18640
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18641
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18642
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18643
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18644
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18645
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18646
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18647
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18648
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18649
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18650
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18651
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18652
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18653
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18654
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18655
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18656
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18657
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18658
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18659
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18660
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18661
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18662
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18663
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18664
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18665
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18666
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18667
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18668
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18669
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18670
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18671
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18672
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18673
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18674
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18675
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18676
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18677
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18678
    }/*function_ge*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18679
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18680
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18681
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18682
 *EQ
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18683
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18684
    case function_eq :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18685
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18686
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18687
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18688
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18689
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18690
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18691
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18692
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18693
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18694
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18695
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18696
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18697
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18698
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18699
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18700
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18701
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18702
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18703
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18704
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18705
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18706
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18707
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18708
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18709
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18710
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18711
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18712
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18713
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18714
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18715
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18716
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18717
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18718
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18719
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18720
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18721
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18722
                        function_name = (symbol_c*)(new pragma_c("__eq_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18723
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18724
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18725
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18726
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18727
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18728
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18729
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18730
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18731
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18732
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18733
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18734
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18735
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18736
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18737
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18738
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18739
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18740
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18741
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18742
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18743
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18744
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18745
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18746
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18747
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18748
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18749
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18750
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18751
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18752
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18753
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18754
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18755
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18756
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18757
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18758
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18759
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18760
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18761
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18762
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18763
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18764
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18765
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18766
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18767
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18768
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18769
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18770
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18771
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18772
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18773
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18774
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18775
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18776
    }/*function_eq*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18777
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18778
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18779
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18780
 *LT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18781
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18782
    case function_lt :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18783
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18784
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18785
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18786
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18787
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18788
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18789
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18790
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18791
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18792
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18793
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18794
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18795
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18796
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18797
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18798
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18799
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18800
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18801
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18802
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18803
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18804
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18805
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18806
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18807
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18808
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18809
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18810
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18811
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18812
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18813
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18814
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18815
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18816
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18817
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18818
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18819
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18820
                        function_name = (symbol_c*)(new pragma_c("__lt_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18821
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18822
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18823
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18824
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18825
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18826
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18827
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18828
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18829
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18830
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18831
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18832
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18833
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18834
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18835
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18836
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18837
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18838
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18839
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18840
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18841
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18842
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18843
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18844
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18845
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18846
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18847
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18848
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18849
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18850
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18851
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18852
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18853
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18854
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18855
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18856
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18857
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18858
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18859
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18860
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18861
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18862
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18863
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18864
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18865
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18866
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18867
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18868
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18869
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18870
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18871
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18872
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18873
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18874
    }/*function_lt*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18875
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18876
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18877
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18878
 *LE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18879
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18880
    case function_le :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18881
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18882
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18883
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18884
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18885
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18886
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18887
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18888
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18889
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18890
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18891
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18892
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18893
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18894
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18895
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18896
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18897
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18898
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18899
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18900
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18901
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18902
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18903
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18904
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18905
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18906
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18907
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18908
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18909
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18910
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18911
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18912
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18913
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18914
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18915
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18916
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18917
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18918
                        function_name = (symbol_c*)(new pragma_c("__le_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18919
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18920
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18921
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18922
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18923
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 18924
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18925
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18926
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18927
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18928
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18929
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18930
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18931
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18932
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18933
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18934
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18935
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18936
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18937
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18938
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18939
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18940
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18941
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18942
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18943
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18944
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18945
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18946
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18947
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18948
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18949
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18950
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18951
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18952
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18953
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18954
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18955
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18956
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18957
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18958
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18959
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18960
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18961
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18962
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18963
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18964
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18965
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18966
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18967
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 18968
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18969
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18970
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18971
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18972
    }/*function_le*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18973
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18974
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18975
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18976
 *NE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18977
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18978
    case function_ne :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18979
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18980
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18981
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18982
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18983
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18984
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18985
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18986
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18987
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18988
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18989
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18990
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18991
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18992
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18993
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 18994
            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18995
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18996
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18997
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18998
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 18999
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19000
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19001
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19002
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19003
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19004
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19005
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19006
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19007
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19008
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19009
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19010
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19011
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19012
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19013
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19014
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19015
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19016
                        function_name = (symbol_c*)(new pragma_c("__ne_"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19017
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19018
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19019
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 19020
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19021
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 19022
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19023
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19024
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19025
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19026
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19027
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19028
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19029
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19030
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19031
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19032
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19033
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19034
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19035
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19036
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19037
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19038
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19039
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19040
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19041
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19042
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19043
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19044
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19045
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19046
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19047
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19048
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19049
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19050
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19051
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19052
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19053
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19054
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19055
                        function_type_suffix = last_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19056
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19057
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19058
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19059
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19060
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19061
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19062
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19063
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19064
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19065
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19066
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19067
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19068
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19069
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19070
    }/*function_ne*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19071
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19072
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19073
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19074
 *LEN
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19075
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19076
    case function_len :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19077
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19078
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19079
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19080
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19081
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19082
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19083
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19084
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19085
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19086
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19087
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19088
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19089
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19090
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19091
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19092
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19093
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19094
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19095
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19096
        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19097
                function_name = (symbol_c*)(new pragma_c("__len"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19098
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19099
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19100
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19101
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19102
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19103
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19104
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19105
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19106
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19107
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19108
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19109
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19110
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19111
    }/*function_len*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19112
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19113
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19114
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19115
 *LEFT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19116
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19117
    case function_left :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19118
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19119
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19120
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19121
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19122
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19123
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19124
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19125
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19126
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19127
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19128
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19129
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19130
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19131
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19132
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19133
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19134
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19135
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19136
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19137
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19138
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19139
                    identifier_c param_name("L");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19140
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19141
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19142
                    symbol_c *L_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19143
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19144
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19145
                    if (L_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19146
                      L_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19147
                    if (L_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19148
                      L_type_symbol = search_expression_type->get_type(L_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19149
                      last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19150
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19151
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19152
                    if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19153
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19154
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19155
                        function_name = (symbol_c*)(new pragma_c("__left"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19156
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19157
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19158
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19159
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19160
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19161
                        if (L_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19162
                          L_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19163
                        ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19164
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19165
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19166
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19167
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19168
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19169
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19170
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19171
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19172
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19173
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19174
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19175
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19176
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19177
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19178
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19179
    }/*function_left*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19180
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19181
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19182
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19183
 *RIGHT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19184
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19185
    case function_right :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19186
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19187
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19188
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19189
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19190
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19191
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19192
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19193
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19194
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19195
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19196
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19197
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19198
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19199
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19200
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19201
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19202
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19203
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19204
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19205
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19206
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19207
                    identifier_c param_name("L");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19208
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19209
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19210
                    symbol_c *L_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19211
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19212
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19213
                    if (L_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19214
                      L_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19215
                    if (L_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19216
                      L_type_symbol = search_expression_type->get_type(L_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19217
                      last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19218
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19219
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19220
                    if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19221
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19222
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19223
                        function_name = (symbol_c*)(new pragma_c("__right"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19224
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19225
                        if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19226
                          IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19227
                        ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19228
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19229
                        if (L_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19230
                          L_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19231
                        ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19232
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19233
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19234
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19235
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19236
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19237
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19238
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19239
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19240
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19241
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19242
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19243
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19244
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19245
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19246
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19247
    }/*function_right*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19248
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19249
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19250
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19251
 *MID
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19252
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19253
    case function_mid :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19254
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19255
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19256
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19257
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19258
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19259
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19260
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19261
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19262
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19263
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19264
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19265
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19266
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19267
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19268
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19269
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19270
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19271
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19272
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19273
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19274
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19275
                    identifier_c param_name("L");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19276
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19277
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19278
                    symbol_c *L_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19279
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19280
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19281
                    if (L_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19282
                      L_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19283
                    if (L_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19284
                      L_type_symbol = search_expression_type->get_type(L_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19285
                      last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19286
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19287
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19288
                    if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19289
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19290
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19291
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19292
                            identifier_c param_name("P");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19293
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19294
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19295
                            symbol_c *P_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19296
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19297
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19298
                            if (P_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19299
                              P_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19300
                            if (P_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19301
                              P_type_symbol = search_expression_type->get_type(P_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19302
                              last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19303
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19304
                            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19305
                            if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19306
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19307
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19308
                                function_name = (symbol_c*)(new pragma_c("__mid"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19309
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19310
                                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19311
                                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19312
                                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19313
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19314
                                if (L_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19315
                                  L_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19316
                                ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19317
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19318
                                if (P_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19319
                                  P_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19320
                                ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19321
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19322
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19323
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19324
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19325
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19326
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19327
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19328
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19329
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19330
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19331
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19332
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19333
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19334
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19335
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19336
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19337
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19338
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19339
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19340
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19341
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19342
    }/*function_mid*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19343
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19344
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19345
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19346
 *CONCAT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19347
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19348
    case function_concat :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19349
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19350
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19351
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19352
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19353
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19354
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19355
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19356
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19357
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19358
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19359
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19360
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19361
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19362
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19363
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19364
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19365
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19366
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::date_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19367
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19368
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19369
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19370
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19371
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19372
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19373
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19374
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19375
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19376
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19377
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19378
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19379
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19380
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19381
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19382
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19383
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::tod_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19384
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19385
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19386
                        function_name = (symbol_c*)(new pragma_c("__time_add"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19387
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19388
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19389
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19390
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19391
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19392
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19393
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19394
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19395
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19396
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19397
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19398
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19399
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19400
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19401
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19402
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19403
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19404
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19405
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19406
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19407
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19408
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19409
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19410
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19411
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19412
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19413
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19414
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19415
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19416
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19417
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19418
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19419
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19420
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19421
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19422
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19423
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19424
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19425
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19426
                        function_name = (symbol_c*)(new pragma_c("__concat"));
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19427
                        
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19428
                        if (nb_param < 2)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19429
                          nb_param = 2;
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 19430
                        char* nb_param_str = new char[10];
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19431
                        sprintf(nb_param_str, "%d", nb_param);
154
9114afe1f64b Bug with standard functions nb_params count on Windows fixed
lbessard
parents: 153
diff changeset
 19432
                        ADD_PARAM_LIST((symbol_c*)(new integer_c((const char *)nb_param_str)), (symbol_c*)(new int_type_name_c()), function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19433
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19434
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19435
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19436
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19437
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19438
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19439
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19440
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19441
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19442
                        int base_num = 3;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19443
                        symbol_c *param_value = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19444
                        do{
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19445
                            char my_name[10];
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19446
                            sprintf(my_name, "IN%d", base_num++);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19447
                            identifier_c param_name(my_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19448
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19449
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19450
                            param_value = function_call_param_iterator.search(&param_name);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19451
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19452
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19453
                            if (param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19454
                              param_value = function_call_param_iterator.next();
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19455
                            if (param_value != NULL){
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19456
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19457
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19458
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19459
                                /*Function specific CODE */
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19460
                                ADD_PARAM_LIST(param_value, current_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19461
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19462
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19463
                        }while(param_value != NULL);
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19464
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19465
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19466
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19467
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19468
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19469
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19470
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19471
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19472
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19473
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19474
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19475
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19476
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19477
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19478
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19479
    }/*function_concat*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19480
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19481
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19482
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19483
 *INSERT
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19484
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19485
    case function_insert :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19486
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19487
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19488
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19489
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19490
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19491
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19492
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19493
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19494
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19495
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19496
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19497
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19498
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19499
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19500
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19501
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19502
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19503
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19504
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19505
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19506
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19507
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19508
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19509
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19510
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19511
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19512
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19513
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19514
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19515
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19516
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19517
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19518
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19519
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19520
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19521
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19522
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19523
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19524
                            identifier_c param_name("P");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19525
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19526
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19527
                            symbol_c *P_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19528
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19529
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19530
                            if (P_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19531
                              P_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19532
                            if (P_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19533
                              P_type_symbol = search_expression_type->get_type(P_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19534
                              last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19535
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19536
                            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19537
                            if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19538
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19539
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19540
                                function_name = (symbol_c*)(new pragma_c("__insert"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19541
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19542
                                if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19543
                                  IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19544
                                ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19545
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19546
                                if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19547
                                  IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19548
                                ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19549
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19550
                                if (P_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19551
                                  P_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19552
                                ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19553
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19554
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19555
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19556
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19557
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19558
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19559
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19560
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19561
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19562
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19563
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19564
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19565
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19566
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19567
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19568
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19569
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19570
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19571
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19572
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19573
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19574
    }/*function_insert*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19575
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19576
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19577
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19578
 *DELETE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19579
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19580
    case function_delete :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19581
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19582
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19583
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19584
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19585
            identifier_c param_name("IN");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19586
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19587
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19588
            symbol_c *IN_type_symbol = NULL;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19589
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19590
            /* Get the value from a foo(<param_value>) style call */
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19591
            if (IN_param_value == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19592
              IN_param_value = function_call_param_iterator.next();
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19593
            if (IN_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19594
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19595
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19596
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19597
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19598
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19599
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19600
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19601
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19602
                    identifier_c param_name("L");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19603
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19604
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19605
                    symbol_c *L_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19606
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19607
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19608
                    if (L_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19609
                      L_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19610
                    if (L_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19611
                      L_type_symbol = search_expression_type->get_type(L_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19612
                      last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19613
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19614
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19615
                    if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19616
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19617
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19618
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19619
                            identifier_c param_name("P");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19620
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19621
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19622
                            symbol_c *P_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19623
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19624
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19625
                            if (P_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19626
                              P_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19627
                            if (P_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19628
                              P_type_symbol = search_expression_type->get_type(P_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19629
                              last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19630
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19631
                            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19632
                            if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19633
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19634
                        
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19635
                                function_name = (symbol_c*)(new pragma_c("__delete"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19636
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19637
                                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19638
                                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19639
                                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19640
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19641
                                if (L_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19642
                                  L_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19643
                                ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19644
                                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19645
                                if (P_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19646
                                  P_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19647
                                ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19648
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19649
                                break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19650
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19651
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19652
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19653
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19654
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19655
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19656
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19657
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19658
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19659
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19660
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19661
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19662
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19663
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19664
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19665
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19666
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19667
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19668
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19669
    }/*function_delete*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19670
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19671
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19672
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19673
 *REPLACE
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19674
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19675
    case function_replace :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19676
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19677
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19678
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19679
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19680
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19681
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19682
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19683
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19684
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19685
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19686
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19687
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19688
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19689
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19690
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19691
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19692
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19693
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19694
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19695
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19696
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19697
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19698
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19699
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19700
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19701
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19702
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19703
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19704
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19705
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19706
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19707
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19708
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19709
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19710
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19711
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19712
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19713
                        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19714
                            identifier_c param_name("L");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19715
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19716
                            symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19717
                            symbol_c *L_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19718
                            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19719
                            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19720
                            if (L_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19721
                              L_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19722
                            if (L_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19723
                              L_type_symbol = search_expression_type->get_type(L_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19724
                              last_type_symbol = last_type_symbol && L_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19725
                            }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19726
                            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19727
                            if(L_type_symbol == NULL || search_expression_type->is_integer_type(L_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19728
                            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19729
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19730
                                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19731
                                    identifier_c param_name("P");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19732
                                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19733
                                    symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19734
                                    symbol_c *P_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19735
                                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19736
                                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19737
                                    if (P_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19738
                                      P_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19739
                                    if (P_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19740
                                      P_type_symbol = search_expression_type->get_type(P_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19741
                                      last_type_symbol = last_type_symbol && P_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19742
                                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19743
                                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19744
                                    if(P_type_symbol == NULL || search_expression_type->is_integer_type(P_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19745
                                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19746
                                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19747
                                        function_name = (symbol_c*)(new pragma_c("__replace"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19748
                                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19749
                                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19750
                                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19751
                                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19752
                                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19753
                                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19754
                                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19755
                                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19756
                                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19757
                                        if (L_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19758
                                          L_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19759
                                        ADD_PARAM_LIST(L_param_value, L_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19760
                                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19761
                                        if (P_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19762
                                          P_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19763
                                        ADD_PARAM_LIST(P_param_value, P_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19764
                                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19765
                                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19766
                                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19767
                                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19768
                                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19769
                                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19770
                                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19771
                                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19772
                                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19773
                            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19774
                            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19775
                            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19776
                            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19777
                        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19778
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19779
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19780
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19781
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19782
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19783
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19784
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19785
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19786
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19787
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19788
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19789
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19790
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19791
    }/*function_replace*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19792
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19793
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19794
/****
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19795
 *FIND
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19796
 */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19797
    case function_find :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19798
    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19799
        symbol_c *last_type_symbol = NULL;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19800
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19801
        {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19802
            identifier_c param_name("IN1");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19803
            /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19804
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19805
            symbol_c *IN1_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19806
            
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19807
            /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19808
            if (IN1_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19809
              IN1_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19810
            if (IN1_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19811
              IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19812
              last_type_symbol = last_type_symbol && IN1_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19813
            }
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19814
            
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19815
            if(IN1_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19816
            {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19817
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19818
                {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19819
                    identifier_c param_name("IN2");
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19820
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19821
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19822
                    symbol_c *IN2_type_symbol = NULL;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19823
                    
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19824
                    /* Get the value from a foo(<param_value>) style call */
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19825
                    if (IN2_param_value == NULL)
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19826
                      IN2_param_value = function_call_param_iterator.next();
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19827
                    if (IN2_param_value != NULL) {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19828
                      IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19829
                      last_type_symbol = last_type_symbol && IN2_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19830
                    }
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19831
                    
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19832
                    if(IN2_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::string_type_name, last_type_symbol))
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19833
                    {
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19834
                
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19835
                        function_name = (symbol_c*)(new pragma_c("__find"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19836
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19837
                        if (IN1_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19838
                          IN1_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19839
                        ADD_PARAM_LIST(IN1_param_value, IN1_type_symbol, function_param_iterator_c::direction_in)
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19840
                        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19841
                        if (IN2_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
 19842
                          IN2_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19843
                        ADD_PARAM_LIST(IN2_param_value, IN2_type_symbol, function_param_iterator_c::direction_in)
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19844
                        symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19845
                        break;
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19846
                        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19847
                    }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19848
                    
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19849
                    
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19850
                    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19851
                }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19852
                
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19853
            }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19854
            
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
 19855
            
70
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19856
            ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19857
        }
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19858
        
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19859
    }/*function_find*/
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19860
    break;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19861
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19862
    case function_none :
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19863
    ERROR;
e1f0ebd2d9ec Change generate_cc to generate_c
lbessard
parents:
diff changeset
 19864
}