absyntax_utils/search_type_code.c
author laurent
Tue, 15 Dec 2009 08:51:44 +0100
changeset 235 ed66dc50f31a
parent 233 3d23a68183d3
child 265 4d222f46f8cc
permissions -rwxr-xr-x
Bug on generate_c_inlinefcall fixed
Adding support for using structures in POU interface
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     1
/*
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     2
 * (c) 2008 Edouard TISSERANT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     3
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     4
 * Offered to the public under the terms of the GNU General Public License
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     5
 * as published by the Free Software Foundation; either version 2 of the
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     6
 * License, or (at your option) any later version.
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     7
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     8
 * This program is distributed in the hope that it will be useful, but
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
     9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    11
 * Public License for more details.
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    12
 *
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    13
 * 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
    14
 * 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
    15
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    16
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    17
/*
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    18
 * An IEC 61131-3 IL and ST compiler.
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
 * Based on the
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    21
 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
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
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    25
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    26
 * IEC 61131-3 standard function library
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    27
 * generated code, do not edit by hand
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    28
 */
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
208
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    32
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
    33
  function_type_t current_function_type;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    34
  function_call_param_iterator_c *tmp_function_call_param_iterator;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    35
  if (st_symbol != NULL && il_symbol == NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    36
    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
    37
    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
    38
  }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    39
  else if (st_symbol == NULL && il_symbol != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    40
    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
    41
    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
    42
  }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    43
  else
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    44
    ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    45
  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
    46
  search_expression_type_c* search_expression_type = this;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    47
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    48
  switch(current_function_type){
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
/****
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    51
 *REAL_TO_SINT
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    52
 */
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    53
    case function_real_to_sint :
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
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    58
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    59
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    60
            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
    61
            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
    62
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    63
            /* 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
    64
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    65
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    66
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    67
              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
    68
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
    69
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    70
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    71
            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
    72
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    73
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    74
                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
    75
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    81
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    82
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    83
    }/*function_real_to_sint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    84
    break;
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
 *REAL_TO_LINT
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
    case function_real_to_lint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    90
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
    91
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    94
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    95
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
    96
            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
    97
            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
    98
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
    99
            /* 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
   100
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   101
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   102
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   103
              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
   104
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   105
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   106
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   107
            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
   108
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   109
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   110
                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
   111
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   117
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   118
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   119
    }/*function_real_to_lint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   120
    break;
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
 *REAL_TO_DINT
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
    case function_real_to_dint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   126
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   127
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   130
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   131
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   132
            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
   133
            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
   134
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   135
            /* 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
   136
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   137
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   138
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   139
              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
   140
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   141
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   142
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   143
            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
   144
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   145
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   146
                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
   147
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   153
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   154
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   155
    }/*function_real_to_dint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   156
    break;
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
 *REAL_TO_DATE
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
    case function_real_to_date :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   162
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   163
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   166
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   167
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   168
            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
   169
            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
   170
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   171
            /* 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
   172
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   173
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   174
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   175
              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
   176
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   177
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   178
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   179
            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
   180
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   181
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   182
                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
   183
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   189
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   190
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   191
    }/*function_real_to_date*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   192
    break;
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
 *REAL_TO_DWORD
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
    case function_real_to_dword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   198
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   199
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   202
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   203
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   204
            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
   205
            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
   206
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   207
            /* 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
   208
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   209
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   210
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   211
              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
   212
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   213
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   214
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   215
            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
   216
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   217
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   218
                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
   219
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   225
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   226
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   227
    }/*function_real_to_dword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   228
    break;
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
 *REAL_TO_DT
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
    case function_real_to_dt :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   234
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   235
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   238
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   239
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   240
            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
   241
            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
   242
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   243
            /* 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
   244
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   245
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   246
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   247
              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
   248
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   249
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   250
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   251
            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
   252
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   253
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   254
                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
   255
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   261
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   262
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   263
    }/*function_real_to_dt*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   264
    break;
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
 *REAL_TO_TOD
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
    case function_real_to_tod :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   270
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   271
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   274
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   275
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   276
            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
   277
            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
   278
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   279
            /* 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
   280
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   281
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   282
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   283
              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
   284
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   285
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   286
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   287
            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
   288
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   289
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   290
                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
   291
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   297
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   298
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   299
    }/*function_real_to_tod*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   300
    break;
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
 *REAL_TO_UDINT
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
    case function_real_to_udint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   306
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   307
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   310
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   311
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   312
            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
   313
            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
   314
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   315
            /* 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
   316
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   317
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   318
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   319
              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
   320
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   321
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   322
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   323
            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
   324
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   325
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   326
                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
   327
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   333
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   334
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   335
    }/*function_real_to_udint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   336
    break;
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
 *REAL_TO_WORD
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
    case function_real_to_word :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   342
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   343
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   346
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   347
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   348
            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
   349
            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
   350
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   351
            /* 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
   352
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   353
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   354
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   355
              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
   356
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   357
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   358
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   359
            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
   360
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   361
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   362
                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
   363
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   369
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   370
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   371
    }/*function_real_to_word*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   372
    break;
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
 *REAL_TO_STRING
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
    case function_real_to_string :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   378
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   379
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   382
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   383
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   384
            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
   385
            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
   386
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   387
            /* 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
   388
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   389
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   390
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   391
              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
   392
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_type->is_same_type(IN_type_symbol, last_type_symbol) ? search_expression_type->common_type(IN_type_symbol, last_type_symbol) : IN_type_symbol ;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   393
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   394
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   395
            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
   396
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   397
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   398
                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
   399
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   405
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   406
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   407
    }/*function_real_to_string*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   408
    break;
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
 *REAL_TO_LWORD
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
    case function_real_to_lword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   414
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   415
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   418
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   419
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   420
            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
   421
            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
   422
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   423
            /* 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
   424
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   425
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   426
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   427
              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
   428
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   429
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   430
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   431
            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
   432
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   433
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   434
                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
   435
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   441
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   442
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   443
    }/*function_real_to_lword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   444
    break;
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
 *REAL_TO_UINT
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
    case function_real_to_uint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   450
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   451
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   454
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   455
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   456
            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
   457
            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
   458
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   459
            /* 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
   460
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   461
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   462
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   463
              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
   464
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   465
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   466
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   467
            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
   468
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   469
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   470
                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
   471
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   477
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   478
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   479
    }/*function_real_to_uint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   480
    break;
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
 *REAL_TO_LREAL
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
    case function_real_to_lreal :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   486
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   487
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   490
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   491
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   492
            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
   493
            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
   494
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   495
            /* 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
   496
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   497
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   498
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   499
              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
   500
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   501
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   502
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   503
            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
   504
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   505
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   506
                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
   507
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   513
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   514
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   515
    }/*function_real_to_lreal*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   516
    break;
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
 *REAL_TO_BYTE
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
    case function_real_to_byte :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   522
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   523
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   526
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   527
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   528
            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
   529
            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
   530
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   531
            /* 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
   532
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   533
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   534
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   535
              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
   536
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   537
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   538
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   539
            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
   540
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   541
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   542
                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
   543
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   549
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   550
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   551
    }/*function_real_to_byte*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   552
    break;
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
 *REAL_TO_USINT
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
    case function_real_to_usint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   558
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   559
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   562
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   563
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   564
            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
   565
            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
   566
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   567
            /* 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
   568
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   569
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   570
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   571
              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
   572
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   573
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   574
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   575
            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
   576
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   577
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   578
                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
   579
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   585
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   586
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   587
    }/*function_real_to_usint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   588
    break;
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
 *REAL_TO_ULINT
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
    case function_real_to_ulint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   594
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   595
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   598
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   599
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   600
            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
   601
            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
   602
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   603
            /* 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
   604
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   605
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   606
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   607
              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
   608
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   609
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   610
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   611
            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
   612
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   613
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   614
                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
   615
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   621
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   622
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   623
    }/*function_real_to_ulint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   624
    break;
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
 *REAL_TO_BOOL
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
    case function_real_to_bool :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   630
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   631
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   634
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   635
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   636
            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
   637
            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
   638
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   639
            /* 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
   640
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   641
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   642
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   643
              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
   644
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   645
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   646
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   647
            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
   648
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   649
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   650
                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
   651
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   657
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   658
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   659
    }/*function_real_to_bool*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   660
    break;
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
 *REAL_TO_TIME
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
    case function_real_to_time :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   666
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   667
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   670
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   671
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   672
            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
   673
            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
   674
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   675
            /* 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
   676
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   677
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   678
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   679
              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
   680
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   681
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   682
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   683
            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
   684
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   685
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   686
                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
   687
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   693
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   694
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   695
    }/*function_real_to_time*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   696
    break;
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
 *REAL_TO_INT
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
    case function_real_to_int :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   702
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   703
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   706
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   707
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   708
            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
   709
            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
   710
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   711
            /* 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
   712
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   713
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   714
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   715
              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
   716
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   717
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   718
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   719
            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
   720
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   721
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   722
                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
   723
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   729
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   730
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   731
    }/*function_real_to_int*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   732
    break;
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
 *SINT_TO_REAL
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
    case function_sint_to_real :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   738
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   739
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   742
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   743
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   744
            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
   745
            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
   746
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   747
            /* 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
   748
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   749
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   750
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   751
              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
   752
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   753
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   754
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   755
            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
   756
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   757
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   758
                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
   759
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   765
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   766
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   767
    }/*function_sint_to_real*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   768
    break;
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
 *SINT_TO_LINT
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
    case function_sint_to_lint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   774
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   775
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   778
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   779
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   780
            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
   781
            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
   782
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   783
            /* 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
   784
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   785
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   786
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   787
              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
   788
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   789
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   790
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   791
            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
   792
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   793
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   794
                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
   795
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   801
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   802
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   803
    }/*function_sint_to_lint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   804
    break;
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
 *SINT_TO_DINT
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
    case function_sint_to_dint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   810
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   811
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   814
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   815
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   816
            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
   817
            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
   818
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   819
            /* 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
   820
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   821
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   822
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   823
              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
   824
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   825
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   826
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   827
            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
   828
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   829
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   830
                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
   831
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   837
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   838
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   839
    }/*function_sint_to_dint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   840
    break;
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
 *SINT_TO_DATE
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
    case function_sint_to_date :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   846
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   847
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   850
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   851
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   852
            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
   853
            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
   854
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   855
            /* 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
   856
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   857
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   858
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   859
              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
   860
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   861
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   862
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   863
            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
   864
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   865
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   866
                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
   867
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   873
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   874
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   875
    }/*function_sint_to_date*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   876
    break;
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
 *SINT_TO_DWORD
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
    case function_sint_to_dword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   882
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   883
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   886
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   887
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   888
            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
   889
            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
   890
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   891
            /* 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
   892
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   893
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   894
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   895
              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
   896
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   897
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   898
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   899
            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
   900
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   901
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   902
                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
   903
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   909
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   910
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   911
    }/*function_sint_to_dword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   912
    break;
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
 *SINT_TO_DT
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
    case function_sint_to_dt :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   918
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   919
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   922
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   923
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   924
            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
   925
            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
   926
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   927
            /* 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
   928
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   929
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   930
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   931
              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
   932
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   933
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   934
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   935
            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
   936
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   937
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   938
                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
   939
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   945
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   946
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   947
    }/*function_sint_to_dt*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   948
    break;
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
 *SINT_TO_TOD
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
    case function_sint_to_tod :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   954
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   955
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   958
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   959
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   960
            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
   961
            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
   962
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   963
            /* 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
   964
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   965
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   966
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   967
              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
   968
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
   969
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   970
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   971
            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
   972
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   973
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   974
                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
   975
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   981
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   982
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   983
    }/*function_sint_to_tod*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   984
    break;
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
 *SINT_TO_UDINT
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
    case function_sint_to_udint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   990
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
   991
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   994
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   995
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
   996
            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
   997
            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
   998
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
   999
            /* 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
  1000
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1001
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1002
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1003
              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
  1004
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1005
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1006
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1007
            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
  1008
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1009
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1010
                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
  1011
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1017
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1018
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1019
    }/*function_sint_to_udint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1020
    break;
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
 *SINT_TO_WORD
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
    case function_sint_to_word :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1026
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1027
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1030
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1031
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1032
            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
  1033
            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
  1034
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1035
            /* 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
  1036
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1037
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1038
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1039
              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
  1040
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1041
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1042
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1043
            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
  1044
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1045
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1046
                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
  1047
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1053
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1054
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1055
    }/*function_sint_to_word*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1056
    break;
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
 *SINT_TO_STRING
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
    case function_sint_to_string :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1062
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1063
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1066
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1067
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1068
            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
  1069
            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
  1070
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1071
            /* 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
  1072
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1073
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1074
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1075
              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
  1076
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1077
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1078
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1079
            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
  1080
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1081
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1082
                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
  1083
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1089
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1090
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1091
    }/*function_sint_to_string*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1092
    break;
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
 *SINT_TO_LWORD
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
    case function_sint_to_lword :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1098
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1099
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1102
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1103
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1104
            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
  1105
            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
  1106
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1107
            /* 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
  1108
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1109
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1110
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1111
              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
  1112
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1113
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1114
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1115
            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
  1116
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1117
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1118
                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
  1119
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1125
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1126
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1127
    }/*function_sint_to_lword*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1128
    break;
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
 *SINT_TO_UINT
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
    case function_sint_to_uint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1134
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1135
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1138
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1139
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1140
            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
  1141
            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
  1142
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1143
            /* 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
  1144
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1145
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1146
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1147
              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
  1148
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1149
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1150
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1151
            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
  1152
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1153
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1154
                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
  1155
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1161
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1162
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1163
    }/*function_sint_to_uint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1164
    break;
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
 *SINT_TO_LREAL
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
    case function_sint_to_lreal :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1170
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1171
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1174
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1175
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1176
            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
  1177
            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
  1178
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1179
            /* 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
  1180
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1181
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1182
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1183
              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
  1184
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1185
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1186
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1187
            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
  1188
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1189
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1190
                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
  1191
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1197
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1198
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1199
    }/*function_sint_to_lreal*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1200
    break;
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
 *SINT_TO_BYTE
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
    case function_sint_to_byte :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1206
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1207
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1210
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1211
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1212
            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
  1213
            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
  1214
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1215
            /* 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
  1216
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1217
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1218
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1219
              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
  1220
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1221
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1222
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1223
            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
  1224
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1225
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1226
                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
  1227
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1233
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1234
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1235
    }/*function_sint_to_byte*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1236
    break;
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
 *SINT_TO_USINT
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
    case function_sint_to_usint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1242
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1243
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1246
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1247
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1248
            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
  1249
            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
  1250
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1251
            /* 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
  1252
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1253
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1254
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1255
              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
  1256
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1257
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1258
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1259
            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
  1260
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1261
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1262
                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
  1263
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1269
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1270
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1271
    }/*function_sint_to_usint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1272
    break;
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
 *SINT_TO_ULINT
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
    case function_sint_to_ulint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1278
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1279
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1282
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1283
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1284
            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
  1285
            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
  1286
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1287
            /* 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
  1288
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1289
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1290
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1291
              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
  1292
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1293
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1294
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1295
            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
  1296
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1297
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1298
                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
  1299
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1305
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1306
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1307
    }/*function_sint_to_ulint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1308
    break;
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
 *SINT_TO_BOOL
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
    case function_sint_to_bool :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1314
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1315
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1318
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1319
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1320
            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
  1321
            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
  1322
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1323
            /* 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
  1324
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1325
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1326
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1327
              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
  1328
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1329
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1330
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1331
            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
  1332
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1333
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1334
                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
  1335
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1341
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1342
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1343
    }/*function_sint_to_bool*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1344
    break;
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
 *SINT_TO_TIME
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
    case function_sint_to_time :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1350
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1351
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1354
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1355
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1356
            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
  1357
            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
  1358
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1359
            /* 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
  1360
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1361
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1362
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1363
              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
  1364
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1365
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1366
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1367
            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
  1368
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1369
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1370
                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
  1371
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1377
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1378
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1379
    }/*function_sint_to_time*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1380
    break;
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
 *SINT_TO_INT
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
    case function_sint_to_int :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1386
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1387
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1390
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1391
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1392
            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
  1393
            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
  1394
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1395
            /* 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
  1396
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1397
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1398
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1399
              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
  1400
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1401
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1402
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1403
            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
  1404
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1405
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1406
                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
  1407
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1413
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1414
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1415
    }/*function_sint_to_int*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1416
    break;
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
 *LINT_TO_REAL
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
    case function_lint_to_real :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1422
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1423
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1426
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1427
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1428
            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
  1429
            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
  1430
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1431
            /* 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
  1432
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1433
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1434
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1435
              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
  1436
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1437
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1438
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1439
            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
  1440
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1441
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1442
                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
  1443
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1449
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1450
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1451
    }/*function_lint_to_real*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1452
    break;
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
 *LINT_TO_SINT
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
    case function_lint_to_sint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1458
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1459
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1462
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1463
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1464
            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
  1465
            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
  1466
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1467
            /* 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
  1468
            if (IN_param_value == NULL)
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1469
              IN_param_value = function_call_param_iterator.next_nf();
181
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1470
            if (IN_param_value != NULL) {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1471
              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
  1472
              last_type_symbol = last_type_symbol && IN_type_symbol && search_expression_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
  1473
            }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1474
            
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1475
            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
  1476
            {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1477
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1478
                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
  1479
                return return_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
            
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
            ERROR;
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1485
        }
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1486
        
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1487
    }/*function_lint_to_sint*/
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1488
    break;
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
 *LINT_TO_DINT
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
    case function_lint_to_dint :
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1494
    {
38d6eb056260 Moving absyntax utility files out from stage4/generate_c
mario
parents:
diff changeset
  1495
        symbol_c *last_type_symbol = NULL;
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
        {
235
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1498
            symbol_c *IN_param_name = (symbol_c *)(new identifier_c("IN"));
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1499
            /* Get the value from a foo(<param_name> = <param_value>) style call */
ed66dc50f31a Bug on generate_c_inlinefcall fixed
laurent
parents: 233
diff changeset
  1500
            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
  1501
            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
  1502
            
c72748a12ae3 Modify code generated to fit latest modifications in matiec and useless symbol definitions
laurent
parents: 181
diff changeset
  1503
            /* 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