absyntax_utils/search_type_code.c
author Mario de Sousa <msousa@fe.up.pt>
Fri, 01 Apr 2011 10:47:24 +0100
changeset 265 4d222f46f8cc
parent 235 ed66dc50f31a
child 279 c0453b7f99df
permissions -rwxr-xr-x
Updating license info (with Edouard's permission for relevant files).
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     1
/*
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-3
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     3
 *
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     4
 *  Copyright (C) 2008 Edouard TISSERANT
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     5
 *
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     6
 *  This program is free software: you can redistribute it and/or modify
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     7
 *  it under the terms of the GNU General Public License as published by
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     8
 *  the Free Software Foundation, either version 3 of the License, or
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
     9
 *  (at your option) any later version.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    10
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    11
 *  This program is distributed in the hope that it will be useful,
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    12
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    13
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    14
 *  GNU General Public License for more details.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    15
 *
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    16
 *  You should have received a copy of the GNU General Public License
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    17
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    18
 *
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    19
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    20
 * This code is made available on the understanding that it will not be
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    21
 * used in safety-critical situations without a full and competent review.
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    22
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    23
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    24
/*
265
4d222f46f8cc Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents: 235
diff changeset
    25
 * An IEC 61131-3 compiler.
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    26
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    27
 * Based on the
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    28
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    29
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    30
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    31
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    32
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    33
 * IEC 61131-3 standard function library
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    34
 * generated code, do not edit by hand
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    35
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    36
 
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    37
 
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    38
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    39
void *search_expression_type_c::compute_standard_function_default(function_invocation_c *st_symbol = NULL, il_formal_funct_call_c *il_symbol = NULL) {
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    40
  function_type_t current_function_type;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    41
  function_call_param_iterator_c *tmp_function_call_param_iterator;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    42
  if (st_symbol != NULL && il_symbol == NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    43
    current_function_type = get_function_type((identifier_c *)st_symbol->function_name);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    44
    tmp_function_call_param_iterator = new function_call_param_iterator_c(st_symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    45
  }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    46
  else if (st_symbol == NULL && il_symbol != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    47
    current_function_type = get_function_type((identifier_c *)il_symbol->function_name);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    48
    tmp_function_call_param_iterator = new function_call_param_iterator_c(il_symbol);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    49
  }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    50
  else
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    51
    ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    52
  function_call_param_iterator_c function_call_param_iterator(*tmp_function_call_param_iterator);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    53
  search_expression_type_c* search_expression_type = this;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    54
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    55
  switch(current_function_type){
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    56
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    57
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    58
 *REAL_TO_SINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    59
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    60
    case function_real_to_sint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    61
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    62
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    63
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    64
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    65
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    66
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    67
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    68
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    69
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    70
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    71
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    72
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    73
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    74
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    75
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    76
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    77
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    78
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    79
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    80
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    81
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    82
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    83
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    84
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    85
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    86
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    87
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    88
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    89
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    90
    }/*function_real_to_sint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    91
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    92
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    93
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    94
 *REAL_TO_LINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    95
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    96
    case function_real_to_lint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    97
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    98
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    99
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   100
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   101
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   102
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   103
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   104
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   105
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   106
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   107
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   108
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   109
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   110
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   111
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   112
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   113
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   114
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   115
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   116
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   117
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   118
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   119
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   120
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   121
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   122
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   123
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   124
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   125
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   126
    }/*function_real_to_lint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   127
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   128
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   129
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   130
 *REAL_TO_DINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   131
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   132
    case function_real_to_dint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   133
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   134
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   135
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   136
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   137
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   138
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   139
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   140
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   141
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   142
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   143
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   144
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   145
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   146
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   147
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   148
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   149
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   150
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   151
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   152
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   153
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   154
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   155
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   156
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   157
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   158
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   159
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   160
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   161
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   162
    }/*function_real_to_dint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   163
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   164
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   165
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   166
 *REAL_TO_DATE
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   167
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   168
    case function_real_to_date :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   169
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   170
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   171
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   172
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   173
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   174
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   175
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   176
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   177
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   178
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   179
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   180
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   181
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   182
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   183
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   184
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   185
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   186
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   187
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   188
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   189
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   190
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   191
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   192
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   193
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   194
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   195
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   196
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   197
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   198
    }/*function_real_to_date*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   199
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   200
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   201
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   202
 *REAL_TO_DWORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   203
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   204
    case function_real_to_dword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   205
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   206
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   207
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   208
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   209
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   210
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   211
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   212
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   213
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   214
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   215
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   216
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   217
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   218
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   219
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   220
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   221
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   222
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   223
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   224
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   225
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   226
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   227
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   228
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   229
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   230
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   231
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   232
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   233
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   234
    }/*function_real_to_dword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   235
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   236
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   237
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   238
 *REAL_TO_DT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   239
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   240
    case function_real_to_dt :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   241
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   242
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   243
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   244
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   245
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   246
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   247
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   248
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   249
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   250
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   251
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   252
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   253
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   254
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   255
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   256
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   257
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   258
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   259
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   260
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   261
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   262
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   263
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   264
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   265
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   266
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   267
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   268
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   269
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   270
    }/*function_real_to_dt*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   271
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   272
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   273
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   274
 *REAL_TO_TOD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   275
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   276
    case function_real_to_tod :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   277
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   278
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   279
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   280
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   281
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   282
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   283
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   284
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   285
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   286
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   287
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   288
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   289
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   290
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   291
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   292
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   293
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   294
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   295
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   296
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   297
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   298
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   299
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   300
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   301
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   302
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   303
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   304
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   305
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   306
    }/*function_real_to_tod*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   307
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   308
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   309
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   310
 *REAL_TO_UDINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   311
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   312
    case function_real_to_udint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   313
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   314
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   315
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   316
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   317
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   318
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   319
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   320
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   321
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   322
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   323
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   324
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   325
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   326
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   327
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   328
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   329
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   330
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   331
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   332
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   333
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   334
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   335
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   336
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   337
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   338
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   339
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   340
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   341
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   342
    }/*function_real_to_udint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   343
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   344
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   345
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   346
 *REAL_TO_WORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   347
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   348
    case function_real_to_word :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   349
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   350
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   351
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   352
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   353
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   354
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   355
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   356
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   357
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   358
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   359
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   360
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   361
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   362
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   363
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   364
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   365
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   366
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   367
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   368
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   369
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   370
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   371
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   372
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   373
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   374
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   375
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   376
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   377
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   378
    }/*function_real_to_word*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   379
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   380
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   381
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   382
 *REAL_TO_STRING
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   383
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   384
    case function_real_to_string :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   385
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   386
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   387
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   388
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   389
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   390
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   391
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   392
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   393
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   394
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   395
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   396
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   397
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   398
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   399
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   400
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   401
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   402
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   403
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   404
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   405
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   406
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   407
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   408
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   409
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   410
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   411
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   412
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   413
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   414
    }/*function_real_to_string*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   415
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   416
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   417
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   418
 *REAL_TO_LWORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   419
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   420
    case function_real_to_lword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   421
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   422
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   423
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   424
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   425
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   426
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   427
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   428
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   429
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   430
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   431
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   432
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   433
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   434
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   435
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   436
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   437
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   438
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   439
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   440
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   441
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   442
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   443
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   444
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   445
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   446
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   447
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   448
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   449
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   450
    }/*function_real_to_lword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   451
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   452
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   453
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   454
 *REAL_TO_UINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   455
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   456
    case function_real_to_uint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   457
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   458
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   459
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   460
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   461
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   462
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   463
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   464
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   465
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   466
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   467
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   468
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   469
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   470
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   471
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   472
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   473
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   474
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   475
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   476
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   477
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   478
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   479
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   480
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   481
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   482
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   483
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   484
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   485
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   486
    }/*function_real_to_uint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   487
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   488
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   489
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   490
 *REAL_TO_LREAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   491
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   492
    case function_real_to_lreal :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   493
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   494
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   495
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   496
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   497
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   498
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   499
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   500
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   501
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   502
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   503
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   504
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   505
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   506
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   507
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   508
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   509
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   510
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   511
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   512
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   513
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   514
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   515
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   516
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   517
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   518
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   519
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   520
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   521
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   522
    }/*function_real_to_lreal*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   523
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   524
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   525
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   526
 *REAL_TO_BYTE
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   527
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   528
    case function_real_to_byte :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   529
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   530
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   531
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   532
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   533
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   534
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   535
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   536
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   537
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   538
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   539
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   540
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   541
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   542
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   543
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   544
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   545
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   546
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   547
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   548
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   549
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   550
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   551
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   552
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   553
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   554
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   555
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   556
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   557
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   558
    }/*function_real_to_byte*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   559
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   560
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   561
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   562
 *REAL_TO_USINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   563
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   564
    case function_real_to_usint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   565
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   566
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   567
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   568
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   569
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   570
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   571
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   572
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   573
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   574
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   575
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   576
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   577
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   578
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   579
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   580
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   581
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   582
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   583
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   584
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   585
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   586
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   587
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   588
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   589
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   590
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   591
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   592
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   593
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   594
    }/*function_real_to_usint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   595
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   596
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   597
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   598
 *REAL_TO_ULINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   599
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   600
    case function_real_to_ulint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   601
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   602
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   603
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   604
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   605
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   606
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   607
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   608
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   609
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   610
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   611
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   612
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   613
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   614
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   615
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   616
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   617
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   618
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   619
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   620
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   621
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   622
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   623
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   624
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   625
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   626
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   627
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   628
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   629
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   630
    }/*function_real_to_ulint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   631
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   632
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   633
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   634
 *REAL_TO_BOOL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   635
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   636
    case function_real_to_bool :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   637
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   638
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   639
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   640
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   641
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   642
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   643
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   644
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   645
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   646
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   647
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   648
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   649
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   650
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   651
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   652
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   653
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   654
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   655
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   656
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   657
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   658
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   659
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   660
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   661
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   662
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   663
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   664
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   665
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   666
    }/*function_real_to_bool*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   667
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   668
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   669
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   670
 *REAL_TO_TIME
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   671
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   672
    case function_real_to_time :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   673
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   674
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   675
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   676
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   677
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   678
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   679
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   680
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   681
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   682
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   683
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   684
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   685
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   686
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   687
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   688
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   689
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   690
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   691
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   692
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   693
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   694
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   695
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   696
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   697
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   698
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   699
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   700
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   701
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   702
    }/*function_real_to_time*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   703
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   704
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   705
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   706
 *REAL_TO_INT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   707
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   708
    case function_real_to_int :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   709
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   710
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   711
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   712
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   713
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   714
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   715
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   716
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   717
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   718
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   719
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   720
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   721
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   722
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   723
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   724
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   725
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   726
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::real_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   727
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   728
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   729
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   730
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   731
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   732
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   733
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   734
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   735
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   736
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   737
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   738
    }/*function_real_to_int*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   739
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   740
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   741
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   742
 *SINT_TO_REAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   743
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   744
    case function_sint_to_real :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   745
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   746
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   747
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   748
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   749
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   750
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   751
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   752
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   753
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   754
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   755
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   756
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   757
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   758
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   759
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   760
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   761
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   762
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   763
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   764
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   765
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   766
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   767
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   768
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   769
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   770
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   771
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   772
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   773
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   774
    }/*function_sint_to_real*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   775
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   776
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   777
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   778
 *SINT_TO_LINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   779
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   780
    case function_sint_to_lint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   781
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   782
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   783
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   784
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   785
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   786
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   787
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   788
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   789
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   790
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   791
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   792
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   793
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   794
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   795
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   796
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   797
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   798
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   799
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   800
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   801
                symbol_c * return_type_symbol = &search_constant_type_c::lint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   802
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   803
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   804
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   805
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   806
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   807
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   808
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   809
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   810
    }/*function_sint_to_lint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   811
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   812
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   813
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   814
 *SINT_TO_DINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   815
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   816
    case function_sint_to_dint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   817
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   818
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   819
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   820
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   821
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   822
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   823
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   824
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   825
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   826
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   827
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   828
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   829
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   830
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   831
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   832
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   833
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   834
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   835
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   836
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   837
                symbol_c * return_type_symbol = &search_constant_type_c::dint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   838
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   839
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   840
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   841
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   842
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   843
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   844
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   845
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   846
    }/*function_sint_to_dint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   847
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   848
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   849
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   850
 *SINT_TO_DATE
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   851
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   852
    case function_sint_to_date :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   853
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   854
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   855
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   856
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   857
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   858
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   859
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   860
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   861
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   862
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   863
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   864
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   865
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   866
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   867
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   868
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   869
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   870
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   871
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   872
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   873
                symbol_c * return_type_symbol = &search_constant_type_c::date_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   874
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   875
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   876
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   877
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   878
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   879
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   880
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   881
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   882
    }/*function_sint_to_date*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   883
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   884
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   885
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   886
 *SINT_TO_DWORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   887
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   888
    case function_sint_to_dword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   889
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   890
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   891
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   892
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   893
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   894
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   895
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   896
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   897
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   898
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   899
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   900
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   901
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   902
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   903
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   904
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   905
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   906
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   907
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   908
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   909
                symbol_c * return_type_symbol = &search_constant_type_c::dword_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   910
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   911
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   912
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   913
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   914
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   915
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   916
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   917
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   918
    }/*function_sint_to_dword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   919
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   920
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   921
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   922
 *SINT_TO_DT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   923
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   924
    case function_sint_to_dt :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   925
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   926
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   927
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   928
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   929
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   930
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   931
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   932
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   933
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   934
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   935
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   936
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   937
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   938
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   939
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   940
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   941
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   942
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   943
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   944
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   945
                symbol_c * return_type_symbol = &search_constant_type_c::dt_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   946
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   947
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   948
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   949
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   950
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   951
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   952
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   953
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   954
    }/*function_sint_to_dt*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   955
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   956
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   957
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   958
 *SINT_TO_TOD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   959
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   960
    case function_sint_to_tod :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   961
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   962
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   963
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   964
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   965
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   966
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   967
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   968
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   969
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   970
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   971
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   972
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   973
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   974
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   975
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   976
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   977
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   978
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   979
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   980
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   981
                symbol_c * return_type_symbol = &search_constant_type_c::tod_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   982
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   983
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   984
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   985
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   986
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   987
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   988
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   989
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   990
    }/*function_sint_to_tod*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   991
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   992
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   993
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   994
 *SINT_TO_UDINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   995
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   996
    case function_sint_to_udint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   997
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   998
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   999
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1000
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1001
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1002
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1003
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1004
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1005
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1006
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1007
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1008
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1009
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1010
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1011
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1012
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1013
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1014
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1015
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1016
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1017
                symbol_c * return_type_symbol = &search_constant_type_c::udint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1018
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1019
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1020
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1021
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1022
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1023
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1024
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1025
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1026
    }/*function_sint_to_udint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1027
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1028
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1029
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1030
 *SINT_TO_WORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1031
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1032
    case function_sint_to_word :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1033
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1034
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1035
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1036
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1037
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1038
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1039
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1040
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1041
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1042
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1043
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1044
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1045
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1046
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1047
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1048
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1049
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1050
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1051
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1052
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1053
                symbol_c * return_type_symbol = &search_constant_type_c::word_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1054
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1055
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1056
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1057
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1058
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1059
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1060
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1061
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1062
    }/*function_sint_to_word*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1063
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1064
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1065
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1066
 *SINT_TO_STRING
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1067
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1068
    case function_sint_to_string :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1069
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1070
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1071
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1072
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1073
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1074
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1075
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1076
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1077
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1078
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1079
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1080
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1081
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1082
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1083
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1084
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1085
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1086
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1087
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1088
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1089
                symbol_c * return_type_symbol = &search_constant_type_c::string_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1090
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1091
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1092
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1093
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1094
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1095
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1096
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1097
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1098
    }/*function_sint_to_string*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1099
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1100
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1101
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1102
 *SINT_TO_LWORD
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1103
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1104
    case function_sint_to_lword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1105
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1106
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1107
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1108
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1109
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1110
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1111
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1112
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1113
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1114
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1115
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1116
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1117
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1118
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1119
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1120
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1121
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1122
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1123
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1124
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1125
                symbol_c * return_type_symbol = &search_constant_type_c::lword_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1126
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1127
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1128
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1129
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1130
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1131
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1132
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1133
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1134
    }/*function_sint_to_lword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1135
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1136
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1137
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1138
 *SINT_TO_UINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1139
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1140
    case function_sint_to_uint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1141
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1142
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1143
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1144
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1145
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1146
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1147
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1148
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1149
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1150
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1151
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1152
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1153
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1154
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1155
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1156
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1157
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1158
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1159
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1160
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1161
                symbol_c * return_type_symbol = &search_constant_type_c::uint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1162
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1163
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1164
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1165
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1166
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1167
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1168
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1169
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1170
    }/*function_sint_to_uint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1171
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1172
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1173
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1174
 *SINT_TO_LREAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1175
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1176
    case function_sint_to_lreal :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1177
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1178
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1179
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1180
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1181
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1182
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1183
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1184
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1185
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1186
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1187
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1188
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1189
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1190
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1191
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1192
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1193
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1194
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1195
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1196
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1197
                symbol_c * return_type_symbol = &search_constant_type_c::lreal_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1198
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1199
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1200
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1201
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1202
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1203
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1204
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1205
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1206
    }/*function_sint_to_lreal*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1207
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1208
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1209
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1210
 *SINT_TO_BYTE
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1211
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1212
    case function_sint_to_byte :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1213
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1214
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1215
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1216
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1217
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1218
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1219
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1220
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1221
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1222
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1223
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1224
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1225
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1226
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1227
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1228
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1229
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1230
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1231
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1232
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1233
                symbol_c * return_type_symbol = &search_constant_type_c::byte_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1234
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1235
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1236
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1237
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1238
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1239
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1240
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1241
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1242
    }/*function_sint_to_byte*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1243
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1244
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1245
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1246
 *SINT_TO_USINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1247
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1248
    case function_sint_to_usint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1249
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1250
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1251
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1252
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1253
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1254
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1255
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1256
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1257
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1258
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1259
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1260
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1261
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1262
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1263
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1264
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1265
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1266
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1267
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1268
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1269
                symbol_c * return_type_symbol = &search_constant_type_c::usint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1270
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1271
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1272
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1273
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1274
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1275
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1276
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1277
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1278
    }/*function_sint_to_usint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1279
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1280
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1281
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1282
 *SINT_TO_ULINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1283
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1284
    case function_sint_to_ulint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1285
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1286
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1287
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1288
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1289
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1290
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1291
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1292
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1293
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1294
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1295
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1296
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1297
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1298
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1299
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1300
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1301
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1302
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1303
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1304
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1305
                symbol_c * return_type_symbol = &search_constant_type_c::ulint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1306
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1307
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1308
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1309
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1310
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1311
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1312
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1313
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1314
    }/*function_sint_to_ulint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1315
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1316
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1317
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1318
 *SINT_TO_BOOL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1319
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1320
    case function_sint_to_bool :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1321
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1322
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1323
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1324
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1325
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1326
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1327
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1328
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1329
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1330
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1331
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1332
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1333
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1334
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1335
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1336
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1337
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1338
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1339
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1340
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1341
                symbol_c * return_type_symbol = &search_constant_type_c::bool_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1342
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1343
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1344
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1345
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1346
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1347
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1348
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1349
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1350
    }/*function_sint_to_bool*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1351
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1352
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1353
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1354
 *SINT_TO_TIME
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1355
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1356
    case function_sint_to_time :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1357
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1358
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1359
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1360
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1361
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1362
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1363
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1364
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1365
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1366
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1367
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1368
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1369
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1370
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1371
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1372
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1373
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1374
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1375
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1376
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1377
                symbol_c * return_type_symbol = &search_constant_type_c::time_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1378
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1379
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1380
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1381
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1382
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1383
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1384
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1385
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1386
    }/*function_sint_to_time*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1387
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1388
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1389
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1390
 *SINT_TO_INT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1391
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1392
    case function_sint_to_int :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1393
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1394
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1395
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1396
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1397
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1398
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1399
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1400
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1401
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1402
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1403
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1404
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1405
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1406
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1407
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1408
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1409
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1410
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::sint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1411
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1412
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1413
                symbol_c * return_type_symbol = &search_constant_type_c::int_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1414
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1415
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1416
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1417
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1418
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1419
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1420
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1421
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1422
    }/*function_sint_to_int*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1423
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1424
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1425
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1426
 *LINT_TO_REAL
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1427
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1428
    case function_lint_to_real :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1429
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1430
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1431
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1432
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1433
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1434
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1435
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1436
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1437
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1438
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1439
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1440
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1441
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1442
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1443
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1444
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1445
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1446
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1447
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1448
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1449
                symbol_c * return_type_symbol = &search_constant_type_c::real_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1450
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1451
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1452
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1453
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1454
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1455
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1456
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1457
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1458
    }/*function_lint_to_real*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1459
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1460
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1461
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1462
 *LINT_TO_SINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1463
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1464
    case function_lint_to_sint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1465
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1466
        symbol_c *last_type_symbol = NULL;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1467
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1468
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1469
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1470
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1471
            symbol_c *IN_param_value = function_call_param_iterator.search_f(IN_param_name);
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1472
            symbol_c *IN_type_symbol = NULL;
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1473
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1474
            /* Get the value from a foo(<param_value>) style call */
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1475
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1476
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1477
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1478
              IN_type_symbol = search_expression_type->get_type(IN_param_value);
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1479
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1480
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1481
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1482
            if(IN_type_symbol == NULL || search_expression_type->is_same_type(&search_constant_type_c::lint_type_name, last_type_symbol))
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1483
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1484
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1485
                symbol_c * return_type_symbol = &search_constant_type_c::sint_type_name;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1486
                return return_type_symbol;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1487
                
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1488
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1489
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1490
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1491
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1492
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1493
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1494
    }/*function_lint_to_sint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1495
    break;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1496
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1497
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1498
 *LINT_TO_DINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1499
 */