stage3/datatype_functions.cc
author Mario de Sousa <msousa@fe.up.pt>
Sun, 11 Mar 2012 18:24:39 +0000
changeset 475 28816126cf8d
parent 474 85cacf5298fb
child 478 b13feab3b918
permissions -rw-r--r--
Fix remaining 'widen' tables.
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
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    50
/* Macro that expand to subtypes */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    51
/* copied from matiec/lib/create_standard_functions_txt.sh */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    52
#define __ANY(DO)                 __ANY_DERIVED(DO) __ANY_ELEMENTARY(DO)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    53
#define __ANY_DERIVED(DO)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    54
#define __ANY_ELEMENTARY(DO)      __ANY_MAGNITUDE(DO) __ANY_BIT(DO) __ANY_STRING(DO) __ANY_DATE(DO)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    55
#define __ANY_MAGNITUDE(DO)       __ANY_NUM(DO) DO(TIME)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    56
#define __ANY_BIT(DO)             __ANY_NBIT(DO) DO(BOOL)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    57
#define __ANY_NBIT(DO)            DO(byte) DO(word) DO(dword) DO(lword)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    58
//#define __ANY_STRING(DO)          DO(string) DO(wstring)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    59
#define __ANY_STRING(DO)          DO(string)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    60
#define __ANY_DATE(DO)            DO(date) DO(tod) DO(dt)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    61
#define __ANY_NUM(DO)             __ANY_REAL(DO) __ANY_INT(DO)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    62
#define __ANY_REAL(DO)            DO(real) DO(lreal)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    63
#define __ANY_INT(DO)             __ANY_SINT(DO) __ANY_UINT(DO)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    64
#define __ANY_SINT(DO)            DO(sint) DO(int) DO(dint) DO(lint)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    65
#define __ANY_UINT(DO)            DO(usint) DO(uint) DO(udint) DO(ulint)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    66
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    67
#define __ANY_1(DO,P1)            __ANY_DERIVED_1(DO,P1) __ANY_ELEMENTARY_1(DO,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    68
#define __ANY_DERIVED_1(DO,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    69
#define __ANY_ELEMENTARY_1(DO,P1) __ANY_MAGNITUDE_1(DO,P1) __ANY_BIT_1(DO,P1) __ANY_STRING_1(DO,P1) __ANY_DATE_1(DO,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    70
#define __ANY_MAGNITUDE_1(DO,P1)  __ANY_NUM_1(DO,P1) DO(TIME,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    71
#define __ANY_BIT_1(DO,P1)        __ANY_NBIT_1(DO,P1) DO(BOOL,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    72
#define __ANY_NBIT_1(DO,P1)       DO(byte,P1) DO(word,P1) DO(dword,P1) DO(lword,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    73
// #define __ANY_STRING_1(DO,P1)     DO(string,P1) DO(wstring,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    74
#define __ANY_STRING_1(DO,P1)     DO(string,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    75
#define __ANY_DATE_1(DO,P1)       DO(date,P1) DO(tod,P1) DO(dt,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    76
#define __ANY_NUM_1(DO,P1)        __ANY_REAL_1(DO,P1) __ANY_INT_1(DO,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    77
#define __ANY_REAL_1(DO,P1)       DO(real,P1) DO(lreal,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    78
#define __ANY_INT_1(DO,P1)        __ANY_SINT_1(DO,P1) __ANY_UINT_1(DO,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    79
#define __ANY_SINT_1(DO,P1)       DO(sint,P1) DO(int,P1) DO(dint,P1) DO(lint,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    80
#define __ANY_UINT_1(DO,P1)       DO(usint,P1) DO(uint,P1) DO(udint,P1) DO(ulint,P1)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    81
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    82
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    83
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
    84
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
    85
/*
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    86
 * 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
    87
 * 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
    88
 */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    89
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
    90
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
    91
    { &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
    92
    { &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
    93
    /* 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
    94
    { &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
    95
    { &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
    96
    /* 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
    97
    { &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
    98
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
    99
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   100
    /* SAFE version on the left... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   101
    /*******************************/
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   102
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,     widen_entry::ok         },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   103
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   104
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   105
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::tod_type_name,             &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   106
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,       widen_entry::deprecated },         
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   107
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   108
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::dt_type_name,              &search_constant_type_c::dt_type_name,       widen_entry::deprecated },         
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   109
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
    /* SAFE version on the right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   112
    /********************************/
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   113
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,        &search_constant_type_c::time_type_name,     widen_entry::ok         },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   114
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,        &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   115
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   116
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetod_type_name,         &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   117
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,        &search_constant_type_c::dt_type_name,       widen_entry::deprecated },         
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   118
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   119
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safedt_type_name,          &search_constant_type_c::dt_type_name,       widen_entry::deprecated },         
474
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 left and 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::safetime_type_name,      &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetime_type_name, widen_entry::ok         },
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   125
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safetod_type_name,  widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   126
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   127
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safetod_type_name,         &search_constant_type_c::safetod_type_name,  widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   128
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,        &search_constant_type_c::safedt_type_name,   widen_entry::deprecated },         
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   129
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'addition' is supposed to be commutative, we add it anyway... */
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   130
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safedt_type_name,          &search_constant_type_c::safedt_type_name,   widen_entry::deprecated },
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   131
   
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   132
    { 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
   133
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   134
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   135
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   136
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   137
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   138
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   139
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   140
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
   141
const struct widen_entry widen_SUB_table[] = {
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   142
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,     widen_entry::ok         },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   143
    { &search_constant_type_c::date_type_name,          &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   144
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   145
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   146
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,       widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   147
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name,     widen_entry::deprecated },        
474
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
    /*******************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   150
    /* SAFE version on the left... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   151
    /*******************************/
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   152
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::time_type_name,            &search_constant_type_c::time_type_name,     widen_entry::ok         },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   153
    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::date_type_name,            &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   154
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::time_type_name,            &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   155
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::tod_type_name,             &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   156
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::time_type_name,            &search_constant_type_c::dt_type_name,       widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   157
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::dt_type_name,              &search_constant_type_c::time_type_name,     widen_entry::deprecated },        
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   158
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   159
    /********************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   160
    /* SAFE version on the right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   161
    /********************************/
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   162
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safetime_type_name,            &search_constant_type_c::time_type_name,     widen_entry::ok         },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   163
    { &search_constant_type_c::date_type_name,          &search_constant_type_c::safedate_type_name,            &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   164
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetime_type_name,            &search_constant_type_c::tod_type_name,      widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   165
    { &search_constant_type_c::tod_type_name,           &search_constant_type_c::safetod_type_name,             &search_constant_type_c::time_type_name,     widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   166
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safetime_type_name,            &search_constant_type_c::dt_type_name,       widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   167
    { &search_constant_type_c::dt_type_name,            &search_constant_type_c::safedt_type_name,              &search_constant_type_c::time_type_name,     widen_entry::deprecated },        
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   168
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   169
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   170
    /* SAFE version on left and right... */
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   171
    /*************************************/
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   172
    { &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
   173
    { &search_constant_type_c::safedate_type_name,      &search_constant_type_c::safedate_type_name,            &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   174
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safetod_type_name,  widen_entry::deprecated },
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   175
    { &search_constant_type_c::safetod_type_name,       &search_constant_type_c::safetod_type_name,             &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   176
    { &search_constant_type_c::safedt_type_name,        &search_constant_type_c::safetime_type_name,            &search_constant_type_c::safedt_type_name,   widen_entry::deprecated },
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   177
    { &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
   178
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   179
    { 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
   180
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   181
474
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   182
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   183
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   184
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   185
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   186
85cacf5298fb Fix some 'widen' table entries.
Mario de Sousa <msousa@fe.up.pt>
parents: 468
diff changeset
   187
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
   188
const struct widen_entry widen_MUL_table[] = {
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   189
#define __multime(TYPE)       \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   190
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   191
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   192
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safe##TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   193
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safe##TYPE##_type_name,           &search_constant_type_c::safetime_type_name, widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   194
    /* NOTE: the standard des not explicitly support the following semantics. However, since 'multiplication' is supposed to be commutative, we add it anyway... */ \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   195
    { &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::time_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   196
    { &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::time_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   197
    { &search_constant_type_c::TYPE##_type_name,          &search_constant_type_c::safetime_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   198
    { &search_constant_type_c::safe##TYPE##_type_name,    &search_constant_type_c::safetime_type_name,           &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   199
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   200
    __ANY_NUM(__multime)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   201
#undef __multime
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   202
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   203
    { 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
   204
};
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   205
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   206
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   207
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   208
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   209
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
   210
const struct widen_entry widen_DIV_table[] = {
475
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   211
#define __divtime(TYPE)       \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   212
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   213
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   214
    { &search_constant_type_c::time_type_name,          &search_constant_type_c::safe##TYPE##_type_name,           &search_constant_type_c::time_type_name,     widen_entry::deprecated }, \
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   215
    { &search_constant_type_c::safetime_type_name,      &search_constant_type_c::safe##TYPE##_type_name,           &search_constant_type_c::safetime_type_name, widen_entry::deprecated },
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   216
    __ANY_NUM(__divtime)
28816126cf8d Fix remaining 'widen' tables.
Mario de Sousa <msousa@fe.up.pt>
parents: 474
diff changeset
   217
#undef __divtime
458
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
    { NULL, NULL, NULL, widen_entry::ok },
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   220
 };
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   221
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   222
 
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   223
 
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
   224
/* 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
   225
 * 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
   226
 */
445
e6c34ee82954 Change name help function.
Conti Manuele <conti.ma@alice.it>
parents: 443
diff changeset
   227
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
   228
	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
   229
		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
   230
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
   231
	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
   232
		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
   233
			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
   234
	/* 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
   235
	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
   236
}
c8e6cf57324a Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents: 417
diff changeset
   237
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
   238
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
   239
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
   240
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
   241
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
   242
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
   243
457
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   244
/* Intersect two candidate_datatype_lists.
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   245
 * 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
   246
 * 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
   247
 * 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
   248
 */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   249
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
   250
	if ((NULL == list1) || (NULL == list2))
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   251
		/* 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
   252
		return;
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
	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
   255
		/* 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
   256
		 * 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
   257
		 */
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   258
		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
   259
			/* 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
   260
			list1->candidate_datatypes.erase(i);
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   261
		else i++;
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   262
	}
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   263
}
67d8b07bac22 Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents: 447
diff changeset
   264
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
   265
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
   266
458
587884880be6 iAdd warning for deprecated operations.
Conti Manuele <conti.ma@alice.it>
parents: 457
diff changeset
   267
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   268
/* 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
   269
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
   270
	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
   271
		return;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   272
	
468
46f8154d506e Delete unecessary copy_candidate_datatype_list() function.
Mario de Sousa <msousa@fe.up.pt>
parents: 467
diff changeset
   273
	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
   274
	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
   275
		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
   276
	}  
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   277
}
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   278
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   279
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   280
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   281
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
   282
/* 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
   283
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
   284
  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
   285
  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
   286
      || 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
   287
      || 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
   288
      || 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
   289
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   292
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
   293
  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
   294
  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
   295
      || 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
   296
      || 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
   297
      || 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
   298
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   301
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
   302
  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
   303
  /* 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
   304
   *          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
   305
   *       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
   306
   */
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
  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
   308
      || 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
   309
      || 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
   310
      || 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
   311
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   315
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
   316
  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
   317
  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
   318
  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
   319
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   320
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   321
/* 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
   322
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
   323
  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
   324
  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
   325
  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
   326
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   327
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   328
/* 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
   329
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
   330
  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
   331
  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
   332
  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
   333
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   334
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   335
/* 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
   336
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
   337
  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
   338
  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
   339
  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
   340
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   341
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   342
/* 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
   343
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
   344
  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
   345
  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
   346
  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
   347
  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
   348
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   349
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   350
/* 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
   351
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
   352
  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
   353
  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
   354
  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
   355
  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
   356
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   357
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   358
/* 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
   359
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
   360
  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
   361
  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
   362
  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
   363
  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
   364
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   365
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   366
/* 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
   367
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
   368
  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
   369
  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
   370
  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
   371
  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
   372
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   373
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   374
/* 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
   375
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
   376
  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
   377
  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
   378
      || 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
   379
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   380
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   381
/* 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
   382
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
   383
  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
   384
  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
   385
      || 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
   386
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   387
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   388
/* 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
   389
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
   390
  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
   391
  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
   392
  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
   393
  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
   394
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   395
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   396
/* 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
   397
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
   398
  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
   399
  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
   400
  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
   401
  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
   402
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   403
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   404
/* 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
   405
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
   406
  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
   407
  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
   408
  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
   409
  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
   410
  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
   411
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   414
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
   415
  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
   416
  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
   417
  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
   418
  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
   419
  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
   420
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   423
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
   424
  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
   425
  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
   426
  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
   427
  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
   428
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   431
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
   432
  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
   433
  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
   434
  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
   435
  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
   436
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   439
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
   440
  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
   441
  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
   442
  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
   443
  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
   444
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   447
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
   448
  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
   449
  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
   450
  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
   451
  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
   452
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   455
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
   456
  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
   457
  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
   458
  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
   459
  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
   460
  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
   461
  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
   462
  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
   463
  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
   464
  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
   465
  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
   466
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   467
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   468
/* 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
   469
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
   470
  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
   471
  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
   472
  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
   473
  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
   474
  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
   475
  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
   476
}
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
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
/* 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
   479
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
   480
  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
   481
  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
   482
  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
   483
  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
   484
  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
   485
  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
   486
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   487
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   488
/* 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
   489
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
   490
  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
   491
  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
   492
  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
   493
  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
   494
  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
   495
  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
   496
  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
   497
  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
   498
  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
   499
  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
   500
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   501
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff changeset
   502
/* 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
   503
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
   504
  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
   505
  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
   506
  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
   507
  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
   508
}
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   509
82cb6a64a763 Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents: 434
diff changeset
   510
/* 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
   511
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
   512
  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
   513
  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
   514
  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
   515
  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
   516
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   519
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
   520
  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
   521
  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
   522
  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
   523
  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
   524
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   527
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
   528
  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
   529
  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
   530
  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
   531
  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
   532
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   535
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
   536
  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
   537
  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
   538
  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
   539
  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
   540
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   543
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
   544
  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
   545
  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
   546
  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
   547
  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
   548
  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
   549
  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
   550
  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
   551
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   554
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
   555
  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
   556
  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
   557
  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
   558
  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
   559
  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
   560
  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
   561
  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
   562
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   565
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
   566
  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
   567
  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
   568
  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
   569
  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
   570
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   573
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
   574
  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
   575
  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
   576
  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
   577
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   580
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
   581
  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
   582
  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
   583
  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
   584
}
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
d48f53715f77 Re-write of stage3 code (done by Manuele and I), re-write 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
/* 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
   587
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
   588
  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
   589
  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
   590
  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
   591
  return false;
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   592
}
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   593
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   594
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   595
f9fd63f64f5c Delete un-used code.
Mario de Sousa <msousa@fe.up.pt>
parents: 435
diff changeset
   596
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
   597
459
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   598
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
   599
  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
   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
  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
   602
      return false;
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(*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
   604
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   605
    
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   606
  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
   607
      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
   608
          return true;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   609
  } 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
   610
      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
   611
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   612
  return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   613
}
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   614
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   615
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   616
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   617
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
   618
  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
   619
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   620
  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
   621
      return false;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   622
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   623
  return true;
01f6664bf8c5 Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents: 458
diff changeset
   624
}