stage3/datatype_functions.cc
author Mario de Sousa <msousa@fe.up.pt>
Sun, 11 Mar 2012 16:38:05 +0000
changeset 474 85cacf5298fb
parent 468 46f8154d506e
child 475 28816126cf8d
permissions -rw-r--r--
Fix some 'widen' table entries.
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     1
/*
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     2
 *  matiec - a compiler for the programming languages defined in IEC 61131-3
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     3
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     4
 *  Copyright (C) 2009-2012  Mario de Sousa (msousa@fe.up.pt)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     5
 *  Copyright (C) 2012       Manuele Conti  (conti.ma@alice.it)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     6
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     7
 *  This program is free software: you can redistribute it and/or modify
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     8
 *  it under the terms of the GNU General Public License as published by
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
     9
 *  the Free Software Foundation, either version 3 of the License, or
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    10
 *  (at your option) any later version.
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    11
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    12
 *  This program is distributed in the hope that it will be useful,
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    15
 *  GNU General Public License for more details.
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    16
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    17
 *  You should have received a copy of the GNU General Public License
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    18
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    19
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    20
 *
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    21
 * This code is made available on the understanding that it will not be
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    22
 * used in safety-critical situations without a full and competent review.
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    23
 */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    24
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    25
#include "datatype_functions.hh"
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    26
#include "../absyntax_utils/absyntax_utils.hh"
457
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
    27
#include <vector>
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
    28
// #include <algorithm>
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    29
434
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    30
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    31
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    32
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    33
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    34
elementary_type_c *elementary_type_c::singleton = NULL;
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    35
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    36
const char *elementary_type_c::to_string(symbol_c *symbol) {
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    37
  if (NULL == singleton)    singleton = new elementary_type_c;
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    38
  if (NULL == singleton)    ERROR;
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    39
  const char *res           = (const char *)symbol->accept(*singleton);
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    40
  if (NULL == res) {
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    41
	  int i = 1;
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    42
  }
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    43
  return res;
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    44
}
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    45
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    46
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    47
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    48
c1278e52bcbc Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents: 425
diff changeset
    49
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    50
/*
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    51
 * 2.5.1.5.6 Functions of time data types
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    52
 * Table 30 - page 64
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    53
 */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    54
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    55
const struct widen_entry widen_ADD_table[] = {
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    56
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    57
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    58
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    59
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    60
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    61
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    62
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    63
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    64
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    65
    /* SAFE version on the left... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    66
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    67
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    68
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    69
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    70
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    71
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    72
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    73
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    74
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    75
    /********************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    76
    /* SAFE version on the right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    77
    /********************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    78
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    79
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    80
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    81
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetod_type_name,         &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    82
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    83
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    84
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safedt_type_name,          &search_constant_type_c::dt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    85
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    86
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    87
    /* SAFE version on left and right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    88
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    89
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    90
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    91
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    92
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    93
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name, widen_entry::deprecated },         
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    94
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    95
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    96
   
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
    97
    { NULL, NULL, NULL, widen_entry::ok },
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    98
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    99
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   100
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   101
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   102
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   103
const struct widen_entry widen_SUB_table[] = {
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   104
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   105
    { &search_constant_type_c::date_type_name,          &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   106
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   107
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   108
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   109
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   110
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   111
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   112
    /* SAFE version on the left... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   113
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   114
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   115
    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   116
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   117
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   118
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   119
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   120
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   121
    /********************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   122
    /* SAFE version on the right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   123
    /********************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   124
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,            &search_constant_type_c::time_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   125
    { &search_constant_type_c::date_type_name,          &search_constant_type_c::safedate_type_name,            &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   126
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,            &search_constant_type_c::tod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   127
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetod_type_name,             &search_constant_type_c::time_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   128
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,            &search_constant_type_c::dt_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   129
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safedt_type_name,              &search_constant_type_c::time_type_name, widen_entry::deprecated },        
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   130
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   131
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   132
    /* SAFE version on left and right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   133
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   134
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safetime_type_name, widen_entry::ok         },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   135
    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::safedate_type_name,            &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   136
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safetod_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   137
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,             &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   138
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safedt_type_name, widen_entry::deprecated },
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   139
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safedt_type_name,              &search_constant_type_c::safetime_type_name, widen_entry::deprecated },        
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   140
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   141
    { NULL, NULL, NULL, widen_entry::ok },
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   142
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   143
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   144
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   145
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   146
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   147
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   148
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   149
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   150
const struct widen_entry widen_MUL_table[] = {
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   151
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::lreal_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   152
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::real_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   153
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::dint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   154
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::int_type_name,             &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   155
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::sint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   156
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::ulint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   157
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::udint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   158
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::uint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   159
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::usint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   160
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   161
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::lreal_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   162
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::real_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   163
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   164
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::int_type_name,             &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   165
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::sint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   166
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::ulint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   167
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::udint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   168
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::uint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   169
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::usint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   170
                                                                                                                                                                                 
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   171
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safelreal_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   172
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safereal_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   173
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   174
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeint_type_name,         &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   175
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safesint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   176
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeulint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   177
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeudint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   178
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeuint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   179
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeusint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   180
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   181
    { NULL, NULL, NULL, widen_entry::ok },
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   182
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   183
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   184
const struct widen_entry widen_DIV_table[] = {
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   185
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::lreal_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   186
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::real_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   187
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::dint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   188
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::int_type_name,             &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   189
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::sint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   190
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::ulint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   191
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::udint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   192
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::uint_type_name,            &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   193
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::usint_type_name,           &search_constant_type_c::time_type_name     , widen_entry::deprecated },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   194
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   195
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::lreal_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   196
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::real_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   197
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   198
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::int_type_name,             &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   199
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::sint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   200
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::ulint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   201
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::udint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   202
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::uint_type_name,            &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   203
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::usint_type_name,           &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   204
                                                                                                                                                                                  
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   205
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safelreal_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   206
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safereal_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   207
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   208
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeint_type_name,         &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   209
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safesint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   210
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeulint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   211
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeudint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   212
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeuint_type_name,        &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   213
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safeusint_type_name,       &search_constant_type_c::safetime_type_name , widen_entry::ok         },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   214
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   215
    { NULL, NULL, NULL, widen_entry::ok },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   216
 };
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   217
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   218
 
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   219
 
425
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   220
/* Search for a datatype inside a candidate_datatypes list.
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   221
 * Returns: position of datatype in the list, or -1 if not found.
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   222
 */
445
e6c34ee82954 Change name help function.
Conti Manuele <conti.ma@alice.it>
parents: 443
diff changeset
   223
int search_in_candidate_datatype_list(symbol_c *datatype, std::vector <symbol_c *> candidate_datatypes) {
443
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   224
	if (NULL == datatype) 
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   225
		return -1;
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   226
425
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   227
	for(unsigned int i = 0; i < candidate_datatypes.size(); i++)
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   228
		if (is_type_equal(datatype, candidate_datatypes[i]))
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   229
			return i;
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   230
	/* Not found ! */
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   231
	return -1;
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   232
}
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   233
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   234
443
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   235
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   236
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   237
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   238
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   239
457
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   240
/* Intersect two candidate_datatype_lists.
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   241
 * Remove from list1 (origin, dest.) all elements that are not found in list2 (with).
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   242
 * In essence, list1 will contain the result of the intersection of list1 with list2.
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   243
 * In other words, modify list1 so it only contains the elelements that are simultaneously in list1 and list2!
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   244
 */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   245
void intersect_candidate_datatype_list(symbol_c *list1 /*origin, dest.*/, symbol_c *list2 /*with*/) {
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   246
	if ((NULL == list1) || (NULL == list2))
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   247
		/* In principle, we should never call it with NULL values. Best to abort the compiler just in case! */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   248
		return;
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   249
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   250
	for(std::vector<symbol_c *>::iterator i = list1->candidate_datatypes.begin(); i < list1->candidate_datatypes.end(); ) {
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   251
		/* Note that we do _not_ increment i in the for() loop!
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   252
		 * When we erase an element from position i, a new element will take it's place, that must also be tested! 
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   253
		 */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   254
		if (search_in_candidate_datatype_list(*i, list2->candidate_datatypes) < 0)
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   255
			/* remove this element! This will change the value of candidate_datatypes.size() */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   256
			list1->candidate_datatypes.erase(i);
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   257
		else i++;
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   258
	}
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   259
}
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   260
443
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   261
ff4d26b7e51d Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents: 436
diff changeset
   262
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   263
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   264
/* intersect the candidate_datatype lists of all prev_il_intructions, and set the local candidate_datatype list to the result! */
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   265
void intersect_prev_candidate_datatype_lists(il_instruction_c *symbol) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   266
	if (symbol->prev_il_instruction.empty())
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   267
		return;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   268
	
468
46f8154d506e Delete unecessary copy_candidate_datatype_list() function.
Mario de Sousa <msousa@fe.up.pt>
parents: 467
diff changeset
   269
	symbol->candidate_datatypes = symbol->prev_il_instruction[0]->candidate_datatypes;
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   270
	for (unsigned int i = 1; i < symbol->prev_il_instruction.size(); i++) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   271
		intersect_candidate_datatype_list(symbol /*origin, dest.*/, symbol->prev_il_instruction[i] /*with*/);
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   272
	}  
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   273
}
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   274
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   275
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   276
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   277
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   278
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   279
bool is_ANY_ELEMENTARY_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   280
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   281
  return is_ANY_MAGNITUDE_type(type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   282
      || is_ANY_BIT_type      (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   283
      || is_ANY_STRING_type   (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   284
      || is_ANY_DATE_type     (type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   285
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   286
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   287
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   288
bool is_ANY_SAFEELEMENTARY_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   289
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   290
  return is_ANY_SAFEMAGNITUDE_type(type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   291
      || is_ANY_SAFEBIT_type      (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   292
      || is_ANY_SAFESTRING_type   (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   293
      || is_ANY_SAFEDATE_type     (type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   294
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   295
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   296
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   297
bool is_ANY_ELEMENTARY_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   298
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   299
  /* NOTE: doing
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   300
   *          return is_ANY_SAFEELEMENTARY_type() || is_ANY_ELEMENTARY_type()
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   301
   *       is incorrect, as the literals would never be considered compatible...
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   302
   */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   303
  return is_ANY_MAGNITUDE_compatible(type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   304
      || is_ANY_BIT_compatible      (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   305
      || is_ANY_STRING_compatible   (type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   306
      || is_ANY_DATE_compatible     (type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   307
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   308
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   309
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   310
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   311
bool is_ANY_MAGNITUDE_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   312
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   313
  if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   314
  return is_ANY_NUM_type(type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   315
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   316
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   317
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   318
bool is_ANY_signed_MAGNITUDE_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   319
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   320
  if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   321
  return is_ANY_signed_NUM_type(type_symbol);
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   322
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   323
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   324
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   325
bool is_ANY_SAFEMAGNITUDE_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   326
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   327
  if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   328
  return is_ANY_SAFENUM_type(type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   329
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   330
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   331
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   332
bool is_ANY_signed_SAFEMAGNITUDE_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   333
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   334
  if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   335
  return is_ANY_signed_SAFENUM_type(type_symbol);
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   336
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   337
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   338
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   339
bool is_ANY_MAGNITUDE_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   340
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   341
  if (is_ANY_MAGNITUDE_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   342
  if (is_ANY_SAFEMAGNITUDE_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   343
  return is_ANY_NUM_compatible(type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   344
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   345
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   346
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   347
bool is_ANY_signed_MAGNITUDE_compatible(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   348
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   349
  if (is_ANY_signed_MAGNITUDE_type    (type_symbol))       {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   350
  if (is_ANY_signed_SAFEMAGNITUDE_type(type_symbol))       {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   351
  return is_ANY_signed_NUM_compatible(type_symbol);
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   352
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   353
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   354
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   355
bool is_ANY_NUM_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   356
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   357
  if (is_ANY_REAL_type(type_symbol))                       {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   358
  if (is_ANY_INT_type(type_symbol))                        {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   359
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   360
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   361
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   362
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   363
bool is_ANY_signed_NUM_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   364
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   365
  if (is_ANY_REAL_type(type_symbol))                       {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   366
  if (is_ANY_signed_INT_type(type_symbol))                 {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   367
  return false;
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   368
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   369
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   370
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   371
bool is_ANY_SAFENUM_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   372
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   373
  return is_ANY_SAFEREAL_type(type_symbol)
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   374
      || is_ANY_SAFEINT_type (type_symbol);
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   375
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   376
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   377
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   378
bool is_ANY_signed_SAFENUM_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   379
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   380
  return is_ANY_SAFEREAL_type(type_symbol)
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   381
      || is_ANY_signed_SAFEINT_type (type_symbol);
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   382
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   383
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   384
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   385
bool is_ANY_NUM_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   386
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   387
  if (is_ANY_REAL_compatible(type_symbol))                       {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   388
  if (is_ANY_INT_compatible(type_symbol))                        {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   389
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   390
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   391
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   392
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   393
bool is_ANY_signed_NUM_compatible(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   394
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   395
  if (is_ANY_REAL_compatible(type_symbol))                       {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   396
  if (is_ANY_signed_INT_compatible(type_symbol))                 {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   397
  return false;
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   398
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   399
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   400
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   401
bool is_ANY_DATE_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   402
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   403
  if (typeid(*type_symbol) == typeid(date_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   404
  if (typeid(*type_symbol) == typeid(tod_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   405
  if (typeid(*type_symbol) == typeid(dt_type_name_c))   {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   406
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   407
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   408
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   409
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   410
bool is_ANY_SAFEDATE_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   411
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   412
  if (typeid(*type_symbol) == typeid(safedate_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   413
  if (typeid(*type_symbol) == typeid(safetod_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   414
  if (typeid(*type_symbol) == typeid(safedt_type_name_c))   {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   415
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   416
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   418
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   419
bool is_ANY_DATE_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   420
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   421
  if (is_ANY_DATE_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   422
  if (is_ANY_SAFEDATE_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   423
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   424
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   425
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   426
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   427
bool is_ANY_STRING_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   428
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   429
  if (typeid(*type_symbol) == typeid(string_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   430
  if (typeid(*type_symbol) == typeid(wstring_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   431
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   432
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   433
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   434
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   435
bool is_ANY_SAFESTRING_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   436
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   437
  if (typeid(*type_symbol) == typeid(safestring_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   438
  if (typeid(*type_symbol) == typeid(safewstring_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   439
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   440
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   441
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   442
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   443
bool is_ANY_STRING_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   444
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   445
  if (is_ANY_STRING_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   446
  if (is_ANY_SAFESTRING_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   447
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   448
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   449
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   450
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   451
bool is_ANY_INT_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   452
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   453
  if (typeid(*type_symbol) == typeid(sint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   454
  if (typeid(*type_symbol) == typeid(int_type_name_c))   {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   455
  if (typeid(*type_symbol) == typeid(dint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   456
  if (typeid(*type_symbol) == typeid(lint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   457
  if (typeid(*type_symbol) == typeid(usint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   458
  if (typeid(*type_symbol) == typeid(uint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   459
  if (typeid(*type_symbol) == typeid(udint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   460
  if (typeid(*type_symbol) == typeid(ulint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   461
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   462
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   463
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   464
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   465
bool is_ANY_signed_INT_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   466
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   467
  if (typeid(*type_symbol) == typeid(sint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   468
  if (typeid(*type_symbol) == typeid(int_type_name_c))   {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   469
  if (typeid(*type_symbol) == typeid(dint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   470
  if (typeid(*type_symbol) == typeid(lint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   471
  return false;
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   472
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   473
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   474
/* A helper function... */
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   475
bool is_ANY_signed_SAFEINT_type(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   476
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   477
  if (typeid(*type_symbol) == typeid(safesint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   478
  if (typeid(*type_symbol) == typeid(safeint_type_name_c))   {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   479
  if (typeid(*type_symbol) == typeid(safedint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   480
  if (typeid(*type_symbol) == typeid(safelint_type_name_c))  {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   481
  return false;
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   482
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   483
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   484
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   485
bool is_ANY_SAFEINT_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   486
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   487
  if (typeid(*type_symbol) == typeid(safesint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   488
  if (typeid(*type_symbol) == typeid(safeint_type_name_c))   {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   489
  if (typeid(*type_symbol) == typeid(safedint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   490
  if (typeid(*type_symbol) == typeid(safelint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   491
  if (typeid(*type_symbol) == typeid(safeusint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   492
  if (typeid(*type_symbol) == typeid(safeuint_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   493
  if (typeid(*type_symbol) == typeid(safeudint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   494
  if (typeid(*type_symbol) == typeid(safeulint_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   495
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   496
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   497
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   498
/* A helper function... */
435
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   499
bool is_ANY_signed_INT_compatible(symbol_c *type_symbol) {
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   500
  if (type_symbol == NULL) {return false;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   501
  if (is_ANY_signed_INT_type    (type_symbol))              {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   502
  if (is_ANY_signed_SAFEINT_type(type_symbol))              {return true;}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   503
  return false;
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   504
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   505
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   506
/* A helper function... */
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   507
bool is_ANY_INT_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   508
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   509
  if (is_ANY_INT_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   510
  if (is_ANY_SAFEINT_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   511
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   512
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   513
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   514
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   515
bool is_ANY_REAL_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   516
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   517
  if (typeid(*type_symbol) == typeid(real_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   518
  if (typeid(*type_symbol) == typeid(lreal_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   519
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   520
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   521
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   522
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   523
bool is_ANY_SAFEREAL_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   524
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   525
  if (typeid(*type_symbol) == typeid(safereal_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   526
  if (typeid(*type_symbol) == typeid(safelreal_type_name_c)) {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   527
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   528
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   529
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   530
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   531
bool is_ANY_REAL_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   532
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   533
  if (is_ANY_REAL_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   534
  if (is_ANY_SAFEREAL_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   535
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   536
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   537
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   538
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   539
bool is_ANY_BIT_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   540
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   541
  if (typeid(*type_symbol) == typeid(bool_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   542
  if (typeid(*type_symbol) == typeid(byte_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   543
  if (typeid(*type_symbol) == typeid(word_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   544
  if (typeid(*type_symbol) == typeid(dword_type_name_c))    {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   545
  if (typeid(*type_symbol) == typeid(lword_type_name_c))    {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   546
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   547
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   548
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   549
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   550
bool is_ANY_SAFEBIT_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   551
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   552
  if (typeid(*type_symbol) == typeid(safebool_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   553
  if (typeid(*type_symbol) == typeid(safebyte_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   554
  if (typeid(*type_symbol) == typeid(safeword_type_name_c))     {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   555
  if (typeid(*type_symbol) == typeid(safedword_type_name_c))    {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   556
  if (typeid(*type_symbol) == typeid(safelword_type_name_c))    {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   557
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   558
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   559
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   560
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   561
bool is_ANY_BIT_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   562
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   563
  if (is_ANY_BIT_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   564
  if (is_ANY_SAFEBIT_type(type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   565
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   566
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   567
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   568
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   569
bool is_BOOL_type(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   570
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   571
  if (typeid(*type_symbol) == typeid(bool_type_name_c))      {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   572
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   573
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   574
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   575
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   576
bool is_SAFEBOOL_type(symbol_c *type_symbol){
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   577
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   578
  if (typeid(*type_symbol) == typeid(safebool_type_name_c))  {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   579
  return false;
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   580
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   581
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   582
/* A helper function... */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   583
bool is_ANY_BOOL_compatible(symbol_c *type_symbol) {
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   584
  if (type_symbol == NULL) {return false;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   585
  if (is_BOOL_type    (type_symbol))              {return true;}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   586
  if (is_SAFEBOOL_type(type_symbol))              {return true;}
436
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   587
  return false;
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   588
}
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   589
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   590
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   591
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   592
417
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   593
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   594
bool is_type_equal(symbol_c *first_type, symbol_c *second_type) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   595
  if ((NULL == first_type) || (NULL == second_type))
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   596
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   597
  if (typeid(* first_type) == typeid(invalid_type_name_c))
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   598
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   599
  if (typeid(*second_type) == typeid(invalid_type_name_c))
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   600
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   601
    
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   602
  if (is_ANY_ELEMENTARY_type(first_type)) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   603
      if (typeid(*first_type) == typeid(*second_type))
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   604
          return true;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   605
  } else   /* ANY_DERIVED */
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   606
      return (first_type == second_type);
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   607
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   608
  return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   609
}
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   610
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   611
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   612
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   613
bool is_type_valid(symbol_c *type) {
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   614
  if (NULL == type)
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   615
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   616
  if (typeid(*type) == typeid(invalid_type_name_c))
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   617
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   618
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   619
  return true;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   620
}