stage4/generate_cc/st_code_gen.c
author etisserant
Sat, 07 Jul 2007 11:34:21 +0200
changeset 38 6cce7d14647e
parent 35 9f3d6c089533
child 40 873a5b60a7ea
permissions -rw-r--r--
Stage4 changes according to new STD lib implementation
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     1
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     2
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     3
 * IEC 61131-3 standard function lib
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     4
 * generated code, do not edit by hand
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     5
 */
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     6
switch(current_function_type){
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     7
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
     8
/****
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
     9
 *REAL_TO_LREAL
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    10
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    11
    case function_real_to_lreal :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    12
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    13
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    14
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    15
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    16
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    17
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    18
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    19
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    20
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    21
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    22
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    23
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    24
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    25
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    26
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    27
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    28
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    29
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    30
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    31
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    32
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    33
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    34
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    35
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    36
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    37
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    38
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    39
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    40
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    41
    }/*function_real_to_lreal*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    42
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
    43
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
    44
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
    45
 *REAL_TO_SINT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
    46
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    47
    case function_real_to_sint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    48
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    49
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    50
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    51
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    52
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    53
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    54
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    55
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    56
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    57
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    58
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    59
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    60
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    61
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    62
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    63
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    64
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    65
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    66
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    67
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    68
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    69
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    70
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    71
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    72
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    73
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    74
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    75
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    76
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    77
    }/*function_real_to_sint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    78
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    79
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    80
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    81
 *REAL_TO_INT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    82
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    83
    case function_real_to_int :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    84
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    85
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    86
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    87
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    88
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    89
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    90
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    91
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    92
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    93
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    94
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    95
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    96
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    97
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    98
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
    99
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   100
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   101
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   102
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   103
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   104
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   105
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   106
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   107
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   108
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   109
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   110
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   111
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   112
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   113
    }/*function_real_to_int*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   114
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   115
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   116
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   117
 *REAL_TO_DINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   118
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   119
    case function_real_to_dint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   120
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   121
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   122
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   123
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   124
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   125
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   126
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   127
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   128
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   129
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   130
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   131
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   132
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   133
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   134
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   135
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   136
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   137
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   138
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   139
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   140
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   141
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   142
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   143
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   144
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   145
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   146
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   147
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   148
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   149
    }/*function_real_to_dint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   150
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
   151
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
   152
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
   153
 *REAL_TO_LINT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
   154
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   155
    case function_real_to_lint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   156
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   157
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   158
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   159
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   160
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   161
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   162
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   163
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   164
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   165
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   166
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   167
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   168
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   169
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   170
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   171
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   172
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   173
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   174
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   175
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   176
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   177
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   178
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   179
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   180
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   181
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   182
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   183
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   184
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   185
    }/*function_real_to_lint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   186
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   187
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   188
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   189
 *REAL_TO_USINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   190
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   191
    case function_real_to_usint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   192
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   193
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   194
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   195
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   196
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   197
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   198
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   199
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   200
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   201
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   202
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   203
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   204
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   205
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   206
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   207
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   208
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   209
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   210
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   211
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   212
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   213
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   214
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   215
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   216
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   217
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   218
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   219
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   220
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   221
    }/*function_real_to_usint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   222
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   223
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   224
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   225
 *REAL_TO_UINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   226
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   227
    case function_real_to_uint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   228
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   229
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   230
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   231
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   232
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   233
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   234
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   235
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   236
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   237
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   238
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   239
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   240
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   241
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   242
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   243
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   244
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   245
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   246
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   247
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   248
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   249
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   250
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   251
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   252
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   253
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   254
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   255
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   256
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   257
    }/*function_real_to_uint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   258
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   259
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   260
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   261
 *REAL_TO_UDINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   262
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   263
    case function_real_to_udint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   264
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   265
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   266
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   267
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   268
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   269
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   270
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   271
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   272
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   273
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   274
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   275
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   276
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   277
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   278
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   279
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   280
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   281
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   282
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   283
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   284
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   285
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   286
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   287
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   288
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   289
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   290
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   291
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   292
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   293
    }/*function_real_to_udint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   294
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   295
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   296
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   297
 *REAL_TO_ULINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   298
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   299
    case function_real_to_ulint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   300
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   301
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   302
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   303
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   304
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   305
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   306
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   307
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   308
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   309
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   310
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   311
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   312
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   313
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   314
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   315
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   316
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   317
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   318
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   319
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   320
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   321
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   322
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   323
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   324
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   325
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   326
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   327
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   328
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   329
    }/*function_real_to_ulint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   330
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   331
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   332
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   333
 *REAL_TO_TIME
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   334
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   335
    case function_real_to_time :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   336
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   337
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   338
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   339
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   340
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   341
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   342
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   343
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   344
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   345
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   346
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   347
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   348
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   349
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   350
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   351
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   352
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   353
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   354
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   355
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   356
                s4o.print(")__real_to_time(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   357
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   358
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   359
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   360
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   361
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   362
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   363
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   364
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   365
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   366
    }/*function_real_to_time*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   367
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   368
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   369
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   370
 *REAL_TO_BOOL
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   371
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   372
    case function_real_to_bool :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   373
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   374
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   375
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   376
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   377
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   378
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   379
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   380
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   381
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   382
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   383
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   384
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   385
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   386
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   387
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   388
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   389
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   390
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   391
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   392
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   393
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   394
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   395
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   396
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   397
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   398
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   399
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   400
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   401
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   402
    }/*function_real_to_bool*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   403
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   404
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   405
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   406
 *REAL_TO_BYTE
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   407
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   408
    case function_real_to_byte :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   409
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   410
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   411
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   412
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   413
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   414
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   415
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   416
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   417
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   418
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   419
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   420
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   421
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   422
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   423
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   424
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   425
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   426
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   427
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   428
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   429
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   430
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   431
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   432
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   433
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   434
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   435
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   436
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   437
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   438
    }/*function_real_to_byte*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   439
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   440
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   441
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   442
 *REAL_TO_WORD
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   443
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   444
    case function_real_to_word :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   445
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   446
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   447
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   448
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   449
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   450
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   451
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   452
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   453
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   454
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   455
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   456
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   457
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   458
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   459
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   460
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   461
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   462
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   463
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   464
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   465
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   466
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   467
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   468
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   469
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   470
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   471
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   472
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   473
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   474
    }/*function_real_to_word*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   475
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   476
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   477
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   478
 *REAL_TO_DWORD
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   479
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   480
    case function_real_to_dword :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   481
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   482
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   483
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   484
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   485
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   486
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   487
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   488
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   489
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   490
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   491
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   492
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   493
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   494
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   495
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   496
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   497
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   498
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   499
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   500
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   501
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   502
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   503
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   504
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   505
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   506
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   507
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   508
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   509
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   510
    }/*function_real_to_dword*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   511
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   512
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   513
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   514
 *REAL_TO_LWORD
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   515
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   516
    case function_real_to_lword :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   517
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   518
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   519
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   520
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   521
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   522
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   523
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   524
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   525
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   526
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   527
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   528
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   529
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   530
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   531
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   532
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   533
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   534
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   535
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   536
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   537
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   538
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   539
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   540
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   541
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   542
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   543
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   544
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   545
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   546
    }/*function_real_to_lword*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   547
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   548
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   549
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   550
 *REAL_TO_STRING
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   551
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   552
    case function_real_to_string :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   553
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   554
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   555
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   556
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   557
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   558
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   559
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   560
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   561
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   562
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   563
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   564
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   565
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   566
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   567
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   568
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   569
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   570
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   571
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   572
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   573
                s4o.print(")__real_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   574
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   575
                s4o.print(")");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   576
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   577
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   578
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   579
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   580
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   581
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   582
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   583
    }/*function_real_to_string*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   584
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   585
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   586
/****
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   587
 *REAL_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   588
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   589
    case function_real_to_date :
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   590
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   591
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   592
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   593
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   594
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   595
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   596
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   597
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   598
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   599
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   600
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   601
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   602
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   603
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   604
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   605
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   606
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   607
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   608
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   609
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   610
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   611
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   612
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   613
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   614
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   615
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   616
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   617
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   618
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   619
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   620
    }/*function_real_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   621
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   622
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   623
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   624
 *REAL_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   625
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   626
    case function_real_to_tod :
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   627
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   628
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   629
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   630
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   631
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   632
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   633
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   634
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   635
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   636
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   637
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   638
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   639
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   640
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   641
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   642
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
   643
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   644
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   645
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   646
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   647
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   648
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   649
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   650
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   651
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   652
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   653
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   654
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   655
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   656
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   657
    }/*function_real_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   658
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   659
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   660
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   661
 *REAL_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   662
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   663
    case function_real_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   664
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   665
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   666
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   667
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   668
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   669
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   670
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   671
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   672
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   673
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   674
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   675
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   676
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   677
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   678
            if (typeid(*last_type_symbol) == typeid(real_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   679
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   680
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   681
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   682
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   683
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   684
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   685
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   686
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   687
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   688
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   689
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   690
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   691
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   692
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   693
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   694
    }/*function_real_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   695
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   696
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   697
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   698
 *LREAL_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   699
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   700
    case function_lreal_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   701
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   702
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   703
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   704
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   705
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   706
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   707
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   708
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   709
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   710
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   711
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   712
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   713
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   714
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   715
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   716
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   717
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   718
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   719
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   720
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   721
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   722
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   723
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   724
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   725
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   726
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   727
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   728
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   729
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   730
    }/*function_lreal_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   731
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   732
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   733
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   734
 *LREAL_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   735
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   736
    case function_lreal_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   737
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   738
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   739
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   740
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   741
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   742
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   743
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   744
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   745
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   746
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   747
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   748
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   749
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   750
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   751
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   752
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   753
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   754
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   755
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   756
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   757
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   758
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   759
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   760
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   761
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   762
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   763
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   764
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   765
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   766
    }/*function_lreal_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   767
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   768
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   769
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   770
 *LREAL_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   771
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   772
    case function_lreal_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   773
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   774
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   775
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   776
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   777
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   778
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   779
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   780
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   781
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   782
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   783
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   784
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   785
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   786
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   787
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   788
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   789
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   790
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   791
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   792
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   793
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   794
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   795
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   796
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   797
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   798
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   799
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   800
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   801
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   802
    }/*function_lreal_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   803
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   804
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   805
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   806
 *LREAL_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   807
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   808
    case function_lreal_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   809
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   810
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   811
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   812
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   813
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   814
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   815
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   816
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   817
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   818
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   819
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   820
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   821
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   822
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   823
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   824
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   825
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   826
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   827
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   828
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   829
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   830
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   831
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   832
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   833
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   834
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   835
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   836
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   837
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   838
    }/*function_lreal_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   839
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   840
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   841
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   842
 *LREAL_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   843
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   844
    case function_lreal_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   845
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   846
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   847
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   848
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   849
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   850
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   851
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   852
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   853
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   854
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   855
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   856
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   857
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   858
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   859
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   860
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   861
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   862
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   863
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   864
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   865
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   866
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   867
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   868
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   869
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   870
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   871
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   872
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   873
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   874
    }/*function_lreal_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   875
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   876
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   877
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   878
 *LREAL_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   879
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   880
    case function_lreal_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   881
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   882
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   883
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   884
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   885
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   886
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   887
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   888
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   889
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   890
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   891
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   892
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   893
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   894
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   895
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   896
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   897
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   898
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   899
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   900
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   901
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   902
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   903
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   904
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   905
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   906
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   907
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   908
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   909
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   910
    }/*function_lreal_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   911
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   912
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   913
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   914
 *LREAL_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   915
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   916
    case function_lreal_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   917
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   918
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   919
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   920
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   921
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   922
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   923
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   924
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   925
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   926
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   927
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   928
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   929
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   930
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   931
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   932
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   933
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   934
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   935
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   936
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   937
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   938
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   939
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   940
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   941
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   942
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   943
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   944
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   945
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   946
    }/*function_lreal_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   947
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   948
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   949
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   950
 *LREAL_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   951
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   952
    case function_lreal_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   953
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   954
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   955
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   956
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   957
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   958
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   959
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   960
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   961
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   962
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   963
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   964
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   965
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   966
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   967
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   968
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   969
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   970
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   971
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   972
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   973
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   974
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   975
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   976
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   977
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   978
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   979
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   980
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   981
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   982
    }/*function_lreal_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   983
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   984
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   985
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   986
 *LREAL_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   987
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   988
    case function_lreal_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   989
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   990
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   991
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   992
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   993
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   994
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   995
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   996
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   997
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   998
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
   999
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1000
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1001
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1002
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1003
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1004
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1005
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1006
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1007
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1008
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1009
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1010
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1011
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1012
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1013
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1014
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1015
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1016
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1017
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1018
    }/*function_lreal_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1019
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1020
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1021
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1022
 *LREAL_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1023
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1024
    case function_lreal_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1025
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1026
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1027
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1028
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1029
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1030
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1031
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1032
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1033
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1034
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1035
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1036
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1037
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1038
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1039
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1040
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1041
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1042
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1043
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1044
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1045
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1046
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1047
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1048
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1049
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1050
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1051
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1052
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1053
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1054
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1055
    }/*function_lreal_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1056
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1057
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1058
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1059
 *LREAL_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1060
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1061
    case function_lreal_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1062
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1063
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1064
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1065
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1066
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1067
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1068
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1069
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1070
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1071
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1072
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1073
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1074
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1075
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1076
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1077
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1078
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1079
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1080
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1081
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1082
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1083
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1084
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1085
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1086
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1087
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1088
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1089
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1090
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1091
    }/*function_lreal_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1092
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1093
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1094
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1095
 *LREAL_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1096
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1097
    case function_lreal_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1098
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1099
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1100
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1101
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1102
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1103
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1104
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1105
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1106
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1107
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1108
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1109
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1110
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1111
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1112
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1113
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1114
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1115
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1116
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1117
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1118
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1119
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1120
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1121
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1122
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1123
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1124
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1125
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1126
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1127
    }/*function_lreal_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1128
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1129
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1130
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1131
 *LREAL_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1132
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1133
    case function_lreal_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1134
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1135
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1136
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1137
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1138
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1139
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1140
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1141
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1142
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1143
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1144
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1145
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1146
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1147
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1148
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1149
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1150
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1151
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1152
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1153
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1154
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1155
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1156
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1157
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1158
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1159
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1160
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1161
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1162
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1163
    }/*function_lreal_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1164
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1165
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1166
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1167
 *LREAL_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1168
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1169
    case function_lreal_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1170
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1171
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1172
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1173
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1174
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1175
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1176
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1177
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1178
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1179
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1180
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1181
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1182
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1183
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1184
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1185
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1186
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1187
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1188
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1189
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1190
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1191
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1192
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1193
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1194
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1195
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1196
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1197
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1198
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1199
    }/*function_lreal_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1200
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1201
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1202
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1203
 *LREAL_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1204
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1205
    case function_lreal_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1206
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1207
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1208
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1209
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1210
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1211
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1212
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1213
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1214
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1215
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1216
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1217
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1218
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1219
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1220
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1221
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1222
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1223
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1224
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1225
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1226
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1227
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1228
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1229
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1230
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1231
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1232
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1233
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1234
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1235
    }/*function_lreal_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1236
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1237
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1238
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1239
 *LREAL_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1240
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1241
    case function_lreal_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1242
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1243
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1244
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1245
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1246
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1247
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1248
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1249
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1250
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1251
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1252
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1253
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1254
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1255
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1256
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1257
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1258
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1259
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1260
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1261
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1262
                s4o.print(")__real_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1263
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1264
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1265
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1266
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1267
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1268
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1269
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1270
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1271
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1272
    }/*function_lreal_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1273
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1274
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1275
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1276
 *LREAL_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1277
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1278
    case function_lreal_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1279
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1280
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1281
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1282
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1283
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1284
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1285
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1286
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1287
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1288
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1289
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1290
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1291
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1292
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1293
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1294
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1295
        
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1296
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1297
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1298
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1299
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1300
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1301
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1302
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1303
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1304
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1305
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1306
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1307
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1308
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1309
    }/*function_lreal_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1310
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1311
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1312
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1313
 *LREAL_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1314
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1315
    case function_lreal_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1316
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1317
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1318
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1319
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1320
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1321
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1322
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1323
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1324
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1325
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1326
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1327
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1328
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1329
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1330
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1331
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1332
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1333
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1334
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1335
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1336
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1337
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1338
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1339
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1340
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1341
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1342
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1343
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1344
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1345
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1346
    }/*function_lreal_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1347
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1348
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1349
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1350
 *LREAL_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1351
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1352
    case function_lreal_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1353
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1354
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1355
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1356
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1357
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1358
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1359
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1360
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1361
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1362
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1363
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1364
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1365
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1366
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1367
            if (typeid(*last_type_symbol) == typeid(lreal_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1368
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1369
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1370
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1371
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1372
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1373
                s4o.print(")__real_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1374
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1375
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1376
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1377
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1378
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1379
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1380
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1381
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1382
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1383
    }/*function_lreal_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1384
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1385
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1386
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1387
 *SINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1388
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1389
    case function_sint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1390
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1391
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1392
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1393
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1394
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1395
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1396
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1397
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1398
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1399
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1400
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1401
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1402
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1403
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1404
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1405
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1406
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1407
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1408
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1409
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1410
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1411
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1412
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1413
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1414
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1415
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1416
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1417
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  1418
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1419
    }/*function_sint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1420
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1421
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1422
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1423
 *SINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1424
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1425
    case function_sint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1426
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1427
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1428
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1429
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1430
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1431
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1432
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1433
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1434
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1435
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1436
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1437
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1438
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1439
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1440
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1441
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1442
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1443
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1444
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1445
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1446
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1447
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1448
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1449
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1450
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1451
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1452
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1453
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1454
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1455
    }/*function_sint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1456
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1457
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1458
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1459
 *SINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1460
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1461
    case function_sint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1462
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1463
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1464
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1465
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1466
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1467
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1468
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1469
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1470
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1471
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1472
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1473
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1474
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1475
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1476
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1477
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1478
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1479
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1480
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1481
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1482
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1483
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1484
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1485
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1486
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1487
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1488
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1489
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1490
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1491
    }/*function_sint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1492
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1493
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1494
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1495
 *SINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1496
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1497
    case function_sint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1498
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1499
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1500
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1501
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1502
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1503
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1504
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1505
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1506
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1507
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1508
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1509
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1510
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1511
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1512
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1513
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1514
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1515
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1516
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1517
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1518
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1519
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1520
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1521
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1522
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1523
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1524
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1525
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1526
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1527
    }/*function_sint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1528
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1529
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1530
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1531
 *SINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1532
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1533
    case function_sint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1534
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1535
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1536
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1537
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1538
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1539
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1540
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1541
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1542
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1543
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1544
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1545
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1546
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1547
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1548
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1549
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1550
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1551
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1552
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1553
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1554
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1555
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1556
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1557
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1558
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1559
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1560
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1561
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1562
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1563
    }/*function_sint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1564
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1565
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1566
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1567
 *SINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1568
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1569
    case function_sint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1570
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1571
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1572
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1573
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1574
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1575
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1576
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1577
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1578
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1579
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1580
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1581
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1582
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1583
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1584
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1585
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1586
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1587
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1588
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1589
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1590
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1591
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1592
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1593
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1594
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1595
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1596
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1597
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1598
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1599
    }/*function_sint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1600
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1601
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1602
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1603
 *SINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1604
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1605
    case function_sint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1606
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1607
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1608
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1609
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1610
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1611
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1612
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1613
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1614
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1615
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1616
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1617
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1618
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1619
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1620
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1621
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1622
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1623
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1624
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1625
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1626
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1627
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1628
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1629
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1630
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1631
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1632
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1633
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1634
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1635
    }/*function_sint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1636
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1637
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1638
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1639
 *SINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1640
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1641
    case function_sint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1642
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1643
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1644
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1645
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1646
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1647
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1648
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1649
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1650
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1651
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1652
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1653
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1654
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1655
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1656
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1657
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1658
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1659
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1660
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1661
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1662
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1663
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1664
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1665
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1666
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1667
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1668
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1669
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1670
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1671
    }/*function_sint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1672
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1673
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1674
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1675
 *SINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1676
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1677
    case function_sint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1678
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1679
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1680
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1681
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1682
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1683
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1684
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1685
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1686
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1687
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1688
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1689
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1690
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1691
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1692
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1693
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1694
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1695
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1696
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1697
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1698
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1699
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1700
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1701
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1702
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1703
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1704
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1705
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1706
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1707
    }/*function_sint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1708
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1709
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1710
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1711
 *SINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1712
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1713
    case function_sint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1714
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1715
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1716
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1717
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1718
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1719
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1720
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1721
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1722
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1723
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1724
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1725
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1726
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1727
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1728
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1729
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1730
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1731
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1732
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1733
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1734
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1735
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1736
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1737
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1738
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1739
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1740
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1741
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1742
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1743
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1744
    }/*function_sint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1745
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1746
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1747
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1748
 *SINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1749
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1750
    case function_sint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1751
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1752
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1753
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1754
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1755
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1756
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1757
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1758
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1759
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1760
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1761
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1762
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1763
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1764
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1765
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1766
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1767
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1768
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1769
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1770
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1771
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1772
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1773
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1774
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1775
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1776
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1777
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1778
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1779
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1780
    }/*function_sint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1781
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1782
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1783
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1784
 *SINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1785
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1786
    case function_sint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1787
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1788
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1789
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1790
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1791
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1792
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1793
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1794
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1795
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1796
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1797
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1798
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1799
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1800
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1801
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1802
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1803
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1804
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1805
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1806
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1807
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1808
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1809
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1810
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1811
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1812
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1813
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1814
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1815
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1816
    }/*function_sint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1817
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1818
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1819
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1820
 *SINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1821
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1822
    case function_sint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1823
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1824
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1825
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1826
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1827
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1828
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1829
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1830
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1831
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1832
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1833
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1834
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1835
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1836
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1837
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1838
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1839
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1840
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1841
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1842
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1843
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1844
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1845
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1846
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1847
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1848
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1849
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1850
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1851
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1852
    }/*function_sint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1853
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1854
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1855
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1856
 *SINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1857
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1858
    case function_sint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1859
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1860
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1861
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1862
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1863
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1864
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1865
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1866
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1867
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1868
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1869
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1870
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1871
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1872
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1873
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1874
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1875
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1876
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1877
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1878
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1879
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1880
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1881
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1882
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1883
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1884
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1885
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1886
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1887
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1888
    }/*function_sint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1889
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1890
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1891
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1892
 *SINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1893
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1894
    case function_sint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1895
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1896
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1897
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1898
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1899
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1900
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1901
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1902
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1903
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1904
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1905
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1906
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1907
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1908
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1909
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1910
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1911
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1912
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1913
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1914
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1915
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1916
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1917
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1918
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1919
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1920
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1921
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1922
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1923
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1924
    }/*function_sint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1925
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1926
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1927
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1928
 *SINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1929
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1930
    case function_sint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1931
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1932
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1933
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1934
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1935
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1936
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1937
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1938
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1939
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1940
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1941
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1942
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1943
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1944
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1945
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1946
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1947
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1948
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1949
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1950
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1951
                s4o.print(")__sint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1952
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1953
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1954
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1955
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1956
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1957
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1958
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1959
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1960
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1961
    }/*function_sint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1962
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1963
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1964
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1965
 *SINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1966
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1967
    case function_sint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1968
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1969
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1970
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1971
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1972
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1973
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1974
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1975
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1976
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1977
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1978
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1979
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1980
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1981
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1982
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1983
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1984
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1985
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1986
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1987
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1988
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1989
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1990
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1991
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1992
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1993
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1994
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1995
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1996
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1997
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1998
    }/*function_sint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  1999
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2000
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2001
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2002
 *SINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2003
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2004
    case function_sint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2005
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2006
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2007
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2008
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2009
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2010
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2011
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2012
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2013
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2014
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2015
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2016
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2017
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2018
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2019
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2020
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2021
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2022
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2023
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2024
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2025
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2026
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2027
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2028
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2029
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2030
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2031
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2032
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2033
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2034
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2035
    }/*function_sint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2036
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2037
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2038
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2039
 *SINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2040
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2041
    case function_sint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2042
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2043
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2044
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2045
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2046
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2047
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2048
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2049
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2050
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2051
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2052
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2053
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2054
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2055
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2056
            if (typeid(*last_type_symbol) == typeid(sint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2057
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2058
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2059
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2060
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2061
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2062
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2063
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2064
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2065
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2066
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2067
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2068
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2069
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2070
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2071
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2072
    }/*function_sint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2073
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2074
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2075
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2076
 *INT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2077
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2078
    case function_int_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2079
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2080
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2081
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2082
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2083
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2084
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2085
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2086
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2087
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2088
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2089
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2090
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2091
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2092
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2093
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2094
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2095
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2096
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2097
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2098
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2099
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2100
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2101
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2102
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2103
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2104
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2105
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2106
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2107
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2108
    }/*function_int_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2109
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2110
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2111
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2112
 *INT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2113
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2114
    case function_int_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2115
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2116
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2117
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2118
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2119
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2120
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2121
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2122
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2123
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2124
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2125
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2126
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2127
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2128
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2129
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2130
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2131
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2132
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2133
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2134
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2135
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2136
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2137
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2138
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2139
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2140
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2141
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2142
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2143
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2144
    }/*function_int_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2145
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2146
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2147
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2148
 *INT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2149
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2150
    case function_int_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2151
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2152
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2153
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2154
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2155
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2156
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2157
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2158
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2159
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2160
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2161
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2162
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2163
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2164
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2165
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2166
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2167
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2168
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2169
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2170
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2171
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2172
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2173
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2174
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2175
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2176
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2177
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2178
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2179
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2180
    }/*function_int_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2181
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2182
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2183
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2184
 *INT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2185
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2186
    case function_int_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2187
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2188
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2189
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2190
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2191
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2192
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2193
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2194
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2195
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2196
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2197
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2198
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2199
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2200
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2201
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2202
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2203
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2204
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2205
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2206
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2207
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2208
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2209
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2210
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2211
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2212
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2213
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2214
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2215
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2216
    }/*function_int_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2217
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2218
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2219
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2220
 *INT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2221
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2222
    case function_int_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2223
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2224
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2225
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2226
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2227
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2228
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2229
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2230
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2231
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2232
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2233
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2234
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2235
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2236
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2237
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2238
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2239
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2240
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2241
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2242
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2243
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2244
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2245
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2246
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2247
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2248
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2249
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2250
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2251
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2252
    }/*function_int_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2253
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2254
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2255
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2256
 *INT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2257
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2258
    case function_int_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2259
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2260
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2261
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2262
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2263
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2264
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2265
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2266
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2267
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2268
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2269
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2270
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2271
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2272
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2273
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2274
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2275
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2276
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2277
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2278
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2279
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2280
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2281
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2282
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2283
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2284
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2285
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2286
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2287
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2288
    }/*function_int_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2289
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2290
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2291
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2292
 *INT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2293
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2294
    case function_int_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2295
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2296
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2297
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2298
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2299
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2300
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2301
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2302
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2303
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2304
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2305
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2306
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2307
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2308
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2309
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2310
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2311
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2312
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2313
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2314
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2315
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2316
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2317
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2318
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2319
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2320
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2321
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2322
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2323
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2324
    }/*function_int_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2325
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2326
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2327
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2328
 *INT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2329
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2330
    case function_int_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2331
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2332
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2333
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2334
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2335
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2336
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2337
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2338
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2339
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2340
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2341
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2342
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2343
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2344
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2345
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2346
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2347
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2348
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2349
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2350
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2351
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2352
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2353
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2354
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2355
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2356
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2357
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2358
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2359
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2360
    }/*function_int_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2361
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2362
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2363
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2364
 *INT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2365
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2366
    case function_int_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2367
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2368
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2369
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2370
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2371
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2372
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2373
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2374
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2375
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2376
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2377
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2378
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2379
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2380
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2381
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2382
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2383
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2384
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2385
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2386
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2387
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2388
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2389
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2390
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2391
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2392
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2393
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2394
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2395
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2396
    }/*function_int_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2397
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2398
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2399
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2400
 *INT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2401
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2402
    case function_int_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2403
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2404
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2405
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2406
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2407
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2408
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2409
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2410
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2411
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2412
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2413
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2414
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2415
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2416
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2417
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2418
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2419
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2420
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2421
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2422
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2423
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2424
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2425
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2426
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2427
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2428
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2429
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2430
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2431
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2432
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2433
    }/*function_int_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2434
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2435
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2436
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2437
 *INT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2438
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2439
    case function_int_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2440
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2441
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2442
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2443
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2444
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2445
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2446
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2447
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2448
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2449
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2450
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2451
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2452
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2453
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2454
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2455
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2456
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2457
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2458
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2459
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2460
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2461
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2462
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2463
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2464
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2465
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2466
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2467
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2468
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2469
    }/*function_int_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2470
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2471
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2472
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2473
 *INT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2474
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2475
    case function_int_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2476
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2477
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2478
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2479
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2480
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2481
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2482
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2483
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2484
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2485
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2486
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2487
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2488
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2489
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2490
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2491
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2492
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2493
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2494
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2495
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2496
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2497
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2498
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2499
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2500
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2501
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2502
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2503
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2504
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2505
    }/*function_int_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2506
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2507
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2508
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2509
 *INT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2510
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2511
    case function_int_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2512
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2513
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2514
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2515
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2516
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2517
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2518
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2519
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2520
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2521
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2522
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2523
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2524
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2525
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2526
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2527
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2528
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2529
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2530
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2531
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2532
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2533
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2534
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2535
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2536
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2537
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2538
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2539
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2540
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2541
    }/*function_int_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2542
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2543
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2544
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2545
 *INT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2546
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2547
    case function_int_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2548
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2549
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2550
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2551
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2552
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2553
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2554
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2555
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2556
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2557
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2558
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2559
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2560
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2561
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2562
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2563
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2564
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2565
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2566
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2567
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2568
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2569
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2570
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2571
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2572
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2573
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2574
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2575
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2576
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2577
    }/*function_int_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2578
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2579
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2580
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2581
 *INT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2582
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2583
    case function_int_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2584
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2585
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2586
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2587
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2588
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2589
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2590
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2591
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2592
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2593
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2594
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2595
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2596
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2597
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2598
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2599
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2600
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2601
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2602
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2603
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2604
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2605
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2606
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2607
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2608
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2609
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2610
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2611
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2612
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2613
    }/*function_int_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2614
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2615
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2616
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2617
 *INT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2618
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2619
    case function_int_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2620
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2621
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2622
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2623
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2624
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2625
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2626
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2627
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2628
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2629
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2630
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2631
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2632
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2633
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2634
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2635
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2636
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2637
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2638
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2639
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2640
                s4o.print(")__sint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2641
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2642
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2643
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2644
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2645
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2646
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2647
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2648
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2649
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2650
    }/*function_int_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2651
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2652
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2653
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2654
 *INT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2655
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2656
    case function_int_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2657
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2658
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2659
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2660
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2661
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2662
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2663
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2664
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2665
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2666
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2667
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2668
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2669
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2670
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2671
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2672
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2673
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2674
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2675
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2676
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2677
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2678
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2679
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2680
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2681
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2682
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2683
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2684
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2685
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2686
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2687
    }/*function_int_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2688
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2689
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2690
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2691
 *INT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2692
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2693
    case function_int_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2694
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2695
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2696
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2697
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2698
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2699
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2700
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2701
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2702
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2703
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2704
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2705
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2706
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2707
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2708
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2709
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2710
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2711
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2712
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2713
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2714
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2715
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2716
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2717
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2718
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2719
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2720
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2721
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2722
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2723
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2724
    }/*function_int_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2725
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2726
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2727
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2728
 *INT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2729
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2730
    case function_int_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2731
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2732
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2733
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2734
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2735
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2736
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2737
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2738
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2739
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2740
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2741
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2742
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2743
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2744
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2745
            if (typeid(*last_type_symbol) == typeid(int_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2746
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2747
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2748
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2749
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2750
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2751
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2752
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2753
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2754
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2755
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2756
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2757
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2758
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2759
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2760
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2761
    }/*function_int_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2762
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2763
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2764
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2765
 *DINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2766
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2767
    case function_dint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2768
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2769
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2770
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2771
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2772
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2773
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2774
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2775
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2776
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2777
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2778
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2779
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2780
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2781
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2782
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2783
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2784
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2785
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2786
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2787
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2788
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2789
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2790
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2791
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2792
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2793
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2794
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2795
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2796
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2797
    }/*function_dint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2798
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2799
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2800
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2801
 *DINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2802
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2803
    case function_dint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2804
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2805
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2806
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2807
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2808
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2809
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2810
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2811
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2812
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2813
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2814
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2815
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2816
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2817
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2818
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2819
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2820
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2821
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2822
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2823
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2824
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2825
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2826
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2827
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2828
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2829
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2830
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2831
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2832
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2833
    }/*function_dint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2834
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2835
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2836
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2837
 *DINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2838
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2839
    case function_dint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2840
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2841
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2842
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2843
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2844
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2845
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2846
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2847
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2848
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2849
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2850
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2851
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2852
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2853
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2854
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2855
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2856
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2857
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2858
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2859
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2860
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2861
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2862
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2863
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2864
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2865
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2866
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2867
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2868
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2869
    }/*function_dint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2870
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2871
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2872
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2873
 *DINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2874
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2875
    case function_dint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2876
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2877
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2878
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2879
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2880
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2881
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2882
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2883
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2884
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2885
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2886
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2887
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2888
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2889
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2890
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2891
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2892
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2893
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2894
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2895
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2896
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2897
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2898
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2899
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2900
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2901
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2902
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2903
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  2904
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2905
    }/*function_dint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2906
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2907
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2908
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2909
 *DINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2910
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2911
    case function_dint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2912
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2913
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2914
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2915
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2916
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2917
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2918
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2919
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2920
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2921
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2922
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2923
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2924
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2925
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2926
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2927
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2928
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2929
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2930
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2931
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2932
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2933
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2934
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2935
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2936
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2937
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2938
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2939
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2940
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2941
    }/*function_dint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2942
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2943
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2944
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2945
 *DINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2946
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2947
    case function_dint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2948
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2949
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2950
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2951
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2952
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2953
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2954
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2955
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2956
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2957
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2958
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2959
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2960
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2961
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2962
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2963
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2964
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2965
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2966
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2967
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2968
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2969
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2970
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2971
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2972
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2973
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2974
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2975
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2976
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2977
    }/*function_dint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2978
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2979
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2980
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2981
 *DINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2982
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2983
    case function_dint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2984
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2985
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2986
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2987
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2988
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2989
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2990
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2991
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2992
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2993
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2994
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2995
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2996
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2997
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2998
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  2999
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3000
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3001
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3002
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3003
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3004
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3005
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3006
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3007
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3008
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3009
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3010
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3011
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3012
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3013
    }/*function_dint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3014
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3015
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3016
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3017
 *DINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3018
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3019
    case function_dint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3020
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3021
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3022
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3023
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3024
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3025
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3026
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3027
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3028
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3029
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3030
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3031
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3032
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3033
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3034
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3035
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3036
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3037
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3038
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3039
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3040
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3041
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3042
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3043
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3044
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3045
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3046
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3047
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3048
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3049
    }/*function_dint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3050
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3051
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3052
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3053
 *DINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3054
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3055
    case function_dint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3056
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3057
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3058
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3059
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3060
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3061
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3062
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3063
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3064
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3065
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3066
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3067
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3068
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3069
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3070
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3071
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3072
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3073
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3074
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3075
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3076
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3077
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3078
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3079
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3080
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3081
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3082
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3083
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3084
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3085
    }/*function_dint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3086
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3087
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3088
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3089
 *DINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3090
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3091
    case function_dint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3092
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3093
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3094
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3095
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3096
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3097
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3098
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3099
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3100
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3101
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3102
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3103
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3104
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3105
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3106
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3107
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3108
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3109
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3110
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3111
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3112
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3113
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3114
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3115
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3116
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3117
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3118
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3119
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3120
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3121
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3122
    }/*function_dint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3123
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3124
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3125
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3126
 *DINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3127
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3128
    case function_dint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3129
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3130
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3131
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3132
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3133
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3134
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3135
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3136
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3137
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3138
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3139
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3140
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3141
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3142
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3143
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3144
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3145
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3146
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3147
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3148
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3149
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3150
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3151
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3152
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3153
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3154
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3155
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3156
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3157
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3158
    }/*function_dint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3159
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3160
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3161
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3162
 *DINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3163
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3164
    case function_dint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3165
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3166
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3167
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3168
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3169
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3170
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3171
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3172
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3173
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3174
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3175
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3176
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3177
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3178
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3179
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3180
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3181
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3182
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3183
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3184
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3185
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3186
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3187
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3188
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3189
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3190
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3191
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3192
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3193
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3194
    }/*function_dint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3195
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3196
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3197
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3198
 *DINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3199
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3200
    case function_dint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3201
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3202
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3203
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3204
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3205
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3206
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3207
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3208
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3209
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3210
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3211
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3212
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3213
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3214
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3215
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3216
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3217
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3218
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3219
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3220
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3221
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3222
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3223
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3224
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3225
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3226
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3227
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3228
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3229
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3230
    }/*function_dint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3231
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3232
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3233
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3234
 *DINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3235
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3236
    case function_dint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3237
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3238
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3239
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3240
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3241
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3242
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3243
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3244
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3245
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3246
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3247
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3248
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3249
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3250
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3251
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3252
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3253
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3254
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3255
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3256
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3257
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3258
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3259
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3260
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3261
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3262
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3263
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3264
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3265
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3266
    }/*function_dint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3267
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3268
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3269
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3270
 *DINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3271
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3272
    case function_dint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3273
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3274
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3275
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3276
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3277
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3278
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3279
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3280
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3281
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3282
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3283
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3284
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3285
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3286
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3287
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3288
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3289
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3290
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3291
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3292
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3293
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3294
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3295
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3296
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3297
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3298
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3299
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3300
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3301
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3302
    }/*function_dint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3303
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3304
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3305
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3306
 *DINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3307
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3308
    case function_dint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3309
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3310
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3311
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3312
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3313
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3314
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3315
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3316
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3317
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3318
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3319
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3320
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3321
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3322
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3323
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3324
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3325
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3326
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3327
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3328
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3329
                s4o.print(")__sint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3330
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3331
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3332
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3333
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3334
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3335
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3336
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3337
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3338
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3339
    }/*function_dint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3340
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3341
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3342
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3343
 *DINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3344
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3345
    case function_dint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3346
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3347
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3348
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3349
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3350
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3351
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3352
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3353
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3354
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3355
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3356
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3357
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3358
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3359
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3360
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3361
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3362
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3363
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3364
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3365
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3366
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3367
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3368
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3369
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3370
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3371
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3372
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3373
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3374
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3375
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3376
    }/*function_dint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3377
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3378
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3379
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3380
 *DINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3381
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3382
    case function_dint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3383
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3384
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3385
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3386
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3387
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3388
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3389
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3390
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3391
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3392
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3393
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3394
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3395
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3396
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3397
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3398
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3399
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3400
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3401
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3402
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3403
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3404
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3405
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3406
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3407
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3408
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3409
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3410
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3411
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3412
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3413
    }/*function_dint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3414
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3415
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3416
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3417
 *DINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3418
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3419
    case function_dint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3420
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3421
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3422
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3423
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3424
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3425
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3426
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3427
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3428
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3429
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3430
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3431
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3432
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3433
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3434
            if (typeid(*last_type_symbol) == typeid(dint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3435
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3436
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3437
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3438
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3439
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3440
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3441
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3442
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3443
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3444
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3445
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3446
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3447
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3448
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3449
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3450
    }/*function_dint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3451
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3452
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3453
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3454
 *LINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3455
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3456
    case function_lint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3457
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3458
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3459
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3460
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3461
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3462
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3463
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3464
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3465
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3466
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3467
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3468
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3469
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3470
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3471
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3472
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3473
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3474
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3475
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3476
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3477
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3478
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3479
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3480
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3481
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3482
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3483
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3484
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3485
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3486
    }/*function_lint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3487
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3488
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3489
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3490
 *LINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3491
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3492
    case function_lint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3493
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3494
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3495
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3496
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3497
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3498
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3499
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3500
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3501
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3502
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3503
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3504
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3505
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3506
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3507
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3508
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3509
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3510
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3511
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3512
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3513
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3514
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3515
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3516
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3517
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3518
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3519
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3520
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3521
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3522
    }/*function_lint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3523
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3524
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3525
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3526
 *LINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3527
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3528
    case function_lint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3529
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3530
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3531
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3532
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3533
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3534
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3535
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3536
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3537
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3538
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3539
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3540
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3541
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3542
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3543
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3544
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3545
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3546
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3547
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3548
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3549
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3550
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3551
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3552
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3553
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3554
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3555
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3556
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3557
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3558
    }/*function_lint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3559
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3560
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3561
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3562
 *LINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3563
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3564
    case function_lint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3565
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3566
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3567
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3568
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3569
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3570
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3571
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3572
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3573
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3574
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3575
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3576
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3577
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3578
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3579
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3580
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3581
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3582
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3583
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3584
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3585
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3586
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3587
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3588
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3589
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3590
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3591
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3592
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3593
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3594
    }/*function_lint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3595
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3596
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3597
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3598
 *LINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3599
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3600
    case function_lint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3601
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3602
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3603
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3604
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3605
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3606
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3607
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3608
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3609
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3610
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3611
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3612
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3613
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3614
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3615
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3616
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3617
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3618
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3619
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3620
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3621
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3622
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3623
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3624
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3625
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3626
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3627
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3628
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  3629
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3630
    }/*function_lint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3631
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3632
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3633
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3634
 *LINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3635
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3636
    case function_lint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3637
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3638
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3639
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3640
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3641
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3642
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3643
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3644
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3645
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3646
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3647
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3648
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3649
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3650
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3651
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3652
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3653
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3654
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3655
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3656
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3657
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3658
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3659
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3660
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3661
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3662
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3663
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3664
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3665
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3666
    }/*function_lint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3667
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3668
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3669
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3670
 *LINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3671
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3672
    case function_lint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3673
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3674
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3675
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3676
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3677
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3678
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3679
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3680
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3681
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3682
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3683
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3684
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3685
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3686
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3687
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3688
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3689
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3690
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3691
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3692
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3693
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3694
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3695
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3696
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3697
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3698
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3699
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3700
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3701
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3702
    }/*function_lint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3703
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3704
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3705
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3706
 *LINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3707
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3708
    case function_lint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3709
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3710
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3711
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3712
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3713
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3714
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3715
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3716
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3717
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3718
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3719
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3720
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3721
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3722
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3723
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3724
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3725
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3726
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3727
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3728
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3729
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3730
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3731
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3732
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3733
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3734
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3735
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3736
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3737
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3738
    }/*function_lint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3739
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3740
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3741
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3742
 *LINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3743
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3744
    case function_lint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3745
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3746
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3747
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3748
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3749
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3750
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3751
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3752
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3753
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3754
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3755
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3756
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3757
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3758
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3759
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3760
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3761
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3762
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3763
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3764
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3765
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3766
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3767
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3768
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3769
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3770
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3771
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3772
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3773
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3774
    }/*function_lint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3775
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3776
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3777
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3778
 *LINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3779
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3780
    case function_lint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3781
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3782
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3783
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3784
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3785
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3786
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3787
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3788
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3789
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3790
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3791
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3792
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3793
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3794
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3795
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3796
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3797
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3798
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3799
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3800
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3801
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3802
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3803
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3804
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3805
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3806
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3807
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3808
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3809
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3810
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3811
    }/*function_lint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3812
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3813
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3814
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3815
 *LINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3816
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3817
    case function_lint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3818
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3819
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3820
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3821
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3822
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3823
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3824
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3825
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3826
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3827
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3828
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3829
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3830
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3831
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3832
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3833
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3834
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3835
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3836
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3837
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3838
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3839
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3840
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3841
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3842
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3843
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3844
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3845
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3846
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3847
    }/*function_lint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3848
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3849
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3850
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3851
 *LINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3852
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3853
    case function_lint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3854
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3855
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3856
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3857
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3858
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3859
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3860
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3861
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3862
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3863
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3864
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3865
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3866
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3867
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3868
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3869
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3870
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3871
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3872
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3873
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3874
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3875
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3876
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3877
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3878
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3879
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3880
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3881
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3882
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3883
    }/*function_lint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3884
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3885
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3886
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3887
 *LINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3888
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3889
    case function_lint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3890
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3891
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3892
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3893
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3894
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3895
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3896
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3897
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3898
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3899
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3900
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3901
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3902
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3903
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3904
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3905
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3906
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3907
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3908
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3909
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3910
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3911
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3912
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3913
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3914
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3915
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3916
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3917
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3918
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3919
    }/*function_lint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3920
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3921
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3922
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3923
 *LINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3924
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3925
    case function_lint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3926
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3927
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3928
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3929
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3930
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3931
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3932
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3933
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3934
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3935
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3936
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3937
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3938
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3939
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3940
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3941
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3942
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3943
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3944
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3945
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3946
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3947
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3948
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3949
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3950
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3951
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3952
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3953
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3954
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3955
    }/*function_lint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3956
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3957
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3958
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3959
 *LINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3960
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3961
    case function_lint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3962
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3963
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3964
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3965
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3966
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3967
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3968
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3969
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3970
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3971
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3972
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3973
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3974
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3975
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3976
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3977
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3978
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3979
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3980
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3981
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3982
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3983
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3984
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3985
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3986
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3987
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3988
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3989
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3990
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3991
    }/*function_lint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3992
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3993
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3994
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3995
 *LINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3996
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3997
    case function_lint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3998
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  3999
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4000
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4001
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4002
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4003
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4004
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4005
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4006
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4007
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4008
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4009
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4010
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4011
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4012
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4013
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4014
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4015
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4016
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4017
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4018
                s4o.print(")__sint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4019
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4020
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4021
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4022
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4023
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4024
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4025
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4026
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4027
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4028
    }/*function_lint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4029
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4030
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4031
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4032
 *LINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4033
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4034
    case function_lint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4035
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4036
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4037
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4038
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4039
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4040
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4041
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4042
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4043
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4044
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4045
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4046
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4047
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4048
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4049
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4050
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4051
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4052
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4053
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4054
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4055
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4056
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4057
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4058
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4059
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4060
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4061
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4062
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4063
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4064
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4065
    }/*function_lint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4066
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4067
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4068
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4069
 *LINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4070
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4071
    case function_lint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4072
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4073
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4074
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4075
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4076
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4077
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4078
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4079
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4080
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4081
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4082
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4083
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4084
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4085
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4086
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4087
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4088
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4089
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4090
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4091
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4092
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4093
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4094
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4095
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4096
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4097
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4098
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4099
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4100
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4101
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4102
    }/*function_lint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4103
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4104
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4105
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4106
 *LINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4107
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4108
    case function_lint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4109
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4110
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4111
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4112
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4113
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4114
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4115
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4116
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4117
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4118
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4119
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4120
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4121
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4122
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4123
            if (typeid(*last_type_symbol) == typeid(lint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4124
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4125
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4126
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4127
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4128
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4129
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4130
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4131
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4132
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4133
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4134
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4135
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4136
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4137
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4138
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4139
    }/*function_lint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4140
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4141
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4142
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4143
 *USINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4144
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4145
    case function_usint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4146
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4147
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4148
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4149
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4150
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4151
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4152
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4153
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4154
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4155
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4156
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4157
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4158
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4159
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4160
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4161
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4162
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4163
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4164
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4165
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4166
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4167
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4168
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4169
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4170
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4171
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4172
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4173
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4174
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4175
    }/*function_usint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4176
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4177
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4178
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4179
 *USINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4180
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4181
    case function_usint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4182
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4183
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4184
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4185
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4186
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4187
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4188
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4189
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4190
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4191
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4192
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4193
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4194
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4195
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4196
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4197
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4198
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4199
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4200
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4201
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4202
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4203
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4204
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4205
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4206
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4207
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4208
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4209
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4210
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4211
    }/*function_usint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4212
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4213
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4214
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4215
 *USINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4216
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4217
    case function_usint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4218
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4219
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4220
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4221
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4222
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4223
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4224
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4225
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4226
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4227
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4228
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4229
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4230
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4231
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4232
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4233
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4234
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4235
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4236
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4237
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4238
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4239
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4240
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4241
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4242
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4243
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4244
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4245
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4246
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4247
    }/*function_usint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4248
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4249
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4250
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4251
 *USINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4252
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4253
    case function_usint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4254
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4255
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4256
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4257
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4258
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4259
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4260
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4261
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4262
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4263
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4264
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4265
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4266
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4267
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4268
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4269
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4270
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4271
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4272
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4273
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4274
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4275
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4276
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4277
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4278
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4279
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4280
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4281
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4282
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4283
    }/*function_usint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4284
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4285
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4286
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4287
 *USINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4288
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4289
    case function_usint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4290
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4291
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4292
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4293
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4294
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4295
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4296
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4297
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4298
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4299
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4300
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4301
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4302
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4303
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4304
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4305
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4306
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4307
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4308
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4309
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4310
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4311
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4312
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4313
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4314
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4315
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4316
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4317
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4318
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4319
    }/*function_usint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4320
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4321
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4322
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4323
 *USINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4324
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4325
    case function_usint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4326
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4327
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4328
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4329
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4330
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4331
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4332
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4333
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4334
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4335
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4336
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4337
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4338
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4339
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4340
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4341
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4342
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4343
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4344
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4345
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4346
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4347
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4348
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4349
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4350
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4351
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4352
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4353
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  4354
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4355
    }/*function_usint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4356
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4357
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4358
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4359
 *USINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4360
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4361
    case function_usint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4362
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4363
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4364
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4365
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4366
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4367
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4368
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4369
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4370
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4371
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4372
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4373
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4374
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4375
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4376
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4377
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4378
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4379
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4380
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4381
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4382
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4383
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4384
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4385
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4386
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4387
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4388
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4389
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4390
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4391
    }/*function_usint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4392
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4393
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4394
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4395
 *USINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4396
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4397
    case function_usint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4398
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4399
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4400
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4401
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4402
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4403
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4404
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4405
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4406
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4407
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4408
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4409
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4410
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4411
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4412
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4413
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4414
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4415
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4416
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4417
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4418
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4419
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4420
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4421
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4422
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4423
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4424
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4425
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4426
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4427
    }/*function_usint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4428
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4429
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4430
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4431
 *USINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4432
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4433
    case function_usint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4434
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4435
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4436
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4437
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4438
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4439
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4440
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4441
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4442
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4443
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4444
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4445
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4446
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4447
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4448
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4449
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4450
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4451
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4452
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4453
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4454
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4455
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4456
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4457
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4458
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4459
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4460
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4461
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4462
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4463
    }/*function_usint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4464
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4465
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4466
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4467
 *USINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4468
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4469
    case function_usint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4470
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4471
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4472
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4473
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4474
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4475
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4476
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4477
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4478
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4479
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4480
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4481
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4482
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4483
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4484
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4485
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4486
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4487
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4488
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4489
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4490
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4491
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4492
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4493
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4494
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4495
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4496
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4497
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4498
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4499
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4500
    }/*function_usint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4501
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4502
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4503
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4504
 *USINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4505
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4506
    case function_usint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4507
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4508
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4509
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4510
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4511
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4512
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4513
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4514
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4515
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4516
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4517
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4518
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4519
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4520
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4521
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4522
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4523
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4524
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4525
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4526
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4527
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4528
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4529
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4530
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4531
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4532
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4533
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4534
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4535
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4536
    }/*function_usint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4537
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4538
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4539
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4540
 *USINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4541
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4542
    case function_usint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4543
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4544
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4545
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4546
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4547
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4548
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4549
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4550
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4551
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4552
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4553
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4554
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4555
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4556
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4557
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4558
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4559
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4560
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4561
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4562
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4563
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4564
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4565
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4566
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4567
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4568
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4569
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4570
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4571
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4572
    }/*function_usint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4573
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4574
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4575
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4576
 *USINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4577
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4578
    case function_usint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4579
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4580
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4581
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4582
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4583
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4584
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4585
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4586
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4587
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4588
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4589
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4590
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4591
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4592
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4593
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4594
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4595
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4596
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4597
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4598
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4599
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4600
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4601
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4602
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4603
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4604
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4605
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4606
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4607
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4608
    }/*function_usint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4609
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4610
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4611
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4612
 *USINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4613
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4614
    case function_usint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4615
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4616
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4617
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4618
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4619
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4620
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4621
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4622
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4623
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4624
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4625
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4626
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4627
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4628
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4629
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4630
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4631
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4632
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4633
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4634
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4635
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4636
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4637
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4638
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4639
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4640
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4641
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4642
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4643
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4644
    }/*function_usint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4645
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4646
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4647
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4648
 *USINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4649
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4650
    case function_usint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4651
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4652
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4653
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4654
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4655
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4656
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4657
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4658
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4659
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4660
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4661
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4662
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4663
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4664
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4665
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4666
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4667
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4668
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4669
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4670
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4671
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4672
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4673
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4674
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4675
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4676
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4677
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4678
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4679
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4680
    }/*function_usint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4681
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4682
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4683
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4684
 *USINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4685
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4686
    case function_usint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4687
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4688
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4689
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4690
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4691
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4692
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4693
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4694
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4695
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4696
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4697
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4698
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4699
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4700
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4701
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4702
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4703
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4704
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4705
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4706
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4707
                s4o.print(")__uint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4708
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4709
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4710
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4711
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4712
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4713
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4714
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4715
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4716
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4717
    }/*function_usint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4718
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4719
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4720
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4721
 *USINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4722
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4723
    case function_usint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4724
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4725
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4726
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4727
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4728
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4729
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4730
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4731
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4732
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4733
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4734
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4735
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4736
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4737
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4738
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4739
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4740
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4741
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4742
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4743
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4744
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4745
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4746
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4747
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4748
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4749
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4750
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4751
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4752
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4753
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4754
    }/*function_usint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4755
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4756
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4757
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4758
 *USINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4759
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4760
    case function_usint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4761
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4762
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4763
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4764
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4765
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4766
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4767
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4768
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4769
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4770
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4771
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4772
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4773
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4774
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4775
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4776
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4777
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4778
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4779
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4780
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4781
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4782
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4783
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4784
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4785
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4786
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4787
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4788
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4789
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4790
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4791
    }/*function_usint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4792
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4793
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4794
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4795
 *USINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4796
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4797
    case function_usint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4798
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4799
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4800
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4801
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4802
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4803
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4804
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4805
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4806
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4807
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4808
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4809
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4810
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4811
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4812
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4813
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4814
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4815
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4816
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4817
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4818
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4819
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4820
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4821
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4822
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4823
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4824
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4825
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4826
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4827
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4828
    }/*function_usint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4829
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4830
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4831
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4832
 *UINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4833
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4834
    case function_uint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4835
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4836
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4837
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4838
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4839
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4840
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4841
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4842
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4843
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4844
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4845
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4846
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4847
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4848
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4849
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4850
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4851
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4852
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4853
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4854
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4855
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4856
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4857
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4858
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4859
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4860
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4861
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4862
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4863
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4864
    }/*function_uint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4865
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4866
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4867
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4868
 *UINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4869
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4870
    case function_uint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4871
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4872
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4873
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4874
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4875
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4876
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4877
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4878
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4879
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4880
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4881
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4882
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4883
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4884
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4885
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4886
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4887
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4888
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4889
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4890
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4891
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4892
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4893
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4894
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4895
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4896
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4897
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4898
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4899
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4900
    }/*function_uint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4901
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4902
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4903
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4904
 *UINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4905
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4906
    case function_uint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4907
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4908
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4909
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4910
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4911
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4912
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4913
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4914
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4915
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4916
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4917
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4918
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4919
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4920
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4921
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4922
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4923
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4924
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4925
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4926
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4927
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4928
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4929
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4930
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4931
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4932
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4933
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4934
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4935
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4936
    }/*function_uint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4937
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4938
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4939
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4940
 *UINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4941
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4942
    case function_uint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4943
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4944
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4945
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4946
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4947
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4948
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4949
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4950
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4951
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4952
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4953
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4954
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4955
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4956
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4957
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4958
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4959
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4960
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4961
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4962
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4963
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4964
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4965
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4966
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4967
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4968
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4969
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4970
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4971
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4972
    }/*function_uint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4973
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4974
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4975
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4976
 *UINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4977
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4978
    case function_uint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4979
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4980
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4981
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4982
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4983
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4984
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4985
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4986
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4987
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4988
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4989
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4990
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4991
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4992
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4993
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4994
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4995
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4996
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4997
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4998
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  4999
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5000
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5001
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5002
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5003
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5004
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5005
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5006
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5007
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5008
    }/*function_uint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5009
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5010
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5011
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5012
 *UINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5013
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5014
    case function_uint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5015
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5016
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5017
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5018
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5019
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5020
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5021
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5022
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5023
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5024
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5025
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5026
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5027
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5028
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5029
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5030
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5031
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5032
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5033
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5034
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5035
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5036
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5037
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5038
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5039
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5040
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5041
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5042
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5043
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5044
    }/*function_uint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5045
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5046
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5047
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5048
 *UINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5049
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5050
    case function_uint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5051
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5052
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5053
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5054
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5055
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5056
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5057
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5058
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5059
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5060
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5061
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5062
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5063
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5064
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5065
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5066
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5067
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5068
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5069
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5070
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5071
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5072
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5073
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5074
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5075
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5076
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5077
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5078
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5079
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5080
    }/*function_uint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5081
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5082
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5083
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5084
 *UINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5085
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5086
    case function_uint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5087
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5088
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5089
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5090
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5091
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5092
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5093
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5094
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5095
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5096
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5097
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5098
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5099
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5100
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5101
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5102
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5103
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5104
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5105
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5106
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5107
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5108
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5109
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5110
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5111
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5112
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5113
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5114
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5115
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5116
    }/*function_uint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5117
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5118
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5119
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5120
 *UINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5121
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5122
    case function_uint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5123
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5124
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5125
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5126
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5127
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5128
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5129
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5130
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5131
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5132
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5133
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5134
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5135
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5136
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5137
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5138
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5139
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5140
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5141
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5142
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5143
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5144
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5145
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5146
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5147
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5148
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5149
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5150
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5151
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5152
    }/*function_uint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5153
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5154
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5155
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5156
 *UINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5157
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5158
    case function_uint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5159
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5160
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5161
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5162
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5163
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5164
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5165
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5166
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5167
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5168
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5169
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5170
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5171
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5172
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5173
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5174
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5175
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5176
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5177
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5178
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5179
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5180
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5181
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5182
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5183
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5184
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5185
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5186
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5187
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5188
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5189
    }/*function_uint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5190
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5191
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5192
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5193
 *UINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5194
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5195
    case function_uint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5196
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5197
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5198
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5199
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5200
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5201
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5202
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5203
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5204
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5205
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5206
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5207
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5208
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5209
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5210
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5211
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5212
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5213
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5214
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5215
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5216
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5217
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5218
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5219
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5220
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5221
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5222
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5223
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5224
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5225
    }/*function_uint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5226
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5227
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5228
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5229
 *UINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5230
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5231
    case function_uint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5232
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5233
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5234
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5235
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5236
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5237
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5238
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5239
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5240
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5241
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5242
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5243
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5244
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5245
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5246
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5247
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5248
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5249
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5250
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5251
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5252
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5253
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5254
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5255
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5256
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5257
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5258
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5259
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5260
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5261
    }/*function_uint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5262
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5263
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5264
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5265
 *UINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5266
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5267
    case function_uint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5268
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5269
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5270
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5271
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5272
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5273
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5274
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5275
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5276
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5277
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5278
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5279
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5280
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5281
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5282
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5283
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5284
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5285
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5286
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5287
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5288
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5289
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5290
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5291
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5292
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5293
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5294
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5295
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5296
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5297
    }/*function_uint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5298
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5299
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5300
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5301
 *UINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5302
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5303
    case function_uint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5304
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5305
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5306
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5307
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5308
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5309
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5310
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5311
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5312
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5313
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5314
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5315
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5316
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5317
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5318
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5319
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5320
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5321
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5322
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5323
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5324
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5325
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5326
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5327
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5328
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5329
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5330
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5331
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5332
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5333
    }/*function_uint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5334
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5335
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5336
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5337
 *UINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5338
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5339
    case function_uint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5340
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5341
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5342
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5343
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5344
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5345
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5346
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5347
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5348
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5349
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5350
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5351
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5352
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5353
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5354
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5355
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5356
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5357
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5358
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5359
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5360
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5361
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5362
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5363
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5364
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5365
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5366
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5367
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5368
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5369
    }/*function_uint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5370
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5371
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5372
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5373
 *UINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5374
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5375
    case function_uint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5376
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5377
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5378
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5379
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5380
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5381
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5382
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5383
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5384
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5385
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5386
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5387
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5388
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5389
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5390
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5391
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5392
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5393
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5394
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5395
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5396
                s4o.print(")__uint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5397
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5398
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5399
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5400
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5401
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5402
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5403
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5404
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5405
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5406
    }/*function_uint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5407
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5408
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5409
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5410
 *UINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5411
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5412
    case function_uint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5413
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5414
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5415
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5416
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5417
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5418
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5419
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5420
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5421
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5422
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5423
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5424
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5425
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5426
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5427
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5428
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5429
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5430
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5431
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5432
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5433
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5434
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5435
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5436
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5437
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5438
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5439
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5440
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5441
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5442
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5443
    }/*function_uint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5444
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5445
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5446
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5447
 *UINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5448
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5449
    case function_uint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5450
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5451
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5452
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5453
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5454
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5455
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5456
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5457
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5458
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5459
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5460
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5461
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5462
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5463
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5464
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5465
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5466
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5467
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5468
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5469
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5470
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5471
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5472
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5473
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5474
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5475
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5476
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5477
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5478
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5479
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5480
    }/*function_uint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5481
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5482
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5483
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5484
 *UINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5485
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5486
    case function_uint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5487
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5488
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5489
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5490
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5491
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5492
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5493
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5494
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5495
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5496
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5497
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5498
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5499
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5500
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5501
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5502
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5503
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5504
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5505
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5506
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5507
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5508
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5509
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5510
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5511
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5512
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5513
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5514
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5515
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5516
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5517
    }/*function_uint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5518
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5519
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5520
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5521
 *UDINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5522
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5523
    case function_udint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5524
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5525
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5526
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5527
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5528
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5529
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5530
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5531
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5532
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5533
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5534
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5535
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5536
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5537
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5538
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5539
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5540
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5541
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5542
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5543
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5544
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5545
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5546
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5547
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5548
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5549
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5550
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5551
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5552
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5553
    }/*function_udint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5554
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5555
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5556
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5557
 *UDINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5558
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5559
    case function_udint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5560
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5561
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5562
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5563
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5564
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5565
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5566
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5567
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5568
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5569
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5570
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5571
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5572
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5573
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5574
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5575
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5576
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5577
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5578
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5579
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5580
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5581
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5582
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5583
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5584
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5585
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5586
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5587
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5588
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5589
    }/*function_udint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5590
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5591
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5592
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5593
 *UDINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5594
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5595
    case function_udint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5596
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5597
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5598
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5599
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5600
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5601
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5602
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5603
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5604
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5605
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5606
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5607
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5608
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5609
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5610
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5611
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5612
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5613
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5614
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5615
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5616
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5617
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5618
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5619
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5620
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5621
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5622
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5623
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5624
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5625
    }/*function_udint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5626
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5627
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5628
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5629
 *UDINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5630
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5631
    case function_udint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5632
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5633
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5634
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5635
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5636
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5637
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5638
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5639
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5640
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5641
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5642
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5643
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5644
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5645
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5646
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5647
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5648
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5649
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5650
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5651
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5652
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5653
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5654
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5655
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5656
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5657
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5658
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5659
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5660
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5661
    }/*function_udint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5662
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5663
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5664
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5665
 *UDINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5666
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5667
    case function_udint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5668
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5669
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5670
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5671
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5672
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5673
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5674
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5675
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5676
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5677
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5678
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5679
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5680
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5681
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5682
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5683
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5684
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5685
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5686
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5687
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5688
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5689
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5690
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5691
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5692
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5693
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5694
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5695
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5696
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5697
    }/*function_udint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5698
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5699
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5700
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5701
 *UDINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5702
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5703
    case function_udint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5704
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5705
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5706
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5707
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5708
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5709
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5710
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5711
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5712
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5713
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5714
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5715
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5716
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5717
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5718
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5719
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5720
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5721
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5722
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5723
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5724
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5725
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5726
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5727
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5728
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5729
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5730
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5731
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5732
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5733
    }/*function_udint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5734
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5735
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5736
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5737
 *UDINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5738
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5739
    case function_udint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5740
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5741
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5742
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5743
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5744
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5745
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5746
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5747
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5748
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5749
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5750
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5751
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5752
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5753
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5754
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5755
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5756
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5757
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5758
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5759
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5760
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5761
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5762
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5763
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5764
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5765
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5766
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5767
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5768
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5769
    }/*function_udint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5770
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5771
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5772
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5773
 *UDINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5774
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5775
    case function_udint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5776
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5777
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5778
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5779
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5780
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5781
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5782
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5783
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5784
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5785
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5786
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5787
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5788
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5789
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5790
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5791
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5792
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5793
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5794
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5795
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5796
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5797
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5798
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5799
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5800
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5801
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5802
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5803
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  5804
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5805
    }/*function_udint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5806
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5807
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5808
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5809
 *UDINT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5810
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5811
    case function_udint_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5812
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5813
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5814
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5815
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5816
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5817
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5818
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5819
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5820
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5821
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5822
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5823
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5824
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5825
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5826
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5827
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5828
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5829
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5830
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5831
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5832
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5833
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5834
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5835
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5836
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5837
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5838
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5839
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5840
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5841
    }/*function_udint_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5842
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5843
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5844
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5845
 *UDINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5846
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5847
    case function_udint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5848
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5849
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5850
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5851
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5852
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5853
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5854
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5855
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5856
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5857
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5858
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5859
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5860
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5861
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5862
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5863
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5864
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5865
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5866
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5867
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5868
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5869
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5870
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5871
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5872
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5873
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5874
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5875
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5876
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5877
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5878
    }/*function_udint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5879
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5880
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5881
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5882
 *UDINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5883
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5884
    case function_udint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5885
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5886
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5887
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5888
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5889
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5890
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5891
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5892
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5893
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5894
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5895
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5896
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5897
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5898
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5899
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5900
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5901
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5902
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5903
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5904
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5905
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5906
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5907
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5908
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5909
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5910
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5911
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5912
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5913
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5914
    }/*function_udint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5915
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5916
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5917
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5918
 *UDINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5919
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5920
    case function_udint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5921
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5922
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5923
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5924
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5925
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5926
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5927
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5928
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5929
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5930
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5931
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5932
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5933
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5934
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5935
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5936
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5937
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5938
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5939
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5940
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5941
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5942
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5943
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5944
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5945
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5946
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5947
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5948
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5949
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5950
    }/*function_udint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5951
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5952
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5953
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5954
 *UDINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5955
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5956
    case function_udint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5957
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5958
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5959
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5960
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5961
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5962
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5963
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5964
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5965
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5966
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5967
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5968
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5969
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5970
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5971
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5972
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5973
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5974
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5975
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5976
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5977
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5978
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5979
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5980
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5981
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5982
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5983
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5984
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5985
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5986
    }/*function_udint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5987
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5988
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5989
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5990
 *UDINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5991
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5992
    case function_udint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5993
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5994
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5995
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5996
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5997
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5998
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  5999
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6000
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6001
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6002
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6003
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6004
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6005
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6006
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6007
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6008
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6009
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6010
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6011
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6012
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6013
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6014
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6015
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6016
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6017
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6018
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6019
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6020
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6021
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6022
    }/*function_udint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6023
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6024
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6025
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6026
 *UDINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6027
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6028
    case function_udint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6029
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6030
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6031
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6032
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6033
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6034
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6035
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6036
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6037
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6038
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6039
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6040
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6041
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6042
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6043
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6044
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6045
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6046
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6047
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6048
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6049
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6050
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6051
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6052
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6053
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6054
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6055
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6056
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6057
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6058
    }/*function_udint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6059
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6060
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6061
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6062
 *UDINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6063
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6064
    case function_udint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6065
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6066
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6067
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6068
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6069
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6070
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6071
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6072
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6073
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6074
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6075
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6076
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6077
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6078
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6079
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6080
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6081
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6082
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6083
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6084
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6085
                s4o.print(")__uint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6086
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6087
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6088
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6089
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6090
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6091
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6092
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6093
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6094
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6095
    }/*function_udint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6096
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6097
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6098
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6099
 *UDINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6100
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6101
    case function_udint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6102
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6103
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6104
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6105
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6106
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6107
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6108
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6109
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6110
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6111
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6112
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6113
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6114
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6115
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6116
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6117
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6118
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6119
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6120
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6121
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6122
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6123
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6124
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6125
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6126
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6127
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6128
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6129
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6130
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6131
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6132
    }/*function_udint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6133
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6134
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6135
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6136
 *UDINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6137
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6138
    case function_udint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6139
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6140
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6141
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6142
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6143
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6144
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6145
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6146
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6147
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6148
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6149
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6150
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6151
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6152
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6153
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6154
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6155
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6156
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6157
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6158
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6159
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6160
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6161
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6162
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6163
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6164
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6165
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6166
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6167
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6168
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6169
    }/*function_udint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6170
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6171
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6172
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6173
 *UDINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6174
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6175
    case function_udint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6176
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6177
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6178
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6179
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6180
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6181
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6182
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6183
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6184
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6185
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6186
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6187
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6188
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6189
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6190
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6191
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6192
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6193
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6194
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6195
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6196
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6197
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6198
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6199
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6200
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6201
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6202
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6203
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6204
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6205
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6206
    }/*function_udint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6207
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6208
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6209
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6210
 *ULINT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6211
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6212
    case function_ulint_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6213
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6214
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6215
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6216
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6217
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6218
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6219
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6220
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6221
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6222
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6223
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6224
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6225
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6226
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6227
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6228
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6229
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6230
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6231
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6232
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6233
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6234
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6235
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6236
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6237
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6238
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6239
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6240
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6241
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6242
    }/*function_ulint_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6243
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6244
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6245
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6246
 *ULINT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6247
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6248
    case function_ulint_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6249
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6250
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6251
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6252
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6253
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6254
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6255
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6256
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6257
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6258
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6259
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6260
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6261
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6262
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6263
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6264
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6265
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6266
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6267
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6268
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6269
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6270
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6271
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6272
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6273
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6274
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6275
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6276
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6277
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6278
    }/*function_ulint_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6279
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6280
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6281
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6282
 *ULINT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6283
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6284
    case function_ulint_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6285
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6286
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6287
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6288
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6289
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6290
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6291
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6292
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6293
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6294
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6295
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6296
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6297
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6298
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6299
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6300
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6301
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6302
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6303
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6304
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6305
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6306
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6307
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6308
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6309
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6310
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6311
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6312
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6313
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6314
    }/*function_ulint_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6315
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6316
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6317
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6318
 *ULINT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6319
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6320
    case function_ulint_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6321
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6322
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6323
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6324
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6325
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6326
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6327
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6328
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6329
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6330
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6331
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6332
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6333
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6334
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6335
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6336
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6337
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6338
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6339
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6340
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6341
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6342
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6343
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6344
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6345
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6346
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6347
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6348
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6349
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6350
    }/*function_ulint_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6351
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6352
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6353
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6354
 *ULINT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6355
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6356
    case function_ulint_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6357
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6358
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6359
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6360
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6361
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6362
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6363
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6364
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6365
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6366
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6367
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6368
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6369
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6370
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6371
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6372
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6373
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6374
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6375
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6376
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6377
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6378
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6379
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6380
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6381
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6382
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6383
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6384
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6385
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6386
    }/*function_ulint_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6387
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6388
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6389
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6390
 *ULINT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6391
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6392
    case function_ulint_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6393
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6394
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6395
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6396
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6397
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6398
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6399
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6400
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6401
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6402
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6403
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6404
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6405
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6406
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6407
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6408
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6409
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6410
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6411
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6412
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6413
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6414
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6415
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6416
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6417
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6418
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6419
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6420
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6421
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6422
    }/*function_ulint_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6423
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6424
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6425
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6426
 *ULINT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6427
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6428
    case function_ulint_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6429
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6430
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6431
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6432
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6433
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6434
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6435
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6436
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6437
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6438
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6439
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6440
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6441
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6442
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6443
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6444
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6445
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6446
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6447
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6448
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6449
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6450
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6451
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6452
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6453
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6454
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6455
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6456
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6457
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6458
    }/*function_ulint_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6459
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6460
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6461
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6462
 *ULINT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6463
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6464
    case function_ulint_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6465
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6466
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6467
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6468
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6469
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6470
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6471
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6472
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6473
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6474
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6475
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6476
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6477
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6478
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6479
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6480
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6481
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6482
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6483
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6484
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6485
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6486
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6487
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6488
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6489
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6490
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6491
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6492
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6493
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6494
    }/*function_ulint_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6495
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6496
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6497
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6498
 *ULINT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6499
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6500
    case function_ulint_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6501
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6502
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6503
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6504
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6505
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6506
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6507
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6508
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6509
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6510
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6511
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6512
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6513
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6514
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6515
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6516
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6517
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6518
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6519
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6520
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6521
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6522
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6523
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6524
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6525
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6526
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6527
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6528
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  6529
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6530
    }/*function_ulint_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6531
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6532
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6533
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6534
 *ULINT_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6535
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6536
    case function_ulint_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6537
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6538
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6539
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6540
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6541
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6542
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6543
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6544
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6545
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6546
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6547
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6548
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6549
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6550
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6551
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6552
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6553
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6554
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6555
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6556
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6557
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6558
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6559
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6560
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6561
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6562
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6563
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6564
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6565
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6566
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6567
    }/*function_ulint_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6568
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6569
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6570
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6571
 *ULINT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6572
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6573
    case function_ulint_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6574
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6575
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6576
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6577
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6578
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6579
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6580
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6581
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6582
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6583
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6584
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6585
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6586
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6587
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6588
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6589
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6590
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6591
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6592
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6593
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6594
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6595
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6596
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6597
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6598
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6599
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6600
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6601
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6602
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6603
    }/*function_ulint_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6604
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6605
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6606
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6607
 *ULINT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6608
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6609
    case function_ulint_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6610
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6611
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6612
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6613
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6614
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6615
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6616
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6617
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6618
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6619
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6620
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6621
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6622
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6623
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6624
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6625
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6626
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6627
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6628
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6629
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6630
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6631
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6632
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6633
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6634
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6635
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6636
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6637
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6638
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6639
    }/*function_ulint_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6640
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6641
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6642
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6643
 *ULINT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6644
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6645
    case function_ulint_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6646
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6647
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6648
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6649
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6650
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6651
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6652
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6653
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6654
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6655
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6656
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6657
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6658
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6659
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6660
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6661
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6662
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6663
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6664
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6665
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6666
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6667
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6668
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6669
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6670
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6671
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6672
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6673
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6674
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6675
    }/*function_ulint_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6676
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6677
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6678
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6679
 *ULINT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6680
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6681
    case function_ulint_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6682
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6683
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6684
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6685
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6686
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6687
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6688
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6689
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6690
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6691
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6692
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6693
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6694
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6695
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6696
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6697
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6698
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6699
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6700
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6701
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6702
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6703
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6704
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6705
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6706
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6707
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6708
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6709
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6710
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6711
    }/*function_ulint_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6712
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6713
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6714
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6715
 *ULINT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6716
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6717
    case function_ulint_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6718
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6719
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6720
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6721
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6722
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6723
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6724
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6725
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6726
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6727
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6728
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6729
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6730
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6731
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6732
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6733
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6734
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6735
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6736
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6737
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6738
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6739
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6740
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6741
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6742
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6743
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6744
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6745
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6746
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6747
    }/*function_ulint_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6748
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6749
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6750
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6751
 *ULINT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6752
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6753
    case function_ulint_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6754
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6755
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6756
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6757
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6758
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6759
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6760
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6761
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6762
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6763
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6764
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6765
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6766
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6767
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6768
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6769
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6770
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6771
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6772
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6773
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6774
                s4o.print(")__uint_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6775
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6776
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6777
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6778
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6779
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6780
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6781
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6782
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6783
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6784
    }/*function_ulint_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6785
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6786
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6787
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6788
 *ULINT_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6789
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6790
    case function_ulint_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6791
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6792
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6793
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6794
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6795
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6796
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6797
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6798
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6799
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6800
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6801
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6802
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6803
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6804
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6805
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6806
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6807
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6808
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6809
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6810
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6811
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6812
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6813
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6814
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6815
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6816
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6817
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6818
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6819
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6820
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6821
    }/*function_ulint_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6822
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6823
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6824
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6825
 *ULINT_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6826
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6827
    case function_ulint_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6828
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6829
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6830
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6831
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6832
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6833
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6834
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6835
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6836
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6837
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6838
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6839
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6840
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6841
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6842
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6843
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6844
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6845
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6846
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6847
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6848
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6849
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6850
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6851
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6852
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6853
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6854
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6855
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6856
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6857
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6858
    }/*function_ulint_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6859
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6860
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6861
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6862
 *ULINT_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6863
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6864
    case function_ulint_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6865
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6866
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6867
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6868
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6869
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6870
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6871
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6872
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6873
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6874
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6875
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6876
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6877
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6878
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6879
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6880
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6881
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6882
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6883
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6884
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6885
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6886
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6887
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6888
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6889
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6890
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6891
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6892
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6893
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6894
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6895
    }/*function_ulint_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6896
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6897
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6898
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6899
 *TIME_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6900
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6901
    case function_time_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6902
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6903
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6904
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6905
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6906
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6907
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6908
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6909
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6910
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6911
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6912
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6913
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6914
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6915
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6916
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6917
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6918
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6919
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6920
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6921
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6922
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6923
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6924
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6925
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6926
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6927
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6928
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6929
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6930
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6931
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6932
    }/*function_time_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6933
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6934
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6935
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6936
 *TIME_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6937
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6938
    case function_time_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6939
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6940
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6941
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6942
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6943
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6944
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6945
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6946
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6947
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6948
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6949
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6950
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6951
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6952
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6953
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6954
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6955
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6956
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6957
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6958
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6959
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6960
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6961
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6962
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6963
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6964
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6965
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6966
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6967
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6968
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6969
    }/*function_time_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6970
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6971
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6972
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6973
 *TIME_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6974
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6975
    case function_time_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6976
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6977
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6978
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6979
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6980
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6981
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6982
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6983
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6984
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6985
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6986
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6987
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6988
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6989
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6990
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6991
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6992
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6993
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6994
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6995
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6996
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6997
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6998
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  6999
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7000
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7001
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7002
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7003
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7004
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7005
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7006
    }/*function_time_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7007
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7008
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7009
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7010
 *TIME_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7011
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7012
    case function_time_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7013
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7014
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7015
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7016
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7017
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7018
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7019
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7020
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7021
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7022
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7023
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7024
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7025
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7026
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7027
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7028
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7029
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7030
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7031
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7032
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7033
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7034
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7035
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7036
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7037
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7038
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7039
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7040
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7041
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7042
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7043
    }/*function_time_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7044
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7045
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7046
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7047
 *TIME_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7048
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7049
    case function_time_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7050
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7051
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7052
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7053
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7054
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7055
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7056
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7057
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7058
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7059
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7060
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7061
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7062
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7063
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7064
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7065
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7066
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7067
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7068
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7069
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7070
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7071
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7072
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7073
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7074
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7075
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7076
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7077
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7078
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7079
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7080
    }/*function_time_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7081
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7082
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7083
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7084
 *TIME_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7085
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7086
    case function_time_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7087
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7088
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7089
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7090
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7091
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7092
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7093
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7094
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7095
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7096
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7097
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7098
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7099
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7100
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7101
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7102
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7103
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7104
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7105
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7106
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7107
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7108
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7109
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7110
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7111
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7112
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7113
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7114
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7115
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7116
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7117
    }/*function_time_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7118
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7119
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7120
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7121
 *TIME_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7122
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7123
    case function_time_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7124
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7125
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7126
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7127
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7128
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7129
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7130
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7131
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7132
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7133
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7134
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7135
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7136
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7137
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7138
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7139
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7140
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7141
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7142
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7143
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7144
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7145
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7146
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7147
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7148
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7149
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7150
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7151
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7152
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7153
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7154
    }/*function_time_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7155
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7156
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7157
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7158
 *TIME_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7159
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7160
    case function_time_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7161
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7162
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7163
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7164
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7165
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7166
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7167
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7168
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7169
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7170
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7171
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7172
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7173
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7174
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7175
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7176
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7177
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7178
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7179
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7180
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7181
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7182
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7183
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7184
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7185
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7186
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7187
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7188
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7189
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7190
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7191
    }/*function_time_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7192
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7193
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7194
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7195
 *TIME_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7196
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7197
    case function_time_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7198
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7199
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7200
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7201
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7202
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7203
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7204
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7205
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7206
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7207
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7208
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7209
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7210
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7211
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7212
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7213
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7214
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7215
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7216
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7217
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7218
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7219
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7220
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7221
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7222
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7223
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7224
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7225
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7226
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7227
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7228
    }/*function_time_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7229
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7230
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7231
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7232
 *TIME_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7233
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7234
    case function_time_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7235
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7236
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7237
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7238
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7239
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7240
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7241
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7242
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7243
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7244
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7245
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7246
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7247
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7248
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7249
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7250
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7251
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7252
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7253
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7254
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7255
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7256
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7257
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7258
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7259
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7260
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7261
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7262
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7263
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7264
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7265
    }/*function_time_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7266
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7267
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7268
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7269
 *TIME_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7270
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7271
    case function_time_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7272
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7273
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7274
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7275
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7276
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7277
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7278
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7279
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7280
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7281
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7282
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7283
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7284
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7285
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7286
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7287
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7288
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7289
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7290
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7291
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7292
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7293
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7294
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7295
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7296
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7297
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7298
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7299
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7300
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7301
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7302
    }/*function_time_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7303
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7304
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7305
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7306
 *TIME_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7307
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7308
    case function_time_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7309
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7310
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7311
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7312
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7313
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7314
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7315
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7316
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7317
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7318
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7319
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7320
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7321
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7322
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7323
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7324
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7325
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7326
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7327
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7328
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7329
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7330
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7331
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7332
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7333
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7334
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7335
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7336
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7337
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7338
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7339
    }/*function_time_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7340
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7341
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7342
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7343
 *TIME_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7344
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7345
    case function_time_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7346
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7347
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7348
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7349
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7350
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7351
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7352
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7353
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7354
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7355
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7356
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7357
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7358
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7359
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7360
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7361
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7362
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7363
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7364
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7365
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7366
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7367
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7368
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7369
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7370
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7371
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7372
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7373
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7374
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7375
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7376
    }/*function_time_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7377
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7378
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7379
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7380
 *TIME_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7381
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7382
    case function_time_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7383
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7384
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7385
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7386
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7387
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7388
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7389
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7390
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7391
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7392
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7393
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7394
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7395
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7396
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7397
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7398
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7399
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7400
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7401
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7402
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7403
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7404
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7405
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7406
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7407
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7408
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7409
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7410
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7411
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7412
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7413
    }/*function_time_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7414
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7415
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7416
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7417
 *TIME_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7418
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7419
    case function_time_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7420
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7421
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7422
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7423
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7424
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7425
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7426
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7427
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7428
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7429
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7430
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7431
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7432
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7433
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7434
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7435
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7436
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7437
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7438
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7439
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7440
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7441
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7442
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7443
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7444
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7445
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7446
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7447
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7448
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7449
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7450
    }/*function_time_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7451
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7452
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7453
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7454
 *TIME_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7455
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7456
    case function_time_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7457
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7458
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7459
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7460
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7461
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7462
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7463
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7464
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7465
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7466
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7467
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7468
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7469
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7470
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7471
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7472
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7473
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7474
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7475
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7476
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7477
                s4o.print(")__time_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7478
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7479
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7480
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7481
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7482
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7483
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7484
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7485
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7486
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7487
    }/*function_time_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7488
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7489
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7490
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7491
 *BOOL_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7492
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7493
    case function_bool_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7494
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7495
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7496
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7497
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7498
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7499
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7500
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7501
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7502
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7503
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7504
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7505
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7506
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7507
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7508
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7509
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7510
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7511
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7512
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7513
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7514
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7515
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7516
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7517
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7518
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7519
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7520
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7521
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7522
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7523
    }/*function_bool_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7524
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7525
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7526
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7527
 *BOOL_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7528
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7529
    case function_bool_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7530
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7531
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7532
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7533
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7534
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7535
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7536
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7537
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7538
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7539
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7540
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7541
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7542
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7543
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7544
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7545
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7546
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7547
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7548
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7549
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7550
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7551
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7552
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7553
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7554
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7555
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7556
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7557
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7558
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7559
    }/*function_bool_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7560
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7561
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7562
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7563
 *BOOL_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7564
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7565
    case function_bool_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7566
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7567
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7568
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7569
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7570
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7571
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7572
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7573
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7574
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7575
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7576
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7577
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7578
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7579
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7580
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7581
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7582
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7583
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7584
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7585
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7586
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7587
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7588
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7589
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7590
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7591
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7592
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7593
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7594
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7595
    }/*function_bool_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7596
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7597
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7598
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7599
 *BOOL_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7600
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7601
    case function_bool_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7602
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7603
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7604
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7605
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7606
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7607
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7608
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7609
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7610
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7611
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7612
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7613
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7614
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7615
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7616
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7617
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7618
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7619
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7620
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7621
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7622
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7623
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7624
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7625
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7626
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7627
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7628
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7629
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7630
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7631
    }/*function_bool_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7632
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7633
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7634
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7635
 *BOOL_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7636
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7637
    case function_bool_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7638
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7639
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7640
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7641
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7642
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7643
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7644
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7645
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7646
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7647
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7648
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7649
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7650
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7651
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7652
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7653
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7654
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7655
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7656
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7657
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7658
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7659
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7660
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7661
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7662
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7663
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7664
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7665
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7666
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7667
    }/*function_bool_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7668
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7669
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7670
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7671
 *BOOL_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7672
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7673
    case function_bool_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7674
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7675
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7676
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7677
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7678
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7679
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7680
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7681
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7682
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7683
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7684
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7685
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7686
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7687
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7688
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7689
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7690
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7691
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7692
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7693
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7694
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7695
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7696
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7697
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7698
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7699
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7700
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7701
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7702
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7703
    }/*function_bool_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7704
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7705
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7706
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7707
 *BOOL_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7708
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7709
    case function_bool_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7710
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7711
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7712
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7713
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7714
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7715
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7716
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7717
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7718
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7719
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7720
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7721
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7722
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7723
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7724
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7725
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7726
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7727
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7728
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7729
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7730
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7731
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7732
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7733
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7734
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7735
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7736
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7737
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7738
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7739
    }/*function_bool_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7740
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7741
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7742
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7743
 *BOOL_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7744
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7745
    case function_bool_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7746
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7747
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7748
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7749
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7750
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7751
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7752
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7753
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7754
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7755
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7756
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7757
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7758
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7759
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7760
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7761
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7762
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7763
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7764
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7765
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7766
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7767
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7768
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7769
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7770
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7771
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7772
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7773
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7774
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7775
    }/*function_bool_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7776
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7777
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7778
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7779
 *BOOL_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7780
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7781
    case function_bool_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7782
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7783
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7784
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7785
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7786
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7787
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7788
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7789
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7790
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7791
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7792
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7793
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7794
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7795
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7796
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7797
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7798
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7799
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7800
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7801
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7802
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7803
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7804
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7805
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7806
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7807
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7808
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7809
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7810
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7811
    }/*function_bool_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7812
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7813
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7814
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7815
 *BOOL_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7816
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7817
    case function_bool_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7818
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7819
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7820
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7821
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7822
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7823
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7824
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7825
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7826
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7827
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7828
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7829
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7830
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7831
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7832
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7833
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7834
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7835
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7836
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7837
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7838
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7839
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7840
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7841
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7842
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7843
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7844
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7845
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7846
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7847
    }/*function_bool_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7848
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7849
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7850
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7851
 *BOOL_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7852
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7853
    case function_bool_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7854
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7855
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7856
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7857
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7858
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7859
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7860
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7861
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7862
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7863
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7864
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7865
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7866
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7867
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7868
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7869
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7870
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7871
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7872
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  7873
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7874
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7875
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7876
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7877
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7878
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7879
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7880
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7881
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7882
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7883
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7884
    }/*function_bool_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7885
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7886
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7887
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7888
 *BOOL_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7889
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7890
    case function_bool_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7891
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7892
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7893
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7894
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7895
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7896
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7897
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7898
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7899
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7900
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7901
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7902
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7903
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7904
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7905
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7906
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7907
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7908
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7909
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7910
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7911
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7912
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7913
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7914
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7915
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7916
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7917
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7918
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7919
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7920
    }/*function_bool_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7921
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7922
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7923
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7924
 *BOOL_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7925
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7926
    case function_bool_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7927
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7928
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7929
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7930
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7931
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7932
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7933
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7934
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7935
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7936
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7937
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7938
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7939
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7940
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7941
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7942
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7943
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7944
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7945
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7946
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7947
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7948
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7949
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7950
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7951
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7952
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7953
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7954
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7955
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7956
    }/*function_bool_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7957
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7958
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7959
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7960
 *BOOL_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7961
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7962
    case function_bool_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7963
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7964
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7965
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7966
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7967
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7968
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7969
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7970
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7971
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7972
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7973
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7974
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7975
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7976
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7977
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7978
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7979
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7980
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7981
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7982
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7983
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7984
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7985
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7986
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7987
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7988
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7989
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7990
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7991
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7992
    }/*function_bool_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7993
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7994
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7995
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7996
 *BOOL_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7997
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7998
    case function_bool_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  7999
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8000
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8001
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8002
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8003
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8004
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8005
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8006
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8007
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8008
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8009
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8010
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8011
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8012
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8013
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8014
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8015
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8016
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8017
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8018
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8019
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8020
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8021
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8022
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8023
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8024
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8025
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8026
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8027
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8028
    }/*function_bool_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8029
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8030
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8031
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8032
 *BOOL_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8033
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8034
    case function_bool_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8035
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8036
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8037
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8038
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8039
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8040
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8041
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8042
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8043
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8044
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8045
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8046
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8047
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8048
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8049
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8050
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8051
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8052
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8053
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8054
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8055
                s4o.print(")__bool_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8056
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8057
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8058
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8059
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8060
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8061
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8062
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8063
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8064
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8065
    }/*function_bool_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8066
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8067
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8068
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8069
 *BOOL_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8070
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8071
    case function_bool_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8072
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8073
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8074
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8075
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8076
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8077
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8078
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8079
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8080
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8081
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8082
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8083
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8084
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8085
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8086
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8087
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8088
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8089
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8090
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8091
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8092
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8093
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8094
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8095
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8096
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8097
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8098
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8099
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8100
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8101
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8102
    }/*function_bool_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8103
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8104
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8105
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8106
 *BOOL_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8107
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8108
    case function_bool_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8109
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8110
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8111
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8112
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8113
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8114
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8115
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8116
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8117
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8118
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8119
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8120
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8121
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8122
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8123
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8124
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8125
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8126
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8127
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8128
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8129
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8130
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8131
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8132
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8133
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8134
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8135
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8136
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8137
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8138
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8139
    }/*function_bool_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8140
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8141
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8142
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8143
 *BOOL_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8144
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8145
    case function_bool_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8146
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8147
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8148
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8149
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8150
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8151
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8152
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8153
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8154
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8155
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8156
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8157
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8158
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8159
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8160
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8161
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8162
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8163
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8164
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8165
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8166
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8167
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8168
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8169
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8170
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8171
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8172
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8173
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8174
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8175
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8176
    }/*function_bool_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8177
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8178
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8179
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8180
 *BYTE_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8181
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8182
    case function_byte_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8183
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8184
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8185
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8186
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8187
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8188
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8189
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8190
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8191
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8192
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8193
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8194
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8195
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8196
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8197
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8198
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8199
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8200
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8201
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8202
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8203
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8204
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8205
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8206
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8207
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8208
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8209
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8210
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8211
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8212
    }/*function_byte_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8213
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8214
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8215
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8216
 *BYTE_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8217
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8218
    case function_byte_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8219
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8220
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8221
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8222
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8223
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8224
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8225
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8226
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8227
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8228
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8229
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8230
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8231
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8232
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8233
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8234
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8235
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8236
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8237
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8238
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8239
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8240
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8241
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8242
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8243
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8244
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8245
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8246
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8247
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8248
    }/*function_byte_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8249
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8250
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8251
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8252
 *BYTE_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8253
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8254
    case function_byte_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8255
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8256
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8257
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8258
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8259
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8260
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8261
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8262
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8263
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8264
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8265
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8266
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8267
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8268
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8269
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8270
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8271
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8272
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8273
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8274
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8275
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8276
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8277
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8278
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8279
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8280
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8281
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8282
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8283
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8284
    }/*function_byte_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8285
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8286
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8287
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8288
 *BYTE_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8289
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8290
    case function_byte_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8291
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8292
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8293
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8294
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8295
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8296
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8297
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8298
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8299
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8300
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8301
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8302
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8303
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8304
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8305
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8306
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8307
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8308
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8309
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8310
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8311
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8312
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8313
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8314
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8315
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8316
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8317
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8318
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8319
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8320
    }/*function_byte_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8321
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8322
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8323
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8324
 *BYTE_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8325
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8326
    case function_byte_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8327
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8328
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8329
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8330
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8331
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8332
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8333
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8334
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8335
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8336
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8337
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8338
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8339
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8340
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8341
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8342
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8343
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8344
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8345
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8346
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8347
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8348
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8349
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8350
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8351
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8352
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8353
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8354
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8355
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8356
    }/*function_byte_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8357
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8358
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8359
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8360
 *BYTE_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8361
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8362
    case function_byte_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8363
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8364
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8365
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8366
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8367
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8368
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8369
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8370
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8371
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8372
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8373
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8374
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8375
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8376
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8377
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8378
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8379
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8380
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8381
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8382
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8383
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8384
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8385
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8386
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8387
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8388
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8389
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8390
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8391
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8392
    }/*function_byte_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8393
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8394
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8395
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8396
 *BYTE_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8397
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8398
    case function_byte_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8399
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8400
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8401
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8402
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8403
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8404
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8405
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8406
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8407
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8408
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8409
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8410
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8411
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8412
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8413
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8414
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8415
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8416
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8417
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8418
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8419
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8420
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8421
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8422
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8423
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8424
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8425
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8426
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8427
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8428
    }/*function_byte_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8429
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8430
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8431
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8432
 *BYTE_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8433
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8434
    case function_byte_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8435
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8436
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8437
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8438
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8439
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8440
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8441
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8442
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8443
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8444
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8445
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8446
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8447
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8448
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8449
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8450
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8451
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8452
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8453
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8454
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8455
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8456
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8457
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8458
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8459
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8460
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8461
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8462
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8463
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8464
    }/*function_byte_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8465
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8466
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8467
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8468
 *BYTE_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8469
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8470
    case function_byte_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8471
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8472
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8473
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8474
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8475
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8476
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8477
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8478
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8479
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8480
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8481
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8482
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8483
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8484
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8485
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8486
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8487
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8488
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8489
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8490
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8491
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8492
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8493
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8494
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8495
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8496
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8497
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8498
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8499
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8500
    }/*function_byte_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8501
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8502
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8503
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8504
 *BYTE_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8505
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8506
    case function_byte_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8507
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8508
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8509
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8510
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8511
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8512
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8513
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8514
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8515
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8516
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8517
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8518
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8519
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8520
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8521
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8522
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8523
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8524
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8525
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8526
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8527
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8528
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8529
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8530
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8531
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8532
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8533
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8534
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8535
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8536
    }/*function_byte_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8537
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8538
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8539
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8540
 *BYTE_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8541
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8542
    case function_byte_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8543
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8544
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8545
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8546
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8547
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8548
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8549
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8550
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8551
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8552
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8553
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8554
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8555
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8556
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8557
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8558
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8559
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8560
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8561
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8562
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8563
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8564
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8565
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8566
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8567
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8568
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8569
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8570
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8571
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8572
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8573
    }/*function_byte_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8574
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8575
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8576
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8577
 *BYTE_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8578
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8579
    case function_byte_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8580
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8581
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8582
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8583
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8584
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8585
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8586
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8587
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8588
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8589
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8590
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8591
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8592
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8593
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8594
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8595
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8596
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8597
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8598
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8599
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8600
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8601
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8602
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8603
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8604
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8605
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8606
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8607
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  8608
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8609
    }/*function_byte_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8610
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8611
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8612
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8613
 *BYTE_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8614
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8615
    case function_byte_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8616
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8617
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8618
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8619
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8620
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8621
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8622
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8623
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8624
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8625
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8626
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8627
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8628
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8629
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8630
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8631
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8632
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8633
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8634
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8635
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8636
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8637
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8638
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8639
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8640
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8641
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8642
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8643
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8644
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8645
    }/*function_byte_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8646
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8647
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8648
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8649
 *BYTE_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8650
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8651
    case function_byte_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8652
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8653
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8654
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8655
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8656
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8657
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8658
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8659
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8660
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8661
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8662
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8663
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8664
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8665
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8666
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8667
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8668
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8669
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8670
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8671
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8672
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8673
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8674
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8675
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8676
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8677
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8678
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8679
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8680
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8681
    }/*function_byte_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8682
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8683
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8684
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8685
 *BYTE_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8686
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8687
    case function_byte_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8688
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8689
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8690
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8691
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8692
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8693
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8694
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8695
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8696
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8697
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8698
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8699
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8700
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8701
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8702
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8703
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8704
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8705
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8706
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8707
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8708
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8709
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8710
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8711
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8712
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8713
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8714
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8715
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8716
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8717
    }/*function_byte_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8718
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8719
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8720
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8721
 *BYTE_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8722
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8723
    case function_byte_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8724
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8725
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8726
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8727
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8728
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8729
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8730
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8731
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8732
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8733
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8734
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8735
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8736
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8737
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8738
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8739
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8740
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8741
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8742
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8743
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8744
                s4o.print(")__bit_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8745
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8746
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8747
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8748
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8749
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8750
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8751
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8752
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8753
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8754
    }/*function_byte_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8755
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8756
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8757
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8758
 *BYTE_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8759
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8760
    case function_byte_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8761
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8762
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8763
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8764
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8765
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8766
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8767
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8768
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8769
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8770
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8771
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8772
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8773
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8774
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8775
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8776
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8777
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8778
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8779
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8780
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8781
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8782
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8783
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8784
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8785
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8786
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8787
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8788
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8789
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8790
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8791
    }/*function_byte_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8792
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8793
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8794
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8795
 *BYTE_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8796
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8797
    case function_byte_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8798
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8799
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8800
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8801
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8802
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8803
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8804
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8805
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8806
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8807
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8808
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8809
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8810
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8811
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8812
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8813
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8814
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8815
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8816
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8817
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8818
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8819
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8820
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8821
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8822
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8823
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8824
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8825
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8826
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8827
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8828
    }/*function_byte_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8829
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8830
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8831
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8832
 *BYTE_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8833
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8834
    case function_byte_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8835
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8836
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8837
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8838
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8839
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8840
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8841
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8842
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8843
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8844
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8845
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8846
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8847
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8848
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8849
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8850
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8851
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8852
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8853
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8854
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8855
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8856
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8857
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8858
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8859
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8860
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8861
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8862
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8863
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8864
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8865
    }/*function_byte_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8866
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8867
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8868
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8869
 *WORD_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8870
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8871
    case function_word_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8872
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8873
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8874
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8875
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8876
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8877
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8878
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8879
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8880
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8881
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8882
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8883
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8884
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8885
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8886
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8887
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8888
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8889
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8890
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8891
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8892
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8893
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8894
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8895
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8896
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8897
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8898
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8899
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8900
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8901
    }/*function_word_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8902
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8903
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8904
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8905
 *WORD_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8906
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8907
    case function_word_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8908
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8909
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8910
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8911
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8912
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8913
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8914
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8915
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8916
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8917
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8918
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8919
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8920
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8921
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8922
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8923
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8924
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8925
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8926
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8927
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8928
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8929
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8930
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8931
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8932
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8933
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8934
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8935
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8936
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8937
    }/*function_word_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8938
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8939
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8940
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8941
 *WORD_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8942
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8943
    case function_word_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8944
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8945
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8946
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8947
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8948
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8949
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8950
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8951
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8952
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8953
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8954
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8955
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8956
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8957
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8958
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8959
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8960
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8961
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8962
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8963
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8964
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8965
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8966
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8967
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8968
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8969
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8970
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8971
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8972
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8973
    }/*function_word_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8974
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8975
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8976
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8977
 *WORD_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8978
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8979
    case function_word_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8980
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8981
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8982
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8983
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8984
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8985
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8986
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8987
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8988
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8989
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8990
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8991
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8992
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8993
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8994
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8995
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8996
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8997
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8998
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  8999
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9000
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9001
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9002
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9003
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9004
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9005
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9006
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9007
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9008
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9009
    }/*function_word_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9010
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9011
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9012
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9013
 *WORD_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9014
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9015
    case function_word_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9016
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9017
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9018
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9019
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9020
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9021
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9022
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9023
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9024
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9025
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9026
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9027
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9028
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9029
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9030
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9031
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9032
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9033
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9034
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9035
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9036
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9037
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9038
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9039
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9040
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9041
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9042
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9043
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9044
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9045
    }/*function_word_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9046
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9047
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9048
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9049
 *WORD_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9050
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9051
    case function_word_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9052
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9053
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9054
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9055
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9056
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9057
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9058
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9059
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9060
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9061
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9062
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9063
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9064
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9065
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9066
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9067
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9068
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9069
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9070
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9071
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9072
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9073
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9074
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9075
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9076
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9077
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9078
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9079
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9080
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9081
    }/*function_word_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9082
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9083
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9084
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9085
 *WORD_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9086
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9087
    case function_word_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9088
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9089
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9090
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9091
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9092
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9093
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9094
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9095
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9096
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9097
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9098
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9099
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9100
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9101
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9102
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9103
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9104
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9105
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9106
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9107
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9108
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9109
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9110
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9111
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9112
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9113
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9114
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9115
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9116
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9117
    }/*function_word_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9118
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9119
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9120
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9121
 *WORD_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9122
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9123
    case function_word_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9124
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9125
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9126
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9127
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9128
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9129
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9130
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9131
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9132
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9133
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9134
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9135
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9136
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9137
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9138
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9139
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9140
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9141
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9142
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9143
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9144
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9145
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9146
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9147
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9148
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9149
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9150
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9151
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9152
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9153
    }/*function_word_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9154
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9155
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9156
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9157
 *WORD_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9158
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9159
    case function_word_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9160
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9161
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9162
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9163
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9164
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9165
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9166
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9167
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9168
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9169
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9170
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9171
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9172
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9173
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9174
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9175
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9176
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9177
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9178
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9179
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9180
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9181
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9182
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9183
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9184
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9185
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9186
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9187
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9188
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9189
    }/*function_word_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9190
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9191
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9192
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9193
 *WORD_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9194
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9195
    case function_word_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9196
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9197
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9198
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9199
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9200
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9201
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9202
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9203
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9204
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9205
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9206
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9207
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9208
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9209
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9210
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9211
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9212
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9213
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9214
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9215
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9216
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9217
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9218
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9219
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9220
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9221
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9222
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9223
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9224
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9225
    }/*function_word_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9226
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9227
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9228
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9229
 *WORD_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9230
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9231
    case function_word_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9232
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9233
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9234
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9235
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9236
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9237
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9238
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9239
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9240
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9241
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9242
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9243
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9244
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9245
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9246
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9247
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9248
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9249
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9250
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9251
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9252
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9253
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9254
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9255
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9256
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9257
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9258
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9259
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9260
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9261
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9262
    }/*function_word_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9263
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9264
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9265
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9266
 *WORD_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9267
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9268
    case function_word_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9269
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9270
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9271
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9272
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9273
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9274
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9275
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9276
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9277
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9278
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9279
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9280
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9281
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9282
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9283
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9284
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9285
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9286
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9287
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9288
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9289
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9290
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9291
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9292
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9293
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9294
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9295
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9296
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9297
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9298
    }/*function_word_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9299
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9300
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9301
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9302
 *WORD_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9303
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9304
    case function_word_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9305
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9306
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9307
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9308
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9309
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9310
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9311
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9312
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9313
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9314
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9315
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9316
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9317
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9318
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9319
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9320
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9321
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9322
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9323
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9324
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9325
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9326
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9327
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9328
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9329
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9330
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9331
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9332
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
  9333
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9334
    }/*function_word_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9335
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9336
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9337
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9338
 *WORD_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9339
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9340
    case function_word_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9341
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9342
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9343
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9344
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9345
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9346
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9347
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9348
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9349
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9350
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9351
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9352
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9353
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9354
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9355
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9356
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9357
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9358
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9359
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9360
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9361
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9362
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9363
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9364
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9365
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9366
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9367
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9368
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9369
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9370
    }/*function_word_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9371
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9372
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9373
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9374
 *WORD_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9375
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9376
    case function_word_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9377
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9378
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9379
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9380
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9381
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9382
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9383
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9384
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9385
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9386
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9387
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9388
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9389
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9390
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9391
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9392
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9393
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9394
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9395
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9396
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9397
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9398
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9399
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9400
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9401
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9402
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9403
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9404
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9405
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9406
    }/*function_word_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9407
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9408
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9409
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9410
 *WORD_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9411
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9412
    case function_word_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9413
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9414
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9415
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9416
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9417
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9418
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9419
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9420
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9421
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9422
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9423
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9424
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9425
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9426
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9427
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9428
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9429
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9430
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9431
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9432
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9433
                s4o.print(")__bit_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9434
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9435
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9436
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9437
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9438
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9439
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9440
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9441
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9442
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9443
    }/*function_word_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9444
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9445
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9446
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9447
 *WORD_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9448
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9449
    case function_word_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9450
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9451
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9452
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9453
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9454
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9455
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9456
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9457
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9458
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9459
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9460
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9461
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9462
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9463
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9464
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9465
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9466
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9467
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9468
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9469
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9470
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9471
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9472
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9473
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9474
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9475
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9476
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9477
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9478
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9479
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9480
    }/*function_word_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9481
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9482
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9483
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9484
 *WORD_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9485
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9486
    case function_word_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9487
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9488
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9489
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9490
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9491
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9492
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9493
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9494
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9495
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9496
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9497
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9498
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9499
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9500
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9501
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9502
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9503
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9504
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9505
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9506
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9507
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9508
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9509
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9510
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9511
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9512
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9513
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9514
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9515
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9516
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9517
    }/*function_word_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9518
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9519
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9520
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9521
 *WORD_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9522
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9523
    case function_word_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9524
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9525
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9526
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9527
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9528
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9529
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9530
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9531
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9532
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9533
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9534
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9535
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9536
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9537
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9538
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9539
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9540
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9541
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9542
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9543
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9544
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9545
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9546
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9547
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9548
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9549
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9550
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9551
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9552
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9553
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9554
    }/*function_word_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9555
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9556
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9557
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9558
 *DWORD_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9559
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9560
    case function_dword_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9561
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9562
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9563
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9564
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9565
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9566
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9567
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9568
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9569
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9570
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9571
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9572
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9573
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9574
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9575
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9576
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9577
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9578
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9579
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9580
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9581
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9582
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9583
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9584
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9585
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9586
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9587
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9588
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9589
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9590
    }/*function_dword_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9591
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9592
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9593
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9594
 *DWORD_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9595
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9596
    case function_dword_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9597
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9598
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9599
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9600
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9601
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9602
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9603
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9604
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9605
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9606
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9607
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9608
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9609
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9610
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9611
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9612
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9613
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9614
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9615
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9616
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9617
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9618
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9619
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9620
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9621
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9622
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9623
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9624
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9625
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9626
    }/*function_dword_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9627
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9628
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9629
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9630
 *DWORD_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9631
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9632
    case function_dword_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9633
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9634
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9635
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9636
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9637
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9638
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9639
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9640
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9641
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9642
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9643
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9644
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9645
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9646
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9647
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9648
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9649
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9650
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9651
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9652
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9653
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9654
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9655
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9656
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9657
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9658
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9659
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9660
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9661
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9662
    }/*function_dword_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9663
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9664
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9665
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9666
 *DWORD_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9667
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9668
    case function_dword_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9669
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9670
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9671
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9672
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9673
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9674
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9675
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9676
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9677
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9678
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9679
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9680
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9681
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9682
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9683
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9684
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9685
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9686
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9687
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9688
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9689
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9690
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9691
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9692
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9693
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9694
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9695
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9696
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9697
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9698
    }/*function_dword_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9699
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9700
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9701
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9702
 *DWORD_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9703
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9704
    case function_dword_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9705
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9706
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9707
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9708
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9709
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9710
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9711
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9712
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9713
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9714
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9715
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9716
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9717
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9718
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9719
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9720
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9721
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9722
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9723
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9724
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9725
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9726
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9727
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9728
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9729
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9730
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9731
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9732
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9733
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9734
    }/*function_dword_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9735
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9736
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9737
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9738
 *DWORD_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9739
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9740
    case function_dword_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9741
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9742
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9743
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9744
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9745
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9746
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9747
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9748
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9749
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9750
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9751
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9752
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9753
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9754
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9755
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9756
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9757
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9758
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9759
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9760
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9761
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9762
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9763
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9764
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9765
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9766
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9767
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9768
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9769
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9770
    }/*function_dword_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9771
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9772
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9773
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9774
 *DWORD_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9775
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9776
    case function_dword_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9777
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9778
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9779
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9780
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9781
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9782
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9783
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9784
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9785
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9786
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9787
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9788
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9789
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9790
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9791
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9792
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9793
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9794
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9795
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9796
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9797
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9798
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9799
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9800
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9801
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9802
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9803
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9804
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9805
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9806
    }/*function_dword_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9807
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9808
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9809
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9810
 *DWORD_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9811
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9812
    case function_dword_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9813
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9814
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9815
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9816
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9817
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9818
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9819
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9820
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9821
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9822
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9823
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9824
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9825
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9826
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9827
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9828
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9829
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9830
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9831
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9832
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9833
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9834
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9835
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9836
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9837
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9838
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9839
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9840
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9841
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9842
    }/*function_dword_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9843
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9844
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9845
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9846
 *DWORD_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9847
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9848
    case function_dword_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9849
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9850
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9851
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9852
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9853
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9854
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9855
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9856
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9857
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9858
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9859
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9860
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9861
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9862
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9863
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9864
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9865
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9866
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9867
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9868
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9869
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9870
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9871
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9872
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9873
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9874
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9875
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9876
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9877
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9878
    }/*function_dword_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9879
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9880
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9881
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9882
 *DWORD_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9883
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9884
    case function_dword_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9885
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9886
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9887
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9888
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9889
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9890
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9891
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9892
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9893
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9894
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9895
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9896
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9897
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9898
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9899
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9900
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9901
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9902
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9903
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9904
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9905
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9906
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9907
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9908
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9909
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9910
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9911
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9912
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9913
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9914
    }/*function_dword_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9915
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9916
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9917
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9918
 *DWORD_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9919
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9920
    case function_dword_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9921
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9922
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9923
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9924
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9925
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9926
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9927
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9928
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9929
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9930
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9931
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9932
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9933
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9934
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9935
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9936
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9937
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9938
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9939
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9940
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9941
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9942
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9943
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9944
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9945
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9946
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9947
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9948
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9949
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9950
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9951
    }/*function_dword_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9952
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9953
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9954
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9955
 *DWORD_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9956
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9957
    case function_dword_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9958
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9959
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9960
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9961
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9962
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9963
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9964
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9965
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9966
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9967
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9968
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9969
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9970
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9971
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9972
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9973
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9974
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9975
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9976
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9977
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9978
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9979
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9980
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9981
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9982
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9983
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9984
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9985
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9986
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9987
    }/*function_dword_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9988
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9989
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9990
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9991
 *DWORD_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9992
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9993
    case function_dword_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9994
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9995
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9996
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9997
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9998
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
  9999
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10000
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10001
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10002
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10003
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10004
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10005
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10006
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10007
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10008
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10009
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10010
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10011
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10012
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10013
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10014
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10015
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10016
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10017
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10018
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10019
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10020
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10021
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10022
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10023
    }/*function_dword_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10024
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10025
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10026
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10027
 *DWORD_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10028
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10029
    case function_dword_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10030
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10031
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10032
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10033
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10034
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10035
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10036
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10037
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10038
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10039
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10040
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10041
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10042
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10043
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10044
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10045
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10046
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10047
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10048
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10049
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10050
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10051
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10052
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10053
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10054
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10055
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10056
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10057
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10058
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10059
    }/*function_dword_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10060
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10061
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10062
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10063
 *DWORD_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10064
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10065
    case function_dword_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10066
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10067
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10068
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10069
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10070
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10071
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10072
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10073
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10074
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10075
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10076
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10077
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10078
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10079
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10080
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10081
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10082
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10083
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10084
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10085
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10086
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10087
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10088
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10089
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10090
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10091
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10092
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10093
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10094
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10095
    }/*function_dword_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10096
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10097
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10098
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10099
 *DWORD_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10100
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10101
    case function_dword_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10102
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10103
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10104
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10105
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10106
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10107
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10108
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10109
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10110
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10111
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10112
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10113
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10114
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10115
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10116
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10117
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10118
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10119
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10120
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10121
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10122
                s4o.print(")__bit_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10123
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10124
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10125
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10126
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10127
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10128
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10129
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10130
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10131
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10132
    }/*function_dword_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10133
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10134
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10135
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10136
 *DWORD_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10137
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10138
    case function_dword_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10139
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10140
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10141
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10142
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10143
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10144
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10145
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10146
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10147
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10148
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10149
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10150
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10151
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10152
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10153
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10154
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10155
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10156
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10157
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10158
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10159
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10160
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10161
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10162
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10163
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10164
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10165
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10166
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10167
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10168
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10169
    }/*function_dword_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10170
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10171
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10172
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10173
 *DWORD_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10174
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10175
    case function_dword_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10176
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10177
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10178
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10179
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10180
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10181
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10182
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10183
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10184
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10185
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10186
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10187
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10188
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10189
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10190
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10191
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10192
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10193
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10194
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10195
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10196
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10197
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10198
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10199
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10200
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10201
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10202
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10203
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10204
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10205
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10206
    }/*function_dword_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10207
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10208
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10209
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10210
 *DWORD_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10211
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10212
    case function_dword_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10213
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10214
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10215
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10216
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10217
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10218
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10219
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10220
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10221
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10222
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10223
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10224
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10225
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10226
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10227
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10228
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10229
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10230
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10231
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10232
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10233
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10234
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10235
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10236
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10237
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10238
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10239
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10240
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10241
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10242
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10243
    }/*function_dword_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10244
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10245
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10246
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10247
 *LWORD_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10248
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10249
    case function_lword_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10250
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10251
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10252
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10253
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10254
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10255
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10256
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10257
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10258
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10259
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10260
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10261
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10262
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10263
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10264
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10265
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10266
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10267
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10268
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10269
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10270
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10271
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10272
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10273
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10274
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10275
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10276
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10277
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10278
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10279
    }/*function_lword_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10280
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10281
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10282
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10283
 *LWORD_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10284
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10285
    case function_lword_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10286
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10287
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10288
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10289
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10290
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10291
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10292
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10293
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10294
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10295
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10296
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10297
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10298
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10299
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10300
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10301
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10302
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10303
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10304
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10305
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10306
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10307
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10308
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10309
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10310
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10311
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10312
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10313
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10314
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10315
    }/*function_lword_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10316
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10317
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10318
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10319
 *LWORD_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10320
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10321
    case function_lword_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10322
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10323
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10324
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10325
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10326
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10327
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10328
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10329
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10330
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10331
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10332
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10333
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10334
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10335
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10336
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10337
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10338
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10339
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10340
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10341
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10342
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10343
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10344
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10345
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10346
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10347
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10348
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10349
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10350
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10351
    }/*function_lword_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10352
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10353
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10354
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10355
 *LWORD_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10356
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10357
    case function_lword_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10358
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10359
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10360
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10361
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10362
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10363
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10364
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10365
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10366
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10367
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10368
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10369
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10370
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10371
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10372
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10373
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10374
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10375
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10376
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10377
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10378
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10379
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10380
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10381
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10382
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10383
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10384
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10385
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10386
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10387
    }/*function_lword_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10388
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10389
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10390
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10391
 *LWORD_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10392
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10393
    case function_lword_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10394
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10395
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10396
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10397
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10398
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10399
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10400
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10401
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10402
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10403
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10404
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10405
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10406
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10407
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10408
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10409
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10410
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10411
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10412
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10413
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10414
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10415
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10416
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10417
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10418
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10419
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10420
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10421
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10422
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10423
    }/*function_lword_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10424
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10425
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10426
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10427
 *LWORD_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10428
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10429
    case function_lword_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10430
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10431
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10432
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10433
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10434
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10435
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10436
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10437
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10438
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10439
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10440
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10441
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10442
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10443
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10444
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10445
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10446
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10447
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10448
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10449
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10450
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10451
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10452
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10453
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10454
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10455
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10456
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10457
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10458
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10459
    }/*function_lword_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10460
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10461
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10462
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10463
 *LWORD_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10464
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10465
    case function_lword_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10466
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10467
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10468
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10469
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10470
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10471
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10472
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10473
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10474
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10475
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10476
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10477
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10478
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10479
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10480
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10481
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10482
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10483
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10484
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10485
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10486
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10487
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10488
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10489
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10490
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10491
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10492
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10493
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10494
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10495
    }/*function_lword_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10496
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10497
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10498
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10499
 *LWORD_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10500
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10501
    case function_lword_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10502
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10503
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10504
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10505
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10506
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10507
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10508
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10509
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10510
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10511
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10512
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10513
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10514
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10515
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10516
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10517
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10518
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10519
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10520
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10521
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10522
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10523
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10524
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10525
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10526
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10527
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10528
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10529
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10530
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10531
    }/*function_lword_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10532
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10533
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10534
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10535
 *LWORD_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10536
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10537
    case function_lword_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10538
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10539
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10540
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10541
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10542
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10543
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10544
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10545
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10546
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10547
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10548
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10549
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10550
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10551
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10552
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10553
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10554
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10555
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10556
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10557
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10558
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10559
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10560
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10561
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10562
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10563
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10564
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10565
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10566
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10567
    }/*function_lword_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10568
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10569
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10570
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10571
 *LWORD_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10572
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10573
    case function_lword_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10574
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10575
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10576
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10577
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10578
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10579
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10580
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10581
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10582
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10583
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10584
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10585
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10586
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10587
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10588
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10589
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10590
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10591
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10592
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10593
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10594
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10595
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10596
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10597
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10598
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10599
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10600
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10601
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10602
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10603
    }/*function_lword_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10604
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10605
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10606
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10607
 *LWORD_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10608
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10609
    case function_lword_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10610
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10611
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10612
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10613
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10614
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10615
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10616
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10617
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10618
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10619
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10620
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10621
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10622
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10623
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10624
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10625
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10626
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10627
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10628
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10629
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10630
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10631
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10632
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10633
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10634
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10635
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10636
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10637
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10638
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10639
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10640
    }/*function_lword_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10641
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10642
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10643
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10644
 *LWORD_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10645
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10646
    case function_lword_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10647
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10648
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10649
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10650
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10651
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10652
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10653
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10654
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10655
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10656
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10657
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10658
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10659
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10660
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10661
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10662
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10663
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10664
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10665
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10666
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10667
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10668
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10669
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10670
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10671
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10672
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10673
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10674
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10675
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10676
    }/*function_lword_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10677
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10678
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10679
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10680
 *LWORD_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10681
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10682
    case function_lword_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10683
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10684
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10685
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10686
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10687
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10688
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10689
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10690
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10691
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10692
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10693
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10694
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10695
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10696
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10697
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10698
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10699
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10700
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10701
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10702
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10703
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10704
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10705
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10706
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10707
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10708
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10709
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10710
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10711
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10712
    }/*function_lword_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10713
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10714
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10715
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10716
 *LWORD_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10717
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10718
    case function_lword_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10719
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10720
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10721
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10722
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10723
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10724
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10725
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10726
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10727
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10728
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10729
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10730
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10731
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10732
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10733
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10734
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10735
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10736
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10737
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10738
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10739
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10740
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10741
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10742
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10743
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10744
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10745
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10746
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10747
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10748
    }/*function_lword_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10749
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10750
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10751
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10752
 *LWORD_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10753
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10754
    case function_lword_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10755
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10756
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10757
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10758
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10759
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10760
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10761
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10762
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10763
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10764
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10765
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10766
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10767
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10768
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10769
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10770
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10771
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10772
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10773
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10774
                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10775
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10776
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10777
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10778
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10779
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10780
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10781
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10782
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 10783
        
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10784
    }/*function_lword_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10785
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10786
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10787
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10788
 *LWORD_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10789
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10790
    case function_lword_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10791
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10792
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10793
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10794
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10795
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10796
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10797
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10798
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10799
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10800
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10801
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10802
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10803
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10804
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10805
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10806
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10807
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10808
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10809
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10810
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10811
                s4o.print(")__bit_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10812
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10813
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10814
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10815
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10816
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10817
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10818
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10819
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10820
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10821
    }/*function_lword_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10822
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10823
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10824
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10825
 *LWORD_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10826
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10827
    case function_lword_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10828
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10829
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10830
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10831
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10832
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10833
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10834
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10835
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10836
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10837
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10838
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10839
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10840
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10841
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10842
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10843
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10844
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10845
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10846
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10847
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10848
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10849
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10850
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10851
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10852
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10853
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10854
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10855
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10856
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10857
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10858
    }/*function_lword_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10859
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10860
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10861
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10862
 *LWORD_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10863
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10864
    case function_lword_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10865
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10866
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10867
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10868
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10869
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10870
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10871
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10872
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10873
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10874
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10875
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10876
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10877
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10878
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10879
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10880
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10881
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10882
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10883
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10884
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10885
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10886
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10887
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10888
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10889
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10890
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10891
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10892
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10893
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10894
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10895
    }/*function_lword_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10896
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10897
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10898
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10899
 *LWORD_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10900
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10901
    case function_lword_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10902
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10903
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10904
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10905
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10906
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10907
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10908
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10909
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10910
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10911
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10912
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10913
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10914
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10915
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10916
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10917
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10918
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10919
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10920
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10921
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10922
                s4o.print(")__int_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10923
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10924
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10925
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10926
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10927
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10928
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10929
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10930
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10931
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10932
    }/*function_lword_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10933
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10934
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10935
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10936
 *STRING_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10937
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10938
    case function_string_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10939
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10940
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10941
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10942
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10943
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10944
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10945
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10946
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10947
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10948
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10949
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10950
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10951
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10952
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10953
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10954
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10955
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10956
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10957
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10958
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10959
                s4o.print(")__string_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10960
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10961
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10962
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10963
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10964
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10965
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10966
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10967
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10968
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10969
    }/*function_string_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10970
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10971
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10972
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10973
 *STRING_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10974
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10975
    case function_string_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10976
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10977
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10978
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10979
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10980
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10981
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10982
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10983
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10984
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10985
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10986
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10987
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10988
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10989
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10990
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10991
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10992
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10993
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10994
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10995
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10996
                s4o.print(")__string_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10997
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10998
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 10999
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11000
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11001
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11002
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11003
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11004
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11005
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11006
    }/*function_string_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11007
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11008
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11009
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11010
 *STRING_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11011
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11012
    case function_string_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11013
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11014
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11015
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11016
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11017
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11018
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11019
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11020
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11021
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11022
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11023
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11024
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11025
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11026
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11027
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11028
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11029
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11030
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11031
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11032
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11033
                s4o.print(")__string_to_sint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11034
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11035
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11036
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11037
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11038
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11039
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11040
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11041
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11042
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11043
    }/*function_string_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11044
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11045
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11046
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11047
 *STRING_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11048
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11049
    case function_string_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11050
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11051
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11052
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11053
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11054
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11055
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11056
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11057
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11058
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11059
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11060
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11061
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11062
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11063
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11064
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11065
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11066
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11067
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11068
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11069
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11070
                s4o.print(")__string_to_sint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11071
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11072
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11073
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11074
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11075
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11076
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11077
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11078
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11079
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11080
    }/*function_string_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11081
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11082
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11083
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11084
 *STRING_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11085
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11086
    case function_string_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11087
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11088
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11089
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11090
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11091
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11092
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11093
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11094
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11095
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11096
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11097
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11098
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11099
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11100
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11101
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11102
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11103
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11104
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11105
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11106
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11107
                s4o.print(")__string_to_sint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11108
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11109
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11110
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11111
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11112
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11113
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11114
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11115
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11116
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11117
    }/*function_string_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11118
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11119
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11120
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11121
 *STRING_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11122
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11123
    case function_string_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11124
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11125
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11126
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11127
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11128
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11129
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11130
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11131
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11132
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11133
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11134
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11135
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11136
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11137
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11138
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11139
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11140
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11141
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11142
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11143
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11144
                s4o.print(")__string_to_sint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11145
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11146
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11147
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11148
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11149
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11150
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11151
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11152
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11153
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11154
    }/*function_string_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11155
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11156
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11157
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11158
 *STRING_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11159
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11160
    case function_string_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11161
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11162
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11163
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11164
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11165
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11166
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11167
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11168
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11169
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11170
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11171
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11172
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11173
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11174
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11175
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11176
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11177
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11178
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11179
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11180
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11181
                s4o.print(")__string_to_uint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11182
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11183
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11184
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11185
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11186
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11187
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11188
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11189
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11190
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11191
    }/*function_string_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11192
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11193
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11194
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11195
 *STRING_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11196
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11197
    case function_string_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11198
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11199
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11200
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11201
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11202
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11203
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11204
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11205
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11206
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11207
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11208
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11209
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11210
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11211
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11212
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11213
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11214
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11215
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11216
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11217
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11218
                s4o.print(")__string_to_uint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11219
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11220
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11221
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11222
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11223
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11224
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11225
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11226
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11227
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11228
    }/*function_string_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11229
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11230
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11231
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11232
 *STRING_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11233
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11234
    case function_string_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11235
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11236
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11237
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11238
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11239
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11240
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11241
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11242
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11243
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11244
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11245
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11246
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11247
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11248
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11249
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11250
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11251
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11252
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11253
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11254
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11255
                s4o.print(")__string_to_uint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11256
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11257
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11258
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11259
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11260
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11261
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11262
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11263
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11264
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11265
    }/*function_string_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11266
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11267
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11268
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11269
 *STRING_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11270
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11271
    case function_string_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11272
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11273
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11274
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11275
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11276
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11277
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11278
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11279
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11280
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11281
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11282
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11283
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11284
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11285
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11286
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11287
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11288
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11289
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11290
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11291
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11292
                s4o.print(")__string_to_uint(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11293
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11294
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11295
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11296
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11297
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11298
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11299
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11300
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11301
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11302
    }/*function_string_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11303
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11304
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11305
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11306
 *STRING_TO_TIME
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11307
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11308
    case function_string_to_time :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11309
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11310
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11311
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11312
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11313
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11314
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11315
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11316
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11317
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11318
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11319
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11320
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11321
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11322
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11323
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11324
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11325
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11326
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11327
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11328
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11329
                s4o.print(")__string_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11330
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11331
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11332
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11333
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11334
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11335
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11336
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11337
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11338
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11339
    }/*function_string_to_time*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11340
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11341
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11342
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11343
 *STRING_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11344
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11345
    case function_string_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11346
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11347
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11348
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11349
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11350
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11351
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11352
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11353
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11354
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11355
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11356
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11357
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11358
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11359
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11360
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11361
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11362
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11363
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11364
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11365
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11366
                s4o.print(")__string_to_bool(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11367
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11368
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11369
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11370
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11371
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11372
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11373
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11374
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11375
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11376
    }/*function_string_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11377
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11378
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11379
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11380
 *STRING_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11381
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11382
    case function_string_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11383
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11384
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11385
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11386
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11387
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11388
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11389
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11390
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11391
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11392
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11393
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11394
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11395
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11396
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11397
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11398
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11399
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11400
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11401
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11402
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11403
                s4o.print(")__string_to_bit(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11404
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11405
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11406
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11407
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11408
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11409
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11410
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11411
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11412
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11413
    }/*function_string_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11414
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11415
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11416
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11417
 *STRING_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11418
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11419
    case function_string_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11420
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11421
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11422
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11423
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11424
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11425
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11426
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11427
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11428
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11429
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11430
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11431
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11432
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11433
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11434
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11435
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11436
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11437
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11438
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11439
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11440
                s4o.print(")__string_to_bit(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11441
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11442
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11443
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11444
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11445
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11446
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11447
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11448
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11449
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11450
    }/*function_string_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11451
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11452
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11453
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11454
 *STRING_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11455
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11456
    case function_string_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11457
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11458
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11459
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11460
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11461
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11462
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11463
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11464
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11465
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11466
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11467
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11468
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11469
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11470
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11471
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11472
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11473
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11474
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11475
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11476
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11477
                s4o.print(")__string_to_bit(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11478
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11479
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11480
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11481
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11482
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11483
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11484
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11485
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11486
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11487
    }/*function_string_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11488
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11489
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11490
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11491
 *STRING_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11492
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11493
    case function_string_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11494
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11495
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11496
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11497
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11498
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11499
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11500
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11501
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11502
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11503
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11504
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11505
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11506
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11507
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11508
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 11509
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 11510
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 11511
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 11512
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 11513
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11514
                s4o.print(")__string_to_bit(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11515
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11516
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11517
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11518
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11519
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11520
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11521
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11522
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11523
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11524
    }/*function_string_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11525
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11526
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11527
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11528
 *STRING_TO_DATE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11529
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11530
    case function_string_to_date :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11531
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11532
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11533
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11534
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11535
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11536
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11537
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11538
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11539
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11540
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11541
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11542
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11543
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11544
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11545
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11546
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11547
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11548
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11549
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11550
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11551
                s4o.print(")__string_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11552
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11553
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11554
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11555
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11556
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11557
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11558
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11559
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11560
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11561
    }/*function_string_to_date*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11562
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11563
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11564
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11565
 *STRING_TO_TOD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11566
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11567
    case function_string_to_tod :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11568
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11569
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11570
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11571
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11572
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11573
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11574
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11575
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11576
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11577
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11578
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11579
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11580
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11581
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11582
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11583
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11584
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11585
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11586
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11587
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11588
                s4o.print(")__string_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11589
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11590
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11591
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11592
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11593
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11594
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11595
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11596
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11597
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11598
    }/*function_string_to_tod*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11599
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11600
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11601
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11602
 *STRING_TO_DT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11603
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11604
    case function_string_to_dt :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11605
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11606
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11607
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11608
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11609
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11610
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11611
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11612
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11613
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11614
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11615
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11616
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11617
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11618
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11619
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11620
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11621
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11622
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11623
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11624
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11625
                s4o.print(")__string_to_time(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11626
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11627
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11628
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11629
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11630
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11631
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11632
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11633
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11634
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11635
    }/*function_string_to_dt*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11636
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11637
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11638
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11639
 *DATE_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11640
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11641
    case function_date_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11642
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11643
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11644
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11645
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11646
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11647
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11648
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11649
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11650
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11651
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11652
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11653
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11654
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11655
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11656
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11657
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11658
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11659
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11660
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11661
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11662
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11663
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11664
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11665
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11666
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11667
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11668
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11669
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11670
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11671
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11672
    }/*function_date_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11673
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11674
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11675
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11676
 *DATE_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11677
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11678
    case function_date_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11679
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11680
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11681
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11682
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11683
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11684
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11685
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11686
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11687
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11688
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11689
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11690
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11691
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11692
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11693
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11694
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11695
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11696
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11697
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11698
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11699
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11700
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11701
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11702
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11703
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11704
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11705
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11706
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11707
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11708
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11709
    }/*function_date_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11710
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11711
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11712
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11713
 *DATE_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11714
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11715
    case function_date_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11716
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11717
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11718
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11719
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11720
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11721
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11722
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11723
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11724
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11725
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11726
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11727
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11728
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11729
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11730
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11731
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11732
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11733
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11734
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11735
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11736
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11737
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11738
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11739
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11740
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11741
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11742
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11743
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11744
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11745
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11746
    }/*function_date_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11747
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11748
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11749
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11750
 *DATE_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11751
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11752
    case function_date_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11753
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11754
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11755
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11756
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11757
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11758
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11759
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11760
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11761
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11762
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11763
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11764
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11765
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11766
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11767
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11768
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11769
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11770
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11771
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11772
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11773
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11774
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11775
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11776
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11777
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11778
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11779
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11780
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11781
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11782
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11783
    }/*function_date_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11784
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11785
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11786
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11787
 *DATE_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11788
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11789
    case function_date_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11790
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11791
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11792
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11793
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11794
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11795
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11796
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11797
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11798
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11799
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11800
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11801
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11802
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11803
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11804
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11805
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11806
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11807
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11808
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11809
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11810
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11811
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11812
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11813
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11814
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11815
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11816
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11817
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11818
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11819
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11820
    }/*function_date_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11821
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11822
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11823
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11824
 *DATE_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11825
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11826
    case function_date_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11827
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11828
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11829
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11830
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11831
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11832
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11833
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11834
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11835
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11836
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11837
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11838
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11839
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11840
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11841
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11842
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11843
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11844
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11845
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11846
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11847
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11848
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11849
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11850
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11851
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11852
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11853
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11854
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11855
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11856
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11857
    }/*function_date_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11858
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11859
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11860
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11861
 *DATE_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11862
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11863
    case function_date_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11864
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11865
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11866
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11867
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11868
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11869
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11870
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11871
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11872
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11873
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11874
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11875
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11876
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11877
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11878
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11879
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11880
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11881
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11882
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11883
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11884
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11885
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11886
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11887
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11888
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11889
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11890
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11891
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11892
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11893
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11894
    }/*function_date_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11895
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11896
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11897
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11898
 *DATE_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11899
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11900
    case function_date_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11901
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11902
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11903
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11904
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11905
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11906
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11907
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11908
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11909
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11910
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11911
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11912
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11913
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11914
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11915
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11916
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11917
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11918
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11919
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11920
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11921
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11922
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11923
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11924
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11925
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11926
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11927
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11928
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11929
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11930
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11931
    }/*function_date_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11932
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11933
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11934
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11935
 *DATE_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11936
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11937
    case function_date_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11938
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11939
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11940
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11941
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11942
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11943
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11944
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11945
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11946
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11947
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11948
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11949
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11950
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11951
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11952
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11953
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11954
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11955
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11956
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11957
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11958
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11959
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11960
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11961
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11962
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11963
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11964
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11965
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11966
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11967
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11968
    }/*function_date_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11969
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11970
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11971
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11972
 *DATE_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11973
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11974
    case function_date_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11975
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11976
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11977
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11978
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11979
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11980
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11981
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11982
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11983
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11984
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11985
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11986
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11987
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11988
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11989
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11990
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11991
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11992
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11993
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11994
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11995
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11996
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11997
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11998
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 11999
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12000
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12001
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12002
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12003
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12004
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12005
    }/*function_date_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12006
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12007
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12008
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12009
 *DATE_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12010
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12011
    case function_date_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12012
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12013
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12014
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12015
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12016
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12017
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12018
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12019
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12020
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12021
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12022
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12023
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12024
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12025
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12026
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12027
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12028
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12029
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12030
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12031
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12032
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12033
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12034
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12035
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12036
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12037
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12038
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12039
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12040
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12041
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12042
    }/*function_date_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12043
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12044
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12045
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12046
 *DATE_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12047
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12048
    case function_date_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12049
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12050
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12051
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12052
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12053
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12054
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12055
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12056
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12057
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12058
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12059
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12060
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12061
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12062
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12063
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12064
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12065
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12066
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12067
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12068
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12069
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12070
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12071
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12072
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12073
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12074
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12075
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12076
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12077
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12078
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12079
    }/*function_date_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12080
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12081
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12082
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12083
 *DATE_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12084
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12085
    case function_date_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12086
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12087
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12088
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12089
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12090
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12091
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12092
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12093
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12094
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12095
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12096
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12097
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12098
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12099
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12100
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12101
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12102
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12103
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12104
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12105
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12106
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12107
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12108
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12109
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12110
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12111
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12112
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12113
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12114
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12115
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12116
    }/*function_date_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12117
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12118
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12119
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12120
 *DATE_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12121
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12122
    case function_date_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12123
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12124
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12125
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12126
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12127
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12128
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12129
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12130
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12131
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12132
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12133
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12134
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12135
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12136
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12137
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12138
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12139
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12140
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12141
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12142
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12143
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12144
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12145
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12146
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12147
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12148
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12149
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12150
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12151
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12152
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12153
    }/*function_date_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12154
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12155
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12156
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12157
 *DATE_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12158
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12159
    case function_date_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12160
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12161
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12162
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12163
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12164
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12165
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12166
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12167
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12168
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12169
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12170
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12171
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12172
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12173
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12174
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12175
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12176
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12177
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12178
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12179
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12180
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12181
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12182
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12183
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12184
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12185
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12186
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12187
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12188
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12189
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12190
    }/*function_date_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12191
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12192
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12193
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12194
 *DATE_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12195
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12196
    case function_date_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12197
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12198
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12199
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12200
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12201
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12202
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12203
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12204
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12205
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12206
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12207
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12208
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12209
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12210
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12211
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12212
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12213
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12214
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12215
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12216
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12217
                s4o.print(")__date_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12218
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12219
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12220
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12221
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12222
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12223
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12224
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12225
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12226
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12227
    }/*function_date_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12228
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12229
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12230
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12231
 *TOD_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12232
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12233
    case function_tod_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12234
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12235
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12236
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12237
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12238
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12239
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12240
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12241
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12242
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12243
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12244
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12245
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12246
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12247
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12248
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12249
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12250
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12251
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12252
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12253
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12254
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12255
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12256
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12257
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12258
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12259
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12260
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12261
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12262
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12263
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12264
    }/*function_tod_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12265
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12266
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12267
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12268
 *TOD_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12269
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12270
    case function_tod_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12271
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12272
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12273
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12274
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12275
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12276
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12277
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12278
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12279
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12280
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12281
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12282
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12283
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12284
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12285
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12286
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12287
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12288
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12289
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12290
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12291
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12292
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12293
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12294
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12295
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12296
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12297
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12298
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12299
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12300
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12301
    }/*function_tod_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12302
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12303
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12304
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12305
 *TOD_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12306
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12307
    case function_tod_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12308
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12309
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12310
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12311
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12312
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12313
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12314
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12315
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12316
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12317
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12318
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12319
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12320
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12321
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12322
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12323
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12324
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12325
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12326
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12327
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12328
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12329
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12330
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12331
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12332
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12333
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12334
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12335
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12336
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12337
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12338
    }/*function_tod_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12339
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12340
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12341
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12342
 *TOD_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12343
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12344
    case function_tod_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12345
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12346
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12347
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12348
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12349
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12350
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12351
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12352
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12353
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12354
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12355
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12356
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12357
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12358
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12359
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12360
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12361
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12362
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12363
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12364
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12365
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12366
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12367
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12368
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12369
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12370
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12371
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12372
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12373
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12374
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12375
    }/*function_tod_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12376
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12377
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12378
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12379
 *TOD_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12380
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12381
    case function_tod_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12382
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12383
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12384
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12385
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12386
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12387
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12388
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12389
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12390
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12391
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12392
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12393
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12394
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12395
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12396
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12397
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12398
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12399
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12400
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12401
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12402
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12403
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12404
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12405
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12406
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12407
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12408
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12409
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12410
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12411
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12412
    }/*function_tod_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12413
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12414
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12415
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12416
 *TOD_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12417
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12418
    case function_tod_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12419
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12420
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12421
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12422
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12423
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12424
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12425
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12426
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12427
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12428
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12429
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12430
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12431
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12432
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12433
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12434
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12435
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12436
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12437
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12438
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12439
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12440
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12441
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12442
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12443
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12444
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12445
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12446
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12447
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12448
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12449
    }/*function_tod_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12450
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12451
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12452
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12453
 *TOD_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12454
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12455
    case function_tod_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12456
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12457
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12458
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12459
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12460
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12461
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12462
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12463
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12464
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12465
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12466
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12467
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12468
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12469
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12470
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12471
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12472
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12473
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12474
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12475
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12476
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12477
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12478
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12479
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12480
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12481
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12482
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12483
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12484
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12485
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12486
    }/*function_tod_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12487
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12488
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12489
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12490
 *TOD_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12491
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12492
    case function_tod_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12493
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12494
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12495
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12496
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12497
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12498
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12499
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12500
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12501
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12502
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12503
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12504
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12505
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12506
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12507
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12508
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12509
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12510
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12511
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12512
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12513
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12514
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12515
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12516
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12517
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12518
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12519
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12520
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12521
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12522
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12523
    }/*function_tod_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12524
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12525
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12526
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12527
 *TOD_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12528
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12529
    case function_tod_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12530
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12531
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12532
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12533
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12534
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12535
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12536
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12537
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12538
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12539
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12540
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12541
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12542
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12543
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12544
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12545
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12546
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12547
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12548
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12549
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12550
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12551
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12552
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12553
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12554
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12555
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12556
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12557
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12558
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12559
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12560
    }/*function_tod_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12561
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12562
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12563
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12564
 *TOD_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12565
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12566
    case function_tod_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12567
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12568
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12569
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12570
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12571
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12572
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12573
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12574
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12575
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12576
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12577
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12578
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12579
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12580
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12581
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12582
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12583
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12584
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12585
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12586
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12587
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12588
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12589
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12590
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12591
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12592
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12593
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12594
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12595
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12596
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12597
    }/*function_tod_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12598
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12599
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12600
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12601
 *TOD_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12602
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12603
    case function_tod_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12604
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12605
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12606
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12607
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12608
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12609
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12610
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12611
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12612
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12613
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12614
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12615
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12616
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12617
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12618
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12619
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12620
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12621
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12622
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12623
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12624
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12625
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12626
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12627
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12628
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12629
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12630
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12631
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12632
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12633
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12634
    }/*function_tod_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12635
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12636
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12637
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12638
 *TOD_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12639
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12640
    case function_tod_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12641
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12642
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12643
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12644
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12645
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12646
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12647
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12648
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12649
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12650
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12651
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12652
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12653
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12654
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12655
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12656
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12657
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12658
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12659
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12660
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12661
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12662
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12663
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12664
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12665
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12666
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12667
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12668
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12669
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12670
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12671
    }/*function_tod_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12672
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12673
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12674
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12675
 *TOD_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12676
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12677
    case function_tod_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12678
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12679
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12680
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12681
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12682
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12683
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12684
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12685
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12686
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12687
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12688
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12689
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12690
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12691
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12692
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12693
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12694
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12695
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12696
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12697
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12698
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12699
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12700
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12701
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12702
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12703
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12704
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12705
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12706
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12707
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12708
    }/*function_tod_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12709
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12710
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12711
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12712
 *TOD_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12713
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12714
    case function_tod_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12715
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12716
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12717
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12718
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12719
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12720
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12721
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12722
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12723
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12724
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12725
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12726
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12727
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12728
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12729
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12730
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12731
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12732
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12733
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12734
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12735
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12736
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12737
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12738
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12739
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12740
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12741
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12742
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12743
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12744
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12745
    }/*function_tod_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12746
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12747
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12748
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12749
 *TOD_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12750
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12751
    case function_tod_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12752
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12753
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12754
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12755
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12756
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12757
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12758
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12759
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12760
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12761
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12762
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12763
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12764
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12765
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12766
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12767
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12768
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12769
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12770
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12771
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12772
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12773
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12774
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12775
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12776
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12777
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12778
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12779
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12780
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12781
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12782
    }/*function_tod_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12783
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12784
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12785
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12786
 *TOD_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12787
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12788
    case function_tod_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12789
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12790
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12791
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12792
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12793
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12794
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12795
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12796
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12797
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12798
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12799
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12800
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12801
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12802
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12803
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12804
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12805
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12806
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12807
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12808
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12809
                s4o.print(")__tod_to_string(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12810
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12811
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12812
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12813
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12814
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12815
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12816
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12817
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12818
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12819
    }/*function_tod_to_string*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12820
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12821
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12822
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12823
 *DT_TO_REAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12824
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12825
    case function_dt_to_real :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12826
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12827
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12828
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12829
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12830
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12831
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12832
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12833
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12834
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12835
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12836
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12837
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12838
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12839
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12840
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12841
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12842
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12843
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12844
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12845
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12846
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12847
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12848
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12849
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12850
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12851
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12852
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12853
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12854
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12855
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12856
    }/*function_dt_to_real*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12857
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12858
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12859
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12860
 *DT_TO_LREAL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12861
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12862
    case function_dt_to_lreal :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12863
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12864
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12865
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12866
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12867
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12868
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12869
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12870
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12871
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12872
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12873
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12874
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12875
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12876
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12877
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12878
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12879
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12880
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12881
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12882
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12883
                s4o.print(")__time_to_real(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12884
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12885
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12886
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12887
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12888
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12889
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12890
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12891
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12892
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12893
    }/*function_dt_to_lreal*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12894
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12895
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12896
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12897
 *DT_TO_SINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12898
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12899
    case function_dt_to_sint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12900
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12901
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12902
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12903
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12904
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12905
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12906
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12907
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12908
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12909
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12910
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12911
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12912
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12913
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12914
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12915
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12916
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12917
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12918
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12919
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12920
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12921
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12922
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12923
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12924
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12925
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12926
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12927
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12928
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12929
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12930
    }/*function_dt_to_sint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12931
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12932
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12933
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12934
 *DT_TO_INT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12935
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12936
    case function_dt_to_int :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12937
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12938
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12939
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12940
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12941
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12942
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12943
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12944
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12945
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12946
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12947
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12948
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12949
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12950
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12951
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12952
            {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12953
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12954
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12955
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12956
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12957
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12958
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12959
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12960
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12961
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12962
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12963
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12964
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12965
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12966
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12967
    }/*function_dt_to_int*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12968
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12969
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12970
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12971
 *DT_TO_DINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12972
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12973
    case function_dt_to_dint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12974
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12975
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12976
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12977
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12978
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12979
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12980
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12981
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12982
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12983
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12984
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12985
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12986
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12987
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12988
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12989
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12990
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12991
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12992
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 12993
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12994
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12995
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12996
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12997
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12998
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 12999
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13000
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13001
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13002
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13003
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13004
    }/*function_dt_to_dint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13005
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13006
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13007
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13008
 *DT_TO_LINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13009
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13010
    case function_dt_to_lint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13011
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13012
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13013
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13014
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13015
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13016
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13017
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13018
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13019
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13020
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13021
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13022
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13023
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13024
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13025
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13026
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13027
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13028
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13029
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13030
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13031
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13032
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13033
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13034
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13035
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13036
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13037
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13038
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13039
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13040
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13041
    }/*function_dt_to_lint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13042
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13043
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13044
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13045
 *DT_TO_USINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13046
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13047
    case function_dt_to_usint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13048
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13049
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13050
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13051
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13052
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13053
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13054
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13055
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13056
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13057
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13058
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13059
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13060
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13061
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13062
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13063
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13064
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13065
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13066
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13067
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13068
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13069
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13070
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13071
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13072
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13073
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13074
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13075
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13076
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13077
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13078
    }/*function_dt_to_usint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13079
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13080
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13081
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13082
 *DT_TO_UINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13083
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13084
    case function_dt_to_uint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13085
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13086
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13087
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13088
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13089
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13090
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13091
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13092
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13093
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13094
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13095
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13096
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13097
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13098
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13099
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13100
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13101
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13102
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13103
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13104
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13105
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13106
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13107
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13108
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13109
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13110
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13111
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13112
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13113
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13114
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13115
    }/*function_dt_to_uint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13116
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13117
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13118
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13119
 *DT_TO_UDINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13120
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13121
    case function_dt_to_udint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13122
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13123
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13124
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13125
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13126
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13127
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13128
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13129
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13130
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13131
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13132
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13133
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13134
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13135
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13136
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13137
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13138
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13139
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13140
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13141
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13142
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13143
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13144
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13145
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13146
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13147
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13148
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13149
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13150
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13151
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13152
    }/*function_dt_to_udint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13153
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13154
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13155
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13156
 *DT_TO_ULINT
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13157
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13158
    case function_dt_to_ulint :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13159
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13160
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13161
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13162
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13163
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13164
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13165
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13166
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13167
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13168
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13169
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13170
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13171
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13172
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13173
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13174
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13175
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13176
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13177
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13178
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13179
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13180
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13181
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13182
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13183
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13184
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13185
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13186
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13187
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13188
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13189
    }/*function_dt_to_ulint*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13190
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13191
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13192
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13193
 *DT_TO_BOOL
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13194
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13195
    case function_dt_to_bool :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13196
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13197
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13198
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13199
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13200
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13201
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13202
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13203
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13204
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13205
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13206
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13207
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13208
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13209
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13210
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13211
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13212
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13213
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13214
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13215
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13216
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13217
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13218
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13219
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13220
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13221
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13222
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13223
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13224
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13225
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13226
    }/*function_dt_to_bool*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13227
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13228
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13229
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13230
 *DT_TO_BYTE
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13231
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13232
    case function_dt_to_byte :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13233
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13234
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13235
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13236
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13237
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13238
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13239
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13240
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13241
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13242
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13243
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13244
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13245
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13246
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13247
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13248
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13249
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13250
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13251
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13252
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13253
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13254
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13255
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13256
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13257
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13258
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13259
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13260
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13261
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13262
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13263
    }/*function_dt_to_byte*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13264
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13265
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13266
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13267
 *DT_TO_WORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13268
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13269
    case function_dt_to_word :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13270
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13271
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13272
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13273
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13274
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13275
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13276
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13277
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13278
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13279
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13280
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13281
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13282
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13283
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13284
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13285
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13286
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13287
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13288
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13289
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13290
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13291
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13292
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13293
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13294
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13295
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13296
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13297
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13298
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13299
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13300
    }/*function_dt_to_word*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13301
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13302
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13303
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13304
 *DT_TO_DWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13305
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13306
    case function_dt_to_dword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13307
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13308
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13309
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13310
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13311
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13312
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13313
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13314
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13315
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13316
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13317
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13318
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13319
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13320
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13321
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13322
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13323
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13324
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13325
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13326
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13327
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13328
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13329
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13330
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13331
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13332
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13333
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13334
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13335
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13336
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13337
    }/*function_dt_to_dword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13338
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13339
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13340
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13341
 *DT_TO_LWORD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13342
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13343
    case function_dt_to_lword :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13344
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13345
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13346
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13347
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13348
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13349
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13350
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13351
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13352
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13353
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13354
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13355
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13356
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13357
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13358
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13359
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13360
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13361
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13362
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13363
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13364
                s4o.print(")__time_to_int(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13365
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13366
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13367
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13368
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13369
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13370
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13371
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13372
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13373
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13374
    }/*function_dt_to_lword*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13375
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13376
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13377
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13378
 *DT_TO_STRING
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13379
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13380
    case function_dt_to_string :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13381
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13382
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13383
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13384
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13385
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13386
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13387
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13388
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13389
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13390
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13391
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13392
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13393
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13394
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13395
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13396
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13397
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13398
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13399
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13400
                return_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13401
                s4o.print(")__dt_to_string(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13402
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13403
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13404
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13405
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13406
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13407
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13408
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13409
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13410
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13411
    }/*function_dt_to_string*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13412
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13413
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13414
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13415
 *TRUNC
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13416
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13417
    case function_trunc :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13418
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13419
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13420
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13421
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13422
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13423
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13424
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13425
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13426
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13427
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13428
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13429
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13430
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13431
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13432
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13433
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13434
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13435
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13436
                s4o.print("(int)");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13437
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13438
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13439
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13440
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13441
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13442
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13443
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13444
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13445
    }/*function_trunc*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13446
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13447
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13448
/****
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13449
 *BCD_TO_USINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13450
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13451
    case function_bcd_to_usint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13452
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13453
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13454
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13455
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13456
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13457
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13458
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13459
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13460
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13461
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13462
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13463
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13464
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13465
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13466
            if (typeid(*last_type_symbol) == typeid(byte_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13467
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13468
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13469
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13470
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13471
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13472
                s4o.print(")__bcd_to_uint(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13473
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13474
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13475
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13476
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13477
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13478
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13479
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13480
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13481
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13482
    }/*function_bcd_to_usint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13483
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13484
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13485
/****
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13486
 *BCD_TO_UINT
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13487
 */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13488
    case function_bcd_to_uint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13489
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13490
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13491
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13492
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13493
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13494
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13495
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13496
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13497
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13498
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13499
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13500
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13501
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13502
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13503
            if (typeid(*last_type_symbol) == typeid(word_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13504
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13505
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13506
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13507
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13508
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13509
                s4o.print(")__bcd_to_uint(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13510
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13511
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13512
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13513
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13514
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13515
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13516
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13517
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13518
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13519
    }/*function_bcd_to_uint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13520
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13521
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13522
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13523
 *BCD_TO_UDINT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13524
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13525
    case function_bcd_to_udint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13526
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13527
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13528
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13529
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13530
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13531
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13532
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13533
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13534
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13535
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13536
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13537
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13538
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13539
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13540
            if (typeid(*last_type_symbol) == typeid(dword_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13541
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13542
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13543
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13544
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13545
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13546
                s4o.print(")__bcd_to_uint(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13547
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13548
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13549
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13550
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13551
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13552
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13553
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13554
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13555
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13556
    }/*function_bcd_to_udint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13557
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13558
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13559
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13560
 *BCD_TO_ULINT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13561
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13562
    case function_bcd_to_ulint :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13563
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13564
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13565
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13566
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13567
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13568
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13569
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13570
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13571
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13572
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13573
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13574
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13575
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13576
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13577
            if (typeid(*last_type_symbol) == typeid(lword_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13578
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13579
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13580
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13581
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13582
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13583
                s4o.print(")__bcd_to_uint(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13584
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13585
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13586
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13587
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13588
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13589
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13590
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13591
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13592
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13593
    }/*function_bcd_to_ulint*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13594
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13595
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13596
/****
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13597
 *USINT_TO_BCD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13598
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13599
    case function_usint_to_bcd :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13600
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13601
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13602
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13603
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13604
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13605
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13606
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13607
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13608
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13609
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13610
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13611
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13612
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13613
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13614
            if (typeid(*last_type_symbol) == typeid(usint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13615
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13616
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13617
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13618
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13619
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13620
                s4o.print(")__uint_to_bcd(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13621
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13622
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13623
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13624
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13625
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13626
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13627
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13628
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13629
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13630
    }/*function_usint_to_bcd*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13631
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13632
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13633
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13634
 *UINT_TO_BCD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13635
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13636
    case function_uint_to_bcd :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13637
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13638
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13639
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13640
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13641
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13642
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13643
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13644
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13645
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13646
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13647
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13648
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13649
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13650
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13651
            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13652
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13653
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13654
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13655
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13656
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13657
                s4o.print(")__uint_to_bcd(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13658
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13659
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13660
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13661
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13662
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13663
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13664
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13665
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13666
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13667
    }/*function_uint_to_bcd*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13668
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13669
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13670
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13671
 *UDINT_TO_BCD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13672
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13673
    case function_udint_to_bcd :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13674
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13675
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13676
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13677
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13678
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13679
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13680
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13681
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13682
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13683
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13684
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13685
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13686
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13687
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13688
            if (typeid(*last_type_symbol) == typeid(udint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13689
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13690
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13691
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13692
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13693
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13694
                s4o.print(")__uint_to_bcd(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13695
                IN_param_value->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13696
                s4o.print(")");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13697
                return NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13698
                
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13699
            }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13700
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13701
            ERROR;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13702
        }
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13703
        
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13704
    }/*function_udint_to_bcd*/
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13705
    break;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13706
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13707
/****
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13708
 *ULINT_TO_BCD
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13709
 */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13710
    case function_ulint_to_bcd :
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13711
    {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13712
        symbol_c *last_type_symbol = NULL;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13713
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13714
        {
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13715
            identifier_c param_name("IN");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13716
            /* Get the value from a foo(<param_name> = <param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13717
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13718
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13719
            /* Get the value from a foo(<param_value>) style call */
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13720
            if (IN_param_value == NULL)
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13721
              IN_param_value = function_call_param_iterator.next();
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13722
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13723
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13724
            
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13725
            if (typeid(*last_type_symbol) == typeid(ulint_type_name_c))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13726
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13727
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13728
                symbol_c * return_type_symbol = &search_constant_type_c::constant_int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13729
                s4o.print("(");
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13730
                return_type_symbol->accept(*this);
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13731
                s4o.print(")__uint_to_bcd(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13732
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13733
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13734
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13735
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13736
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13737
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13738
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13739
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13740
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13741
    }/*function_ulint_to_bcd*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13742
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13743
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13744
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13745
 *DATE_AND_TIME_TO_TIME_OF_DAY
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13746
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13747
    case function_date_and_time_to_time_of_day :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13748
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13749
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13750
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13751
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13752
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13753
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13754
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13755
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13756
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13757
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13758
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13759
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13760
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13761
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13762
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13763
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13764
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13765
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13766
                s4o.print("__date_and_time_to_time_of_day(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13767
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13768
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13769
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13770
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13771
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13772
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13773
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13774
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13775
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13776
    }/*function_date_and_time_to_time_of_day*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13777
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13778
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13779
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13780
 *DATE_AND_TIME_TO_DATE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13781
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13782
    case function_date_and_time_to_date :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13783
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13784
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13785
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13786
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13787
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13788
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13789
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13790
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13791
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13792
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13793
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13794
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13795
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13796
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13797
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13798
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13799
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13800
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 13801
                s4o.print("__date_and_time_to_date(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13802
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13803
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13804
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13805
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13806
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13807
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13808
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13809
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13810
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13811
    }/*function_date_and_time_to_date*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13812
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13813
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13814
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13815
 *ABS
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13816
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13817
    case function_abs :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13818
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13819
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13820
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13821
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13822
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13823
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13824
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13825
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13826
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13827
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13828
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13829
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13830
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13831
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13832
            if(search_expression_type->is_num_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13833
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13834
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13835
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13836
                s4o.print("__abs_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13837
                IN_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13838
                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13839
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13840
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13841
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13842
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13843
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13844
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13845
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13846
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13847
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13848
    }/*function_abs*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13849
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13850
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13851
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13852
 *SQRT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13853
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13854
    case function_sqrt :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13855
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13856
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13857
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13858
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13859
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13860
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13861
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13862
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13863
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13864
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13865
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13866
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13867
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13868
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13869
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13870
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13871
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13872
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13873
                s4o.print("sqrt(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13874
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13875
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13876
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13877
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13878
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13879
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13880
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13881
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13882
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13883
    }/*function_sqrt*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13884
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13885
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13886
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13887
 *LN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13888
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13889
    case function_ln :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13890
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13891
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13892
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13893
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13894
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13895
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13896
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13897
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13898
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13899
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13900
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13901
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13902
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13903
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13904
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13905
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13906
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13907
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13908
                s4o.print("ln(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13909
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13910
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13911
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13912
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13913
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13914
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13915
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13916
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13917
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13918
    }/*function_ln*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13919
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13920
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13921
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13922
 *LOG
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13923
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13924
    case function_log :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13925
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13926
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13927
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13928
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13929
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13930
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13931
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13932
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13933
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13934
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13935
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13936
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13937
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13938
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13939
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13940
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13941
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13942
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13943
                s4o.print("log(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13944
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13945
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13946
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13947
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13948
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13949
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13950
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13951
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13952
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13953
    }/*function_log*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13954
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13955
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13956
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13957
 *EXP
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13958
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13959
    case function_exp :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13960
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13961
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13962
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13963
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13964
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13965
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13966
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13967
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13968
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13969
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13970
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13971
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13972
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13973
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13974
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13975
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13976
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13977
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13978
                s4o.print("exp(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13979
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13980
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13981
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13982
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13983
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13984
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13985
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13986
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13987
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13988
    }/*function_exp*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13989
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13990
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13991
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13992
 *SIN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 13993
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13994
    case function_sin :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13995
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13996
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13997
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13998
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 13999
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14000
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14001
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14002
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14003
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14004
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14005
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14006
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14007
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14008
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14009
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14010
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14011
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14012
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14013
                s4o.print("sin(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14014
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14015
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14016
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14017
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14018
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14019
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14020
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14021
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14022
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14023
    }/*function_sin*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14024
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14025
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14026
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14027
 *COS
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14028
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14029
    case function_cos :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14030
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14031
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14032
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14033
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14034
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14035
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14036
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14037
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14038
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14039
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14040
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14041
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14042
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14043
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14044
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14045
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14046
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14047
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14048
                s4o.print("cos(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14049
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14050
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14051
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14052
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14053
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14054
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14055
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14056
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14057
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14058
    }/*function_cos*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14059
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14060
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14061
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14062
 *TAN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14063
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14064
    case function_tan :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14065
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14066
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14067
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14068
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14069
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14070
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14071
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14072
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14073
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14074
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14075
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14076
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14077
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14078
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14079
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14080
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14081
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14082
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14083
                s4o.print("tan(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14084
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14085
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14086
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14087
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14088
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14089
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14090
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14091
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14092
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14093
    }/*function_tan*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14094
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14095
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14096
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14097
 *ASIN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14098
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14099
    case function_asin :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14100
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14101
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14102
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14103
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14104
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14105
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14106
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14107
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14108
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14109
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14110
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14111
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14112
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14113
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14114
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14115
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14116
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14117
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14118
                s4o.print("asin(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14119
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14120
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14121
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14122
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14123
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14124
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14125
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14126
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14127
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14128
    }/*function_asin*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14129
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14130
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14131
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14132
 *ACOS
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14133
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14134
    case function_acos :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14135
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14136
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14137
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14138
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14139
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14140
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14141
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14142
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14143
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14144
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14145
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14146
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14147
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14148
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14149
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14150
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14151
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14152
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14153
                s4o.print("acos(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14154
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14155
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14156
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14157
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14158
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14159
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14160
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14161
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14162
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14163
    }/*function_acos*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14164
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14165
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14166
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14167
 *ATAN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14168
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14169
    case function_atan :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14170
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14171
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14172
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14173
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14174
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14175
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14176
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14177
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14178
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14179
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14180
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14181
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14182
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14183
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14184
            if(search_expression_type->is_real_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14185
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14186
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14187
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14188
                s4o.print("atan(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14189
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14190
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14191
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14192
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14193
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14194
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14195
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14196
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14197
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14198
    }/*function_atan*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14199
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14200
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14201
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14202
 *ADD
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14203
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14204
    case function_add :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14205
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14206
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14207
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14208
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14209
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14210
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14211
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14212
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14213
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14214
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14215
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14216
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14217
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14218
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14219
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14220
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14221
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14222
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14223
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14224
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14225
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14226
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14227
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14228
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14229
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14230
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14231
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14232
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14233
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14234
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14235
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14236
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14237
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14238
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14239
                        s4o.print("+");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14240
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14241
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14242
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14243
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14244
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14245
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14246
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14247
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14248
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14249
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14250
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14251
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14252
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14253
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14254
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14255
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14256
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14257
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14258
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14259
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14260
                                s4o.print("+");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14261
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14262
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14263
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14264
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14265
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14266
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14267
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14268
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14269
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14270
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14271
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14272
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14273
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14274
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14275
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14276
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14277
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14278
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14279
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14280
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14281
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14282
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14283
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14284
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14285
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14286
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14287
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14288
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14289
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14290
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14291
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14292
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14293
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14294
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14295
                        s4o.print("__time_add(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14296
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14297
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14298
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14299
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14300
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14301
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14302
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14303
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14304
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14305
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14306
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14307
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14308
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14309
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14310
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14311
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14312
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14313
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14314
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14315
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14316
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14317
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14318
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14319
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14320
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14321
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14322
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14323
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14324
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14325
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14326
                        symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14327
                        s4o.print("__time_add(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14328
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14329
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14330
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14331
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14332
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14333
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14334
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14335
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14336
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14337
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14338
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14339
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14340
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14341
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14342
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14343
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14344
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14345
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14346
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14347
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14348
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14349
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14350
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14351
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14352
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14353
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14354
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14355
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14356
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14357
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14358
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14359
                        s4o.print("__time_add(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14360
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14361
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14362
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14363
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14364
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14365
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14366
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14367
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14368
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14369
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14370
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14371
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14372
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14373
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14374
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14375
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14376
    }/*function_add*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14377
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14378
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14379
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14380
 *MUL
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14381
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14382
    case function_mul :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14383
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14384
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14385
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14386
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14387
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14388
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14389
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14390
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14391
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14392
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14393
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14394
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14395
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14396
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14397
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14398
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14399
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14400
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14401
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14402
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14403
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14404
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14405
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14406
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14407
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14408
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14409
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14410
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14411
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14412
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14413
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14414
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14415
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14416
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14417
                        s4o.print("*");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14418
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14419
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14420
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14421
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14422
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14423
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14424
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14425
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14426
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14427
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14428
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14429
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14430
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14431
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14432
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14433
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14434
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14435
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14436
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14437
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14438
                                s4o.print("*");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14439
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14440
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14441
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14442
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14443
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14444
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14445
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14446
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14447
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14448
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14449
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14450
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14451
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14452
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14453
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14454
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14455
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14456
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14457
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14458
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14459
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14460
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14461
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14462
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14463
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14464
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14465
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14466
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14467
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14468
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14469
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14470
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14471
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14472
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14473
                        s4o.print("__time_mul(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14474
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14475
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14476
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14477
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14478
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14479
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14480
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14481
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14482
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14483
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14484
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14485
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14486
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14487
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14488
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14489
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14490
    }/*function_mul*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14491
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14492
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14493
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14494
 *SUB
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14495
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14496
    case function_sub :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14497
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14498
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14499
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14500
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14501
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14502
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14503
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14504
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14505
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14506
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14507
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14508
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14509
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14510
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14511
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14512
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14513
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14514
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14515
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14516
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14517
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14518
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14519
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14520
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14521
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14522
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14523
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14524
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14525
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14526
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14527
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14528
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14529
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14530
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14531
                        s4o.print("-");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14532
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14533
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14534
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14535
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14536
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14537
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14538
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14539
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14540
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14541
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14542
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14543
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14544
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14545
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14546
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14547
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14548
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14549
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14550
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14551
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14552
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14553
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14554
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14555
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14556
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14557
                    if (typeid(*last_type_symbol) == typeid(date_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14558
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14559
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14560
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14561
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14562
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14563
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14564
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14565
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14566
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14567
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14568
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14569
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14570
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14571
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14572
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14573
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14574
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14575
            if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14576
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14577
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14578
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14579
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14580
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14581
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14582
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14583
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14584
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14585
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14586
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14587
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14588
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14589
                    if (typeid(*last_type_symbol) == typeid(dt_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14590
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14591
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14592
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14593
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14594
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14595
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14596
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14597
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14598
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14599
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14600
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14601
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14602
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14603
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14604
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14605
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14606
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14607
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14608
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14609
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14610
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14611
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14612
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14613
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14614
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14615
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14616
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14617
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14618
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14619
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14620
            if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14621
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14622
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14623
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14624
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14625
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14626
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14627
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14628
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14629
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14630
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14631
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14632
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14633
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14634
                    if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14635
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14636
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14637
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14638
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14639
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14640
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14641
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14642
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14643
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14644
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14645
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14646
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14647
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14648
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14649
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14650
                        symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14651
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14652
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14653
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14654
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14655
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14656
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14657
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14658
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14659
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14660
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14661
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14662
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14663
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14664
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14665
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14666
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14667
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14668
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14669
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14670
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14671
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14672
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14673
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14674
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14675
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14676
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14677
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14678
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14679
                    if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14680
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14681
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14682
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14683
                        s4o.print("__time_sub(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14684
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14685
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14686
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14687
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14688
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14689
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14690
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14691
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14692
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14693
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14694
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14695
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14696
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14697
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14698
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14699
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14700
    }/*function_sub*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14701
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14702
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14703
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14704
 *DIV
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14705
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14706
    case function_div :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14707
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14708
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14709
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14710
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14711
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14712
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14713
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14714
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14715
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14716
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14717
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14718
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14719
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14720
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14721
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14722
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14723
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14724
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14725
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14726
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14727
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14728
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14729
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14730
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14731
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14732
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14733
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14734
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14735
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14736
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14737
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14738
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14739
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14740
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14741
                        s4o.print("/");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14742
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14743
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14744
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14745
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14746
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14747
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14748
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14749
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14750
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14751
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14752
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14753
            if (typeid(*last_type_symbol) == typeid(time_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14754
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14755
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14756
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14757
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14758
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14759
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14760
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14761
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14762
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14763
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14764
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14765
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14766
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14767
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14768
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14769
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14770
                        symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14771
                        s4o.print("__time_div(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14772
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14773
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14774
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14775
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14776
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14777
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14778
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14779
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14780
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14781
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14782
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14783
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14784
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14785
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14786
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14787
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14788
    }/*function_div*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14789
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14790
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14791
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14792
 *MOD
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14793
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14794
    case function_mod :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14795
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14796
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14797
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14798
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14799
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14800
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14801
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14802
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14803
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14804
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14805
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14806
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14807
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14808
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14809
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14810
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14811
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14812
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14813
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14814
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14815
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14816
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14817
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14818
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14819
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14820
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14821
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14822
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14823
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14824
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14825
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14826
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14827
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14828
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14829
                        s4o.print("%");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14830
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14831
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14832
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14833
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14834
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14835
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14836
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14837
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14838
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14839
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14840
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14841
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14842
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14843
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14844
    }/*function_mod*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14845
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14846
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14847
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14848
 *EXPT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14849
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14850
    case function_expt :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14851
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14852
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14853
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14854
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14855
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14856
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14857
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14858
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14859
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14860
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14861
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14862
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14863
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14864
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14865
            if(search_expression_type->is_num_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14866
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14867
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14868
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14869
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14870
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14871
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14872
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14873
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14874
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14875
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14876
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14877
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14878
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14879
                    if(search_expression_type->is_num_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14880
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14881
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14882
                        symbol_c * return_type_symbol = last_type_symbol;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14883
                        s4o.print("pow(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14884
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 14885
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14886
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14887
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14888
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14889
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14890
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14891
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14892
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14893
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14894
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14895
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14896
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14897
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14898
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14899
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14900
    }/*function_expt*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14901
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14902
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14903
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14904
 *MOVE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14905
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14906
    case function_move :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14907
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14908
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14909
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14910
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14911
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14912
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14913
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14914
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14915
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14916
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14917
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14918
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14919
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14920
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14921
            if(search_expression_type->is_num_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14922
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14923
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14924
                symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14925
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14926
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14927
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14928
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14929
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14930
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14931
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14932
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14933
    }/*function_move*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14934
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14935
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14936
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14937
 *SHL
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14938
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14939
    case function_shl :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14940
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14941
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14942
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14943
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14944
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14945
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14946
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14947
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14948
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14949
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14950
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14951
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14952
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14953
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14954
            if(search_expression_type->is_binary_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14955
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14956
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14957
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14958
                    identifier_c param_name("N");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14959
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14960
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14961
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14962
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14963
                    if (N_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14964
                      N_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14965
                    symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14966
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14967
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14968
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14969
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14970
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14971
                        symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14972
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14973
                        s4o.print("<<");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14974
                        N_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14975
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14976
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14977
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14978
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14979
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14980
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14981
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14982
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14983
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14984
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14985
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14986
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14987
    }/*function_shl*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14988
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14989
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14990
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14991
 *SHR
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 14992
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14993
    case function_shr :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14994
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14995
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14996
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14997
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14998
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 14999
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15000
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15001
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15002
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15003
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15004
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15005
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15006
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15007
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15008
            if(search_expression_type->is_binary_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15009
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15010
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15011
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15012
                    identifier_c param_name("N");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15013
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15014
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15015
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15016
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15017
                    if (N_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15018
                      N_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15019
                    symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15020
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15021
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15022
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15023
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15024
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15025
                        symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15026
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15027
                        s4o.print(">>");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15028
                        N_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15029
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15030
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15031
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15032
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15033
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15034
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15035
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15036
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15037
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15038
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15039
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15040
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15041
    }/*function_shr*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15042
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15043
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15044
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15045
 *ROR
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15046
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15047
    case function_ror :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15048
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15049
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15050
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15051
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15052
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15053
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15054
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15055
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15056
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15057
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15058
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15059
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15060
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15061
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15062
            if(search_expression_type->is_nbinary_type(IN_type_symbol))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15063
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15064
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15065
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15066
                    identifier_c param_name("N");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15067
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15068
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15069
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15070
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15071
                    if (N_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15072
                      N_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15073
                    symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15074
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15075
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15076
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15077
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15078
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15079
                        symbol_c * return_type_symbol = IN_type_symbol;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15080
                        s4o.print("__ror_");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15081
                        IN_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15082
                        s4o.print("(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15083
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15084
                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15085
                        N_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15086
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15087
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15088
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15089
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15090
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15091
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15092
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15093
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15094
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15095
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15096
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15097
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15098
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15099
    }/*function_ror*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15100
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15101
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15102
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15103
 *ROL
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15104
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15105
    case function_rol :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15106
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15107
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15108
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15109
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15110
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15111
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15112
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15113
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15114
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15115
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15116
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15117
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15118
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15119
            
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15120
            if(search_expression_type->is_nbinary_type(IN_type_symbol))
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15121
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15122
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15123
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15124
                    identifier_c param_name("N");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15125
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15126
                    symbol_c *N_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15127
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15128
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15129
                    if (N_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15130
                      N_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15131
                    symbol_c *N_type_symbol = search_expression_type->get_type(N_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15132
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(N_type_symbol, last_type_symbol) ? search_expression_type->common_type(N_type_symbol, last_type_symbol) : N_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15133
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15134
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15135
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15136
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15137
                        symbol_c * return_type_symbol = IN_type_symbol;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15138
                        s4o.print("__rol_");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15139
                        IN_type_symbol->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 15140
                        s4o.print("(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15141
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15142
                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15143
                        N_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15144
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15145
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15146
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15147
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15148
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15149
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15150
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15151
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15152
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15153
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15154
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15155
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15156
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15157
    }/*function_rol*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15158
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15159
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15160
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15161
 *AND
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15162
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15163
    case function_and :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15164
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15165
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15166
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15167
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15168
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15169
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15170
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15171
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15172
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15173
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15174
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15175
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15176
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15177
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15178
            if(search_expression_type->is_binary_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15179
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15180
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15181
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15182
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15183
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15184
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15185
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15186
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15187
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15188
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15189
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15190
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15191
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15192
                    if(search_expression_type->is_binary_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15193
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15194
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15195
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15196
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15197
                        if (search_expression_type->is_bool_type(last_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15198
                          s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15199
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15200
                        s4o.print("&");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15201
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15202
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15203
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15204
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15205
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15206
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15207
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15208
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15209
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15210
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15211
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15212
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15213
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15214
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15215
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15216
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15217
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15218
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15219
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15220
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15221
                                s4o.print("&");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15222
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15223
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15224
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15225
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15226
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15227
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15228
                        if (search_expression_type->is_bool_type(last_type_symbol)) {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15229
                          s4o.print("&1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15230
                          s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15231
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15232
                        s4o.print("");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15233
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15234
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15235
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15236
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15237
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15238
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15239
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15240
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15241
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15242
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15243
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15244
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15245
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15246
    }/*function_and*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15247
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15248
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15249
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15250
 *OR
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15251
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15252
    case function_or :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15253
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15254
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15255
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15256
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15257
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15258
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15259
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15260
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15261
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15262
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15263
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15264
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15265
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15266
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15267
            if(search_expression_type->is_binary_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15268
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15269
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15270
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15271
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15272
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15273
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15274
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15275
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15276
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15277
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15278
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15279
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15280
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15281
                    if(search_expression_type->is_binary_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15282
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15283
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15284
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15285
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15286
                        if (search_expression_type->is_bool_type(last_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15287
                          s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15288
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15289
                        s4o.print("|");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15290
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15291
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15292
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15293
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15294
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15295
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15296
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15297
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15298
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15299
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15300
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15301
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15302
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15303
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15304
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15305
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15306
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15307
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15308
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15309
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15310
                                s4o.print("|");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15311
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15312
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15313
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15314
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15315
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15316
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15317
                        if (search_expression_type->is_bool_type(last_type_symbol)) {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15318
                          s4o.print("&1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15319
                          s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15320
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15321
                        s4o.print("");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15322
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15323
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15324
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15325
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15326
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15327
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15328
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15329
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15330
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15331
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15332
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15333
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15334
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15335
    }/*function_or*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15336
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15337
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15338
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15339
 *XOR
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15340
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15341
    case function_xor :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15342
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15343
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15344
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15345
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15346
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15347
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15348
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15349
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15350
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15351
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15352
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15353
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15354
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15355
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15356
            if(search_expression_type->is_binary_type(IN1_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15357
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15358
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15359
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15360
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15361
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15362
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15363
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15364
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15365
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15366
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15367
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15368
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15369
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15370
                    if(search_expression_type->is_binary_type(IN2_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15371
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15372
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15373
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15374
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15375
                        if (search_expression_type->is_bool_type(last_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15376
                          s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15377
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15378
                        s4o.print("^");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15379
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15380
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15381
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15382
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15383
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15384
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15385
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15386
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15387
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15388
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15389
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15390
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15391
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15392
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15393
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15394
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15395
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15396
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15397
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15398
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15399
                                s4o.print("^");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15400
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15401
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15402
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15403
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15404
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15405
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15406
                        if (search_expression_type->is_bool_type(last_type_symbol)) {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15407
                          s4o.print("&1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15408
                          s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15409
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15410
                        s4o.print("");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15411
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15412
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15413
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15414
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15415
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15416
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15417
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15418
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15419
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15420
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15421
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15422
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15423
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15424
    }/*function_xor*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15425
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15426
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15427
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15428
 *NOT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15429
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15430
    case function_not :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15431
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15432
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15433
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15434
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15435
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15436
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15437
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15438
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15439
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15440
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15441
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15442
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15443
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15444
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15445
            if(search_expression_type->is_binary_type(IN_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15446
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15447
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15448
                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15449
                s4o.print("~");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15450
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15451
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15452
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15453
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15454
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15455
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15456
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15457
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15458
    }/*function_not*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15459
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15460
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15461
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15462
 *SEL
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15463
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15464
    case function_sel :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15465
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15466
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15467
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15468
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15469
            identifier_c param_name("G");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15470
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15471
            symbol_c *G_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15472
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15473
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15474
            if (G_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15475
              G_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15476
            symbol_c *G_type_symbol = search_expression_type->get_type(G_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15477
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(G_type_symbol, last_type_symbol) ? search_expression_type->common_type(G_type_symbol, last_type_symbol) : G_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15478
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15479
            if (typeid(*last_type_symbol) == typeid(bool_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15480
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15481
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15482
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15483
                    identifier_c param_name("IN0");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15484
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15485
                    symbol_c *IN0_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15486
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15487
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15488
                    if (IN0_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15489
                      IN0_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15490
                    symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15491
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15492
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15493
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15494
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15495
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15496
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15497
                            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15498
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15499
                            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15500
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15501
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15502
                            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15503
                              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15504
                            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15505
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15506
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15507
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15508
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15509
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15510
                                symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15511
                                G_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15512
                                s4o.print(" ? ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15513
                                IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15514
                                s4o.print(" :  ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15515
                                IN0_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15516
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15517
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15518
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15519
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15520
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15521
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15522
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15523
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15524
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15525
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15526
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15527
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15528
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15529
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15530
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15531
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15532
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15533
    }/*function_sel*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15534
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15535
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15536
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15537
 *MAX
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15538
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15539
    case function_max :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15540
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15541
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15542
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15543
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15544
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15545
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15546
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15547
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15548
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15549
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15550
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15551
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15552
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15553
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15554
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15555
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15556
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15557
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15558
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15559
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15560
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15561
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15562
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15563
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15564
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15565
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15566
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15567
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15568
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15569
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15570
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15571
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15572
                        s4o.print("__max_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15573
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15574
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15575
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15576
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15577
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15578
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15579
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15580
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15581
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15582
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15583
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15584
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15585
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15586
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15587
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15588
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15589
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15590
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15591
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15592
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15593
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15594
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15595
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15596
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15597
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15598
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15599
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15600
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15601
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15602
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15603
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15604
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15605
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15606
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15607
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15608
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15609
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15610
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15611
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15612
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15613
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15614
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15615
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15616
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15617
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15618
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15619
    }/*function_max*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15620
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15621
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15622
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15623
 *MIN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15624
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15625
    case function_min :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15626
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15627
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15628
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15629
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15630
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15631
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15632
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15633
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15634
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15635
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15636
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15637
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15638
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15639
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15640
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15641
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15642
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15643
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15644
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15645
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15646
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15647
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15648
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15649
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15650
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15651
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15652
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15653
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15654
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15655
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15656
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15657
                        symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15658
                        s4o.print("__min_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15659
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15660
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15661
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15662
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15663
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15664
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15665
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15666
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15667
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15668
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15669
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15670
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15671
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15672
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15673
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15674
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15675
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15676
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15677
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15678
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15679
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15680
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15681
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15682
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15683
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15684
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15685
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15686
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15687
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15688
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15689
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15690
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15691
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15692
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15693
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15694
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15695
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15696
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15697
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15698
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15699
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15700
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15701
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15702
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15703
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15704
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15705
    }/*function_min*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15706
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15707
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15708
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15709
 *LIMIT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15710
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15711
    case function_limit :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15712
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15713
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15714
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15715
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15716
            identifier_c param_name("MN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15717
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15718
            symbol_c *MN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15719
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15720
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15721
            if (MN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15722
              MN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15723
            symbol_c *MN_type_symbol = search_expression_type->get_type(MN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15724
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MN_type_symbol, last_type_symbol) ? search_expression_type->common_type(MN_type_symbol, last_type_symbol) : MN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15725
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15726
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15727
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15728
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15729
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15730
                    identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15731
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15732
                    symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15733
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15734
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15735
                    if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15736
                      IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15737
                    symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15738
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15739
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15740
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15741
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15742
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15743
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15744
                            identifier_c param_name("MX");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15745
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15746
                            symbol_c *MX_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15747
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15748
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15749
                            if (MX_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15750
                              MX_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15751
                            symbol_c *MX_type_symbol = search_expression_type->get_type(MX_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15752
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(MX_type_symbol, last_type_symbol) ? search_expression_type->common_type(MX_type_symbol, last_type_symbol) : MX_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15753
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15754
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15755
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15756
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15757
                                symbol_c * return_type_symbol = IN_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15758
                                s4o.print("__limit_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15759
                                IN_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15760
                                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15761
                                MN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15762
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15763
                                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15764
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15765
                                MX_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15766
                                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15767
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15768
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15769
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15770
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15771
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15772
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15773
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15774
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15775
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15776
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15777
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15778
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15779
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15780
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15781
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15782
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15783
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15784
    }/*function_limit*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15785
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15786
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15787
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15788
 *MUX
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15789
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15790
    case function_mux :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15791
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15792
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15793
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15794
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15795
            identifier_c param_name("K");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15796
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15797
            symbol_c *K_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15798
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15799
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15800
            if (K_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15801
              K_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15802
            symbol_c *K_type_symbol = search_expression_type->get_type(K_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15803
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(K_type_symbol, last_type_symbol) ? search_expression_type->common_type(K_type_symbol, last_type_symbol) : K_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15804
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15805
            if(search_expression_type->is_integer_type(K_type_symbol))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15806
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15807
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15808
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15809
                    identifier_c param_name("IN0");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15810
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15811
                    symbol_c *IN0_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15812
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15813
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15814
                    if (IN0_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15815
                      IN0_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15816
                    symbol_c *IN0_type_symbol = search_expression_type->get_type(IN0_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15817
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN0_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN0_type_symbol, last_type_symbol) : IN0_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15818
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15819
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15820
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15821
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15822
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15823
                            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15824
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15825
                            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15826
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15827
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15828
                            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15829
                              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15830
                            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15831
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15832
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15833
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15834
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15835
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15836
                                symbol_c * return_type_symbol = last_type_symbol;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15837
                                s4o.print("__mux_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15838
                                return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15839
                                s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15840
                                s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15841
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15842
                                K_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15843
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15844
                                IN0_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15845
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15846
                                IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15847
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15848
                                int base_num = 2;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15849
                                symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15850
                                do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15851
                                    char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15852
                                    sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15853
                                    identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15854
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15855
                                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15856
                                    param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15857
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15858
                                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15859
                                    if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15860
                                      param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15861
                                    if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15862
                                        symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15863
                                        last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15864
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15865
                                        /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15866
                                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15867
                                        param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15868
                                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15869
                                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15870
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15871
                                }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15872
                                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15873
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15874
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15875
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15876
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15877
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15878
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15879
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15880
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15881
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15882
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15883
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15884
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15885
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15886
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15887
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15888
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15889
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15890
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15891
    }/*function_mux*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15892
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15893
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15894
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15895
 *GT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15896
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15897
    case function_gt :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15898
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15899
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15900
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15901
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15902
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15903
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15904
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15905
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15906
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15907
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15908
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15909
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15910
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15911
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15912
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15913
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15914
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15915
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15916
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15917
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15918
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15919
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15920
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15921
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15922
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15923
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15924
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15925
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15926
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15927
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15928
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15929
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15930
                        s4o.print("__gt_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15931
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15932
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15933
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15934
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15935
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15936
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15937
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15938
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15939
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15940
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15941
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15942
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15943
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15944
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15945
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15946
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15947
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15948
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15949
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15950
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15951
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15952
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15953
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15954
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15955
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15956
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15957
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15958
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15959
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15960
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15961
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15962
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15963
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15964
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15965
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15966
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15967
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15968
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15969
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15970
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15971
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15972
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15973
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15974
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15975
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15976
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15977
    }/*function_gt*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15978
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15979
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15980
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15981
 *GE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 15982
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15983
    case function_ge :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15984
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15985
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15986
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15987
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15988
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15989
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15990
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15991
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15992
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15993
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15994
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15995
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15996
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15997
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15998
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 15999
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16000
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16001
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16002
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16003
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16004
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16005
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16006
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16007
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16008
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16009
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16010
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16011
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16012
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16013
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16014
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16015
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16016
                        s4o.print("__ge_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16017
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16018
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16019
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16020
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16021
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16022
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16023
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16024
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16025
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16026
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16027
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16028
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16029
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16030
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16031
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16032
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16033
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16034
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16035
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16036
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16037
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16038
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16039
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16040
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16041
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16042
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16043
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16044
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16045
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16046
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16047
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16048
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16049
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16050
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16051
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16052
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16053
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16054
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16055
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16056
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16057
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16058
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16059
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16060
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16061
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16062
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16063
    }/*function_ge*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16064
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16065
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16066
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16067
 *EQ
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16068
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16069
    case function_eq :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16070
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16071
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16072
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16073
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16074
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16075
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16076
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16077
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16078
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16079
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16080
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16081
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16082
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16083
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16084
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16085
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16086
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16087
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16088
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16089
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16090
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16091
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16092
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16093
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16094
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16095
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16096
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16097
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16098
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16099
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16100
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16101
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16102
                        s4o.print("__eq_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16103
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16104
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16105
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16106
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16107
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16108
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16109
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16110
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16111
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16112
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16113
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16114
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16115
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16116
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16117
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16118
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16119
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16120
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16121
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16122
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16123
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16124
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16125
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16126
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16127
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16128
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16129
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16130
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16131
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16132
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16133
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16134
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16135
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16136
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16137
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16138
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16139
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16140
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16141
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16142
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16143
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16144
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16145
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16146
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16147
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16148
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16149
    }/*function_eq*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16150
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16151
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16152
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16153
 *LT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16154
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16155
    case function_lt :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16156
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16157
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16158
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16159
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16160
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16161
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16162
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16163
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16164
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16165
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16166
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16167
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16168
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16169
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16170
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16171
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16172
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16173
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16174
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16175
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16176
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16177
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16178
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16179
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16180
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16181
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16182
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16183
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16184
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16185
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16186
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16187
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16188
                        s4o.print("__lt_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16189
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16190
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16191
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16192
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16193
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16194
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16195
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16196
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16197
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16198
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16199
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16200
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16201
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16202
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16203
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16204
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16205
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16206
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16207
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16208
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16209
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16210
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16211
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16212
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16213
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16214
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16215
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16216
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16217
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16218
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16219
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16220
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16221
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16222
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16223
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16224
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16225
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16226
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16227
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16228
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16229
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16230
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16231
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16232
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16233
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16234
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16235
    }/*function_lt*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16236
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16237
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16238
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16239
 *LE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16240
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16241
    case function_le :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16242
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16243
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16244
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16245
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16246
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16247
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16248
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16249
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16250
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16251
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16252
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16253
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16254
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16255
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16256
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16257
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16258
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16259
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16260
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16261
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16262
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16263
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16264
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16265
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16266
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16267
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16268
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16269
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16270
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16271
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16272
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16273
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16274
                        s4o.print("__le_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16275
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16276
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16277
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16278
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16279
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16280
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16281
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16282
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16283
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16284
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16285
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16286
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16287
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16288
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16289
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16290
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16291
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16292
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16293
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16294
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16295
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16296
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16297
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16298
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16299
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16300
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16301
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16302
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16303
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16304
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16305
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16306
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16307
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16308
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16309
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16310
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16311
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16312
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16313
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16314
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16315
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16316
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16317
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16318
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16319
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16320
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16321
    }/*function_le*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16322
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16323
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16324
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16325
 *NE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16326
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16327
    case function_ne :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16328
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16329
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16330
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16331
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16332
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16333
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16334
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16335
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16336
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16337
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16338
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16339
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16340
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16341
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16342
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16343
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16344
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16345
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16346
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16347
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16348
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16349
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16350
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16351
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16352
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16353
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16354
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16355
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16356
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16357
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16358
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16359
                        symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16360
                        s4o.print("__ne_");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16361
                        return_type_symbol->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16362
                        s4o.print("(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16363
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16364
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16365
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16366
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16367
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16368
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16369
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16370
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16371
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16372
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16373
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16374
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16375
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16376
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16377
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16378
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16379
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16380
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16381
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16382
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16383
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16384
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16385
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16386
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16387
                                s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16388
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16389
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16390
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16391
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16392
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16393
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16394
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16395
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16396
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16397
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16398
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16399
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16400
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16401
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16402
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16403
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16404
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16405
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16406
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16407
    }/*function_ne*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16408
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16409
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16410
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16411
 *LEN
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16412
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16413
    case function_len :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16414
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16415
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16416
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16417
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16418
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16419
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16420
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16421
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16422
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16423
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16424
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16425
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16426
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16427
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16428
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16429
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16430
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16431
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16432
                s4o.print("__len(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16433
                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16434
                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16435
                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16436
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16437
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16438
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16439
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16440
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16441
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16442
    }/*function_len*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16443
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16444
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16445
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16446
 *LEFT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16447
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16448
    case function_left :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16449
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16450
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16451
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16452
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16453
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16454
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16455
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16456
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16457
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16458
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16459
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16460
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16461
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16462
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16463
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16464
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16465
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16466
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16467
                    identifier_c param_name("L");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16468
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16469
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16470
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16471
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16472
                    if (L_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16473
                      L_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16474
                    symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16475
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16476
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16477
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16478
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16479
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16480
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16481
                        s4o.print("__left(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16482
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16483
                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16484
                        L_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16485
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16486
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16487
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16488
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16489
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16490
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16491
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16492
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16493
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16494
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16495
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16496
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16497
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16498
    }/*function_left*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16499
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16500
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16501
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16502
 *RIGHT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16503
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16504
    case function_right :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16505
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16506
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16507
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16508
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16509
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16510
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16511
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16512
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16513
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16514
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16515
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16516
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16517
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16518
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16519
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16520
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16521
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16522
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16523
                    identifier_c param_name("L");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16524
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16525
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16526
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16527
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16528
                    if (L_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16529
                      L_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16530
                    symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16531
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16532
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16533
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16534
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16535
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16536
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16537
                        s4o.print("__right(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16538
                        IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16539
                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16540
                        L_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16541
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16542
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16543
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16544
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16545
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16546
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16547
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16548
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16549
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16550
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16551
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16552
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16553
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16554
    }/*function_right*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16555
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16556
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16557
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16558
 *MID
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16559
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16560
    case function_mid :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16561
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16562
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16563
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16564
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16565
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16566
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16567
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16568
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16569
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16570
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16571
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16572
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16573
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16574
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16575
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16576
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16577
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16578
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16579
                    identifier_c param_name("L");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16580
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16581
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16582
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16583
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16584
                    if (L_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16585
                      L_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16586
                    symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16587
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16588
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16589
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16590
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16591
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16592
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16593
                            identifier_c param_name("P");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16594
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16595
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16596
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16597
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16598
                            if (P_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16599
                              P_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16600
                            symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16601
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16602
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16603
                            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16604
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16605
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16606
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16607
                                s4o.print("__mid(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16608
                                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16609
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16610
                                L_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16611
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16612
                                P_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16613
                                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16614
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16615
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16616
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16617
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16618
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16619
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16620
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16621
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16622
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16623
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16624
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16625
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16626
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16627
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16628
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16629
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16630
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16631
    }/*function_mid*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16632
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16633
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16634
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16635
 *CONCAT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16636
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16637
    case function_concat :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16638
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16639
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16640
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16641
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16642
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16643
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16644
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16645
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16646
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16647
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16648
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16649
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16650
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16651
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16652
            if (typeid(*last_type_symbol) == typeid(date_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16653
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16654
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16655
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16656
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16657
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16658
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16659
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16660
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16661
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16662
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16663
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16664
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16665
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16666
                    if (typeid(*last_type_symbol) == typeid(tod_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16667
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16668
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16669
                        symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16670
                        s4o.print("__time_add(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16671
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16672
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16673
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16674
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16675
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16676
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16677
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16678
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16679
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16680
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16681
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16682
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16683
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16684
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16685
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16686
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16687
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16688
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16689
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16690
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16691
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16692
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16693
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16694
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16695
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16696
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16697
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16698
                    if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16699
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16700
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16701
                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16702
                        s4o.print("__concat(");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16703
                        s4o.print_integer(nb_param);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16704
                        s4o.print(",");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16705
                        IN1_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16706
                        s4o.print(",&");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16707
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16708
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16709
                        int base_num = 3;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16710
                        symbol_c *param_value = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16711
                        do{
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16712
                            char my_name[10];
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16713
                            sprintf(my_name, "IN%d", base_num++);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16714
                            identifier_c param_name(my_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16715
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16716
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16717
                            param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16718
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16719
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16720
                            if (param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16721
                              param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16722
                            if (param_value != NULL){
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16723
                                symbol_c *current_type_symbol = search_expression_type->get_type(param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16724
                                last_type_symbol = last_type_symbol && search_expression_type->is_same_type(current_type_symbol, last_type_symbol) ? search_expression_type->common_type(current_type_symbol, last_type_symbol) : current_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16725
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16726
                                /*Function specific CODE */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16727
                                s4o.print(",&");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16728
                                param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16729
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16730
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16731
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16732
                        }while(param_value != NULL);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16733
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16734
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16735
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16736
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16737
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16738
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16739
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16740
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16741
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16742
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16743
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16744
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16745
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16746
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16747
    }/*function_concat*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16748
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16749
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16750
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16751
 *INSERT
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16752
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16753
    case function_insert :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16754
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16755
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16756
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16757
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16758
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16759
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16760
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16761
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16762
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16763
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16764
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16765
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16766
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16767
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16768
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16769
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16770
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16771
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16772
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16773
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16774
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16775
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16776
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16777
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16778
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16779
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16780
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16781
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16782
                    if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16783
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16784
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16785
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16786
                            identifier_c param_name("P");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16787
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16788
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16789
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16790
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16791
                            if (P_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16792
                              P_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16793
                            symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16794
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16795
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16796
                            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16797
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16798
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16799
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16800
                                s4o.print("__insert(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16801
                                IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16802
                                s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16803
                                IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16804
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16805
                                P_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16806
                                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16807
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16808
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16809
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16810
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16811
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16812
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16813
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16814
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16815
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16816
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16817
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16818
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16819
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16820
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16821
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16822
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16823
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16824
    }/*function_insert*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16825
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16826
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16827
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16828
 *DELETE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16829
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16830
    case function_delete :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16831
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16832
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16833
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16834
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16835
            identifier_c param_name("IN");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16836
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16837
            symbol_c *IN_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16838
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16839
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16840
            if (IN_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16841
              IN_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16842
            symbol_c *IN_type_symbol = search_expression_type->get_type(IN_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16843
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16844
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16845
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16846
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16847
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16848
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16849
                    identifier_c param_name("L");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16850
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16851
                    symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16852
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16853
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16854
                    if (L_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16855
                      L_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16856
                    symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16857
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16858
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16859
                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16860
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16861
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16862
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16863
                            identifier_c param_name("P");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16864
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16865
                            symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16866
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16867
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16868
                            if (P_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16869
                              P_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16870
                            symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16871
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16872
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16873
                            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16874
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16875
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16876
                                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16877
                                s4o.print("__delete(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16878
                                IN_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16879
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16880
                                L_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16881
                                s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16882
                                P_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16883
                                s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16884
                                return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16885
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16886
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16887
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16888
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16889
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16890
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16891
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16892
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16893
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16894
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16895
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16896
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16897
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16898
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16899
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16900
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16901
    }/*function_delete*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16902
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16903
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16904
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16905
 *REPLACE
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 16906
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16907
    case function_replace :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16908
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16909
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16910
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16911
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16912
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16913
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16914
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16915
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16916
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16917
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16918
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16919
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16920
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16921
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16922
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16923
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16924
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16925
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16926
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16927
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16928
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16929
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16930
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16931
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16932
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16933
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16934
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16935
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16936
                    if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16937
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16938
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16939
                        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16940
                            identifier_c param_name("L");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16941
                            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16942
                            symbol_c *L_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16943
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16944
                            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16945
                            if (L_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16946
                              L_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16947
                            symbol_c *L_type_symbol = search_expression_type->get_type(L_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16948
                            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(L_type_symbol, last_type_symbol) ? search_expression_type->common_type(L_type_symbol, last_type_symbol) : L_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16949
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16950
                            if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16951
                            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16952
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16953
                                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16954
                                    identifier_c param_name("P");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16955
                                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16956
                                    symbol_c *P_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16957
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16958
                                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16959
                                    if (P_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16960
                                      P_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16961
                                    symbol_c *P_type_symbol = search_expression_type->get_type(P_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16962
                                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(P_type_symbol, last_type_symbol) ? search_expression_type->common_type(P_type_symbol, last_type_symbol) : P_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16963
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16964
                                    if (typeid(*last_type_symbol) == typeid(uint_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16965
                                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16966
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16967
                                        symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16968
                                        s4o.print("__replace(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16969
                                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 16970
                                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16971
                                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16972
                                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16973
                                        L_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16974
                                        s4o.print(", ");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16975
                                        P_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16976
                                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16977
                                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16978
                                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16979
                                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16980
                                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16981
                                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16982
                                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16983
                                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16984
                            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16985
                            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16986
                            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16987
                        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16988
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16989
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16990
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16991
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16992
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16993
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16994
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16995
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16996
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16997
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16998
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 16999
    }/*function_replace*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17000
    break;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17001
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17002
/****
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17003
 *FIND
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17004
 */
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17005
    case function_find :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17006
    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17007
        symbol_c *last_type_symbol = NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17008
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17009
        {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17010
            identifier_c param_name("IN1");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17011
            /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17012
            symbol_c *IN1_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17013
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17014
            /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17015
            if (IN1_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17016
              IN1_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17017
            symbol_c *IN1_type_symbol = search_expression_type->get_type(IN1_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17018
            last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN1_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN1_type_symbol, last_type_symbol) : IN1_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17019
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17020
            if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17021
            {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17022
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17023
                {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17024
                    identifier_c param_name("IN2");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17025
                    /* Get the value from a foo(<param_name> = <param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17026
                    symbol_c *IN2_param_value = function_call_param_iterator.search(&param_name);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17027
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17028
                    /* Get the value from a foo(<param_value>) style call */
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17029
                    if (IN2_param_value == NULL)
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17030
                      IN2_param_value = function_call_param_iterator.next();
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17031
                    symbol_c *IN2_type_symbol = search_expression_type->get_type(IN2_param_value);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17032
                    last_type_symbol = last_type_symbol && search_expression_type->is_same_type(IN2_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN2_type_symbol, last_type_symbol) : IN2_type_symbol ;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17033
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17034
                    if (typeid(*last_type_symbol) == typeid(string_type_name_c))
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17035
                    {
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17036
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17037
                        symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 17038
                        s4o.print("__find(");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17039
                        IN1_param_value->accept(*this);
38
6cce7d14647e Stage4 changes according to new STD lib implementation
etisserant
parents: 35
diff changeset
 17040
                        s4o.print(", ");
35
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17041
                        IN2_param_value->accept(*this);
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17042
                        s4o.print(")");
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17043
                        return NULL;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17044
                        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17045
                    }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17046
                    
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17047
                    ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17048
                }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17049
                
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17050
            }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17051
            
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17052
            ERROR;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17053
        }
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17054
        
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17055
    }/*function_find*/
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17056
    break;
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17057
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17058
    case function_none :
9f3d6c089533 Generated code for il finished
lbessard
parents: 34
diff changeset
 17059
    ERROR;
33
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17060
}
4507beb2aac6 preliminary std lib support for ST
etisserant
parents:
diff changeset
 17061
return NULL;