stage4/generate_c/il_code_gen.c
author Mario de Sousa <msousa@fe.up.pt>
Wed, 30 Mar 2011 19:53:32 +0100
changeset 257 90782e241346
parent 169 bea932bc60b0
child 199 b075f28ec081
permissions -rwxr-xr-x
Huge change.
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    42
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    43
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    44
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    45
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    46
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    47
            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
    48
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    49
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    50
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    51
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    52
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    53
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    54
                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
    55
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    56
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    57
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    58
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    59
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    60
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    61
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    62
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    63
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    64
    }/*function_real_to_sint*/
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
 *REAL_TO_LINT
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
    case function_real_to_lint :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    73
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    74
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    75
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    76
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    77
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    78
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    79
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    80
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    81
            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
    82
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    83
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    84
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    85
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
    86
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    87
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    88
                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
    89
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    90
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    91
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    92
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    93
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    94
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    95
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    96
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    97
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    98
    }/*function_real_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
    99
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   100
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   101
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   102
 *REAL_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   103
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   104
    case function_real_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   105
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   106
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   107
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   108
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   109
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   110
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   113
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   114
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   115
            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
   116
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   117
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   118
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   119
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   120
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   121
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   122
                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
   123
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   124
                break;
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   128
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   129
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   130
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   131
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   132
    }/*function_real_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   133
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   134
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   135
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   136
 *REAL_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   137
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   138
    case function_real_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   139
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   140
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   141
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   142
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   143
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   144
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   145
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   146
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   147
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   148
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   149
            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
   150
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   151
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   152
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   153
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   154
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   155
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   156
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   157
                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
   158
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   159
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   160
                
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   164
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   165
        }
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
    }/*function_real_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   168
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   171
 *REAL_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   172
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   173
    case function_real_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   174
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   175
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   176
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   177
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   178
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   179
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   180
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   181
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   182
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   183
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   184
            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
   185
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   186
        
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::dword_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_dword*/
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_DT
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_dt :
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   213
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   214
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   215
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   216
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   217
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   218
            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
   219
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   220
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   221
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   222
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   223
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   224
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   225
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   226
                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
   227
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   228
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   229
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   230
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   231
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   232
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   233
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   234
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   235
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   236
    }/*function_real_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   237
    break;
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
 *REAL_TO_TOD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   241
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   242
    case function_real_to_tod :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   245
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   248
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   251
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   252
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   253
            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
   254
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   255
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   256
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   257
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   258
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   259
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   260
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   261
                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
   262
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   263
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   264
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   265
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   266
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   267
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   268
            ERROR;
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_real_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   272
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   273
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   274
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   275
 *REAL_TO_UDINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   276
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   277
    case function_real_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   278
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   279
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   283
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   286
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   287
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   288
            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
   289
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   290
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   291
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   292
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   293
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   294
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   295
                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
   296
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   297
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   298
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   299
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   300
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   301
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   302
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   303
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   304
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   305
    }/*function_real_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   306
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   307
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   308
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   309
 *REAL_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   310
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   311
    case function_real_to_word :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   314
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   315
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   316
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   317
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   318
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   319
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   320
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   321
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   322
            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
   323
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   324
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   325
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   326
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   327
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   328
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   329
                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
   330
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   331
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   332
                
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
            
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
            ERROR;
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
    }/*function_real_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   340
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   341
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   342
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   343
 *REAL_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   344
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   345
    case function_real_to_string :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   346
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   347
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   348
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   349
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   350
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   351
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   352
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   353
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   354
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   355
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   356
            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
   357
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   358
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   359
                function_name = (symbol_c*)(new pragma_c("__real_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   360
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   361
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   362
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   363
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   364
                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
   365
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   366
                break;
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
            }
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   372
        }
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
    }/*function_real_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   375
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   378
 *REAL_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   379
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   380
    case function_real_to_lword :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   383
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   384
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   385
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   386
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   387
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   388
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   389
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   390
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   391
            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
   392
            {
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)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   396
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   397
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   398
                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
   399
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   400
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   401
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   402
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   403
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   404
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   405
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   406
        }
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
    }/*function_real_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   409
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   412
 *REAL_TO_UINT
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
    case function_real_to_uint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   415
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   416
        symbol_c *last_type_symbol = NULL;
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
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   419
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   420
            symbol_c *IN_param_value = &this->default_variable_name;
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 *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   423
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   424
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   425
            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
   426
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   427
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   428
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   429
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   430
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   431
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   432
                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
   433
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   434
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   435
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   436
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   437
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   438
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   439
            ERROR;
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
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   442
    }/*function_real_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   443
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   444
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   445
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   446
 *REAL_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   447
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   448
    case function_real_to_lreal :
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
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   454
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   457
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   458
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   459
            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
   460
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   461
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   462
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   463
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   464
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   465
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   466
                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
   467
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   468
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   469
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   470
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   471
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   472
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   473
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   474
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   475
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   476
    }/*function_real_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   477
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   478
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   479
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   480
 *REAL_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   481
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   482
    case function_real_to_byte :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   483
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   484
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   485
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   486
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   487
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   488
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   489
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   490
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   491
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   492
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   493
            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
   494
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   495
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   496
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   497
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   498
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   499
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   500
                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
   501
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   502
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   503
                
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
            
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
            ERROR;
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
    }/*function_real_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   511
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   512
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   513
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   514
 *REAL_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   515
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   516
    case function_real_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   517
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   518
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   519
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   520
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   521
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   522
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   523
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   524
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   525
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   526
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   527
            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
   528
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   529
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   530
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   531
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   532
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   533
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   534
                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
   535
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   536
                break;
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
            
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   542
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   543
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   544
    }/*function_real_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   545
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   546
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
 *REAL_TO_ULINT
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
    case function_real_to_ulint :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   553
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   554
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   555
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   556
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   557
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   558
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   559
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   560
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   561
            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
   562
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   563
        
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
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   566
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   567
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   568
                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
   569
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   570
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   571
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   572
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   573
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   574
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   575
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   576
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   577
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   578
    }/*function_real_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   579
    break;
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
 *REAL_TO_BOOL
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
    case function_real_to_bool :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   585
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   586
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   590
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   591
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   592
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   593
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   594
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   595
            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
   596
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   597
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   598
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   599
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   600
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   601
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   602
                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
   603
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   604
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   605
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   606
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   607
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   608
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   609
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   610
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   611
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   612
    }/*function_real_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   613
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   614
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   615
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   616
 *REAL_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   617
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   618
    case function_real_to_time :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   619
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   620
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   624
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   625
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   626
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   627
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   628
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   629
            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
   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
                function_name = (symbol_c*)(new pragma_c("__real_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   633
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   634
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   635
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   636
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   637
                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
   638
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   639
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   640
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   641
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   642
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   643
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   644
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   645
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   646
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   647
    }/*function_real_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   648
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   649
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   650
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   651
 *REAL_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   652
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   653
    case function_real_to_int :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   654
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   655
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   656
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   657
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   658
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   659
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   660
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   661
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   662
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   663
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   664
            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
   665
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   666
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   667
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   668
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   669
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   670
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   671
                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
   672
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   673
                break;
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
            }
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   678
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   679
        }
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
    }/*function_real_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   682
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   683
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   684
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   685
 *SINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   686
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   687
    case function_sint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   688
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   689
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   690
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   691
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   692
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   693
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   694
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   695
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   696
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   697
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   698
            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
   699
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   700
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   701
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   702
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   703
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   704
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   705
                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
   706
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   707
                break;
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   712
            ERROR;
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
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   715
    }/*function_sint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   716
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   719
 *SINT_TO_LINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   720
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   721
    case function_sint_to_lint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   722
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   723
        symbol_c *last_type_symbol = NULL;
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
        {
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 = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   728
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   729
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   730
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   731
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   732
            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
   733
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   734
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   735
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   736
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   737
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   738
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   739
                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
   740
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   741
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   742
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   743
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   744
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   745
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   746
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   747
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   748
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   749
    }/*function_sint_to_lint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   750
    break;
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
 *SINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   754
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   755
    case function_sint_to_dint :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   758
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   761
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   764
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   765
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   766
            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
   767
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   768
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   769
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   770
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   771
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   772
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   773
                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
   774
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   775
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   776
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   777
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   778
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   779
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   780
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   781
        }
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
    }/*function_sint_to_dint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   784
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   785
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   786
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   787
 *SINT_TO_DATE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   788
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   789
    case function_sint_to_date :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   790
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   791
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   795
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   796
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   797
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   798
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   799
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   800
            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
   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
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   804
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   805
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   806
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   807
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   808
                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
   809
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   810
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   811
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   812
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   813
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   814
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   815
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   816
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   817
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   818
    }/*function_sint_to_date*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   819
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   820
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   821
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   822
 *SINT_TO_DWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   823
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   824
    case function_sint_to_dword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   825
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   826
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   827
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   828
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   829
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   830
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   831
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   832
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   833
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   834
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   835
            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
   836
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   837
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   838
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   839
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   840
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   841
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   842
                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
   843
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   844
                break;
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
            }
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   849
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   850
        }
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
    }/*function_sint_to_dword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   853
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   854
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   855
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   856
 *SINT_TO_DT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   857
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   858
    case function_sint_to_dt :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   859
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   860
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   861
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   862
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   863
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   864
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   865
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   866
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   867
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   868
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   869
            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
   870
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   871
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   872
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   873
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   874
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   875
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   876
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   877
                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
   878
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   879
                break;
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
            
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   885
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   886
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   887
    }/*function_sint_to_dt*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   888
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   889
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
 *SINT_TO_TOD
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
    case function_sint_to_tod :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   896
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   897
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   898
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   899
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   900
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   901
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   902
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   903
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   904
            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
   905
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   906
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   907
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
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)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   910
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   911
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   912
                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
   913
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   914
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   915
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   916
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   917
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   918
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   919
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   920
        }
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
    }/*function_sint_to_tod*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   923
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   926
 *SINT_TO_UDINT
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
    case function_sint_to_udint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   929
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   930
        symbol_c *last_type_symbol = NULL;
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
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   933
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   934
            symbol_c *IN_param_value = &this->default_variable_name;
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 *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   937
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   938
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   939
            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
   940
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   941
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   942
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   943
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   944
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   945
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   946
                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
   947
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   948
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   949
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   950
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   951
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   952
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   953
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   954
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   955
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   956
    }/*function_sint_to_udint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   957
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   958
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   959
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   960
 *SINT_TO_WORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   961
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   962
    case function_sint_to_word :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   963
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   964
        symbol_c *last_type_symbol = NULL;
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   968
            symbol_c *IN_param_value = &this->default_variable_name;
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
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   971
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   972
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   973
            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
   974
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   975
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   976
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   977
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
   978
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   979
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   980
                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
   981
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   982
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   983
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   984
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   985
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   986
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   987
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   988
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   989
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   990
    }/*function_sint_to_word*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   991
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   992
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   993
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   994
 *SINT_TO_STRING
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   995
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   996
    case function_sint_to_string :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
   999
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1000
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1001
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1002
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1003
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1004
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1005
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1006
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1007
            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
  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
                function_name = (symbol_c*)(new pragma_c("__sint_to_string"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1011
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1012
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1013
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1014
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1015
                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
  1016
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1017
                break;
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
            }
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1022
            ERROR;
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
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1025
    }/*function_sint_to_string*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1026
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1027
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1028
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1029
 *SINT_TO_LWORD
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1030
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1031
    case function_sint_to_lword :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1032
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1033
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1034
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1035
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1036
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1037
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1038
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1039
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1040
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1041
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1042
            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
  1043
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1044
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1045
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1046
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1047
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1048
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1049
                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
  1050
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1051
                break;
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
            }
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1057
        }
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
    }/*function_sint_to_lword*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1060
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1063
 *SINT_TO_UINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1064
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1065
    case function_sint_to_uint :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1068
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1069
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1070
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1071
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1072
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1073
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1074
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1075
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1076
            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
  1077
            {
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)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1081
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1082
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1083
                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
  1084
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1085
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1086
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1087
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1088
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1089
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1090
            ERROR;
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
    }/*function_sint_to_uint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1094
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1095
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
 *SINT_TO_LREAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1098
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1099
    case function_sint_to_lreal :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1102
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1105
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1106
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1107
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1108
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1109
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1110
            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
  1111
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1112
        
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
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1115
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1116
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1117
                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
  1118
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1119
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1120
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1121
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1122
            
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1125
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1126
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1127
    }/*function_sint_to_lreal*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1128
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1129
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1130
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1131
 *SINT_TO_BYTE
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1132
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1133
    case function_sint_to_byte :
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
        symbol_c *last_type_symbol = NULL;
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
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1138
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1139
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1140
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1141
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1142
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1143
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1144
            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
  1145
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1146
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1147
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1148
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1149
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1150
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1151
                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
  1152
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1153
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1154
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1155
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1156
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1157
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1158
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1159
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1160
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1161
    }/*function_sint_to_byte*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1162
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1163
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1164
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1165
 *SINT_TO_USINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1166
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1167
    case function_sint_to_usint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1168
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1169
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1170
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1171
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1172
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1173
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1174
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1175
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1176
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1177
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1178
            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
  1179
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1180
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1181
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1182
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1183
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1184
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1185
                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
  1186
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1187
                break;
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
            }
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1192
            ERROR;
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
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1195
    }/*function_sint_to_usint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1196
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1197
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1198
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1199
 *SINT_TO_ULINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1200
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1201
    case function_sint_to_ulint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1202
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1203
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1204
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1205
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1206
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1207
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1208
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1209
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1210
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1211
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1212
            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
  1213
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1214
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1215
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1216
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1217
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1218
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1219
                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
  1220
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1221
                break;
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
            }
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1227
        }
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
    }/*function_sint_to_ulint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1230
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1233
 *SINT_TO_BOOL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1234
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1235
    case function_sint_to_bool :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1238
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1239
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1240
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1241
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1242
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1243
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1244
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1245
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1246
            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
  1247
            {
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)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1251
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1252
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1253
                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
  1254
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1255
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1256
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1257
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1258
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1259
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1260
            ERROR;
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
    }/*function_sint_to_bool*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1264
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1265
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
 *SINT_TO_TIME
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1268
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1269
    case function_sint_to_time :
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
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1272
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
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1275
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1276
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1277
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1278
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1279
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1280
            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
  1281
            {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1282
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1283
                function_name = (symbol_c*)(new pragma_c("__int_to_time"));
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1284
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1285
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1286
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1287
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1288
                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
  1289
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1290
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1291
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1292
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1293
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1294
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1295
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1296
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1297
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1298
    }/*function_sint_to_time*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1299
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1300
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1301
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1302
 *SINT_TO_INT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1303
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1304
    case function_sint_to_int :
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
        symbol_c *last_type_symbol = NULL;
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
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1309
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1310
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1311
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1312
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1313
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1314
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1315
            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
  1316
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1317
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1318
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1319
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1320
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1321
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1322
                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
  1323
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1324
                break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1325
                
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1326
            }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1327
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1328
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1329
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1330
        }
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1331
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1332
    }/*function_sint_to_int*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1333
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1334
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1335
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1336
 *LINT_TO_REAL
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1337
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1338
    case function_lint_to_real :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1339
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1340
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1341
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1342
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1343
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1344
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1345
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1346
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1347
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1348
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1349
            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
  1350
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1351
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1352
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1353
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1354
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1355
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1356
                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
  1357
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1358
                break;
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
            }
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
            
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1363
            ERROR;
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
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1366
    }/*function_lint_to_real*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1367
    break;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1368
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1369
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1370
 *LINT_TO_SINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1371
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1372
    case function_lint_to_sint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1373
    {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1374
        symbol_c *last_type_symbol = NULL;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1375
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1376
        {
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1377
            /* Get the value from a foo(<param_name> = <param_value>) style call */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1378
            symbol_c *IN_param_value = &this->default_variable_name;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1379
        
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1380
            symbol_c *IN_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1381
            last_type_symbol = param_data_type;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1382
            
169
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1383
            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
  1384
            {
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1385
        
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1386
                
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1387
                if (IN_type_symbol == NULL)
bea932bc60b0 Bug when function with unconnected input fixed
lbessard
parents: 165
diff changeset
  1388
                  IN_type_symbol = last_type_symbol;
149
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1389
                ADD_PARAM_LIST(IN_param_value, IN_type_symbol, function_param_iterator_c::direction_in)
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1390
                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
  1391
                function_type_prefix = return_type_symbol;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1392
                break;
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
            }
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
            ERROR;
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1398
        }
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
    }/*function_lint_to_sint*/
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1401
    break;
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
/****
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1404
 *LINT_TO_DINT
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1405
 */
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: 70
diff changeset
  1406
    case function_lint_to_dint :
05ca171a3d57 Adding support for EN/ENO in standard functions
lbessard
parents: