author | mjsousa |
Sun, 20 Jul 2014 21:57:10 +0100 | |
changeset 915 | ec3759689efe |
parent 909 | 8b2a31dea131 |
child 919 | 8da635655f37 |
permissions | -rw-r--r-- |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
1 |
/* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
2 |
* matiec - a compiler for the programming languages defined in IEC 61131-3 |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
3 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
4 |
* Copyright (C) 2003-2012 Mario de Sousa (msousa@fe.up.pt) |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
5 |
* Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
6 |
* Copyright (C) 2012 Manuele Conti (conti.ma@alice.it) |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
7 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
8 |
* This program is free software: you can redistribute it and/or modify |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
9 |
* it under the terms of the GNU General Public License as published by |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
10 |
* the Free Software Foundation, either version 3 of the License, or |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
11 |
* (at your option) any later version. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
12 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
13 |
* This program is distributed in the hope that it will be useful, |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
16 |
* GNU General Public License for more details. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
17 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
18 |
* You should have received a copy of the GNU General Public License |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
19 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
20 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
21 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
22 |
* This code is made available on the understanding that it will not be |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
23 |
* used in safety-critical situations without a full and competent review. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
24 |
*/ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
25 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
26 |
/* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
27 |
* An IEC 61131-3 compiler. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
28 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
29 |
* Based on the |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
30 |
* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
31 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
32 |
*/ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
33 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
34 |
/* Determine the characteristics of a specific data type |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
35 |
* e.g., is it an enumeration, is it an array, is it ANY_INT, etc... |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
36 |
* |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
37 |
* The methods of this class may be passed either: |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
38 |
* - a data type declaration symbol_c, |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
39 |
* OR |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
40 |
* - the name of a data type (identifier_c) |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
41 |
* In this case, we shall first serach for the basetype declaration using search_base_type_c, and then |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
42 |
* run the normal process. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
43 |
*/ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
44 |
#include "absyntax_utils.hh" |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
45 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
46 |
#include "../main.hh" // required for ERROR() and ERROR_MSG() macros. |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
47 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
48 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
49 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
50 |
#include <typeinfo> // required for typeid |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
51 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
52 |
|
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
53 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
54 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
55 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
56 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
57 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
58 |
/***** Some helper classes *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
59 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
60 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
61 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
62 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
63 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
64 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
65 |
/* Return the identifier (name) of a datatype, typically declared in a TYPE .. END_TYPE declaration */ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
66 |
class get_datatype_id_c: null_visitor_c { |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
67 |
private: |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
68 |
static get_datatype_id_c *singleton; |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
69 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
70 |
public: |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
71 |
static symbol_c *get_id(symbol_c *symbol) { |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
72 |
if (NULL == singleton) singleton = new get_datatype_id_c(); |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
73 |
if (NULL == singleton) ERROR; |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
74 |
return (symbol_c *)symbol->accept(*singleton); |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
75 |
} |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
76 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
77 |
protected: |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
78 |
/********************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
79 |
/* B 1.3.3 - Derived data types */ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
80 |
/********************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
81 |
/* simple_type_name ':' simple_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
82 |
void *visit(simple_type_declaration_c *symbol) {return symbol->simple_type_name;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
83 |
/* subrange_type_name ':' subrange_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
84 |
void *visit(subrange_type_declaration_c *symbol) {return symbol->subrange_type_name;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
85 |
/* enumerated_type_name ':' enumerated_spec_init */ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
86 |
void *visit(enumerated_type_declaration_c *symbol) {return symbol->enumerated_type_name;} |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
87 |
/* identifier ':' array_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
88 |
void *visit(array_type_declaration_c *symbol) {return symbol->identifier;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
89 |
/* structure_type_name ':' structure_specification */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
90 |
void *visit(structure_type_declaration_c *symbol) {return symbol->structure_type_name;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
91 |
/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
92 |
void *visit(string_type_declaration_c *symbol) {return symbol->string_type_name;} |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
93 |
/* ref_type_decl: identifier ':' ref_spec_init */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
94 |
void *visit(ref_type_decl_c *symbol) {return symbol->ref_type_name;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
95 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
96 |
/*****************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
97 |
/* B 1.5.2 - Function Blocks */ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
98 |
/*****************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
99 |
/* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
100 |
void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name;} |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
101 |
}; // get_datatype_id_c |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
102 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
103 |
get_datatype_id_c *get_datatype_id_c::singleton = NULL; |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
104 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
105 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
106 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
107 |
|
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
108 |
/***********************************************************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
109 |
/***********************************************************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
110 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
111 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
112 |
/* A small helper class, to transform elementary data type to string. |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
113 |
* this allows us to generate more relevant error messages... |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
114 |
*/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
115 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
116 |
class get_datatype_id_str_c: public null_visitor_c { |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
117 |
protected: |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
118 |
get_datatype_id_str_c(void) {}; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
119 |
~get_datatype_id_str_c(void) {}; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
120 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
121 |
private: |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
122 |
/* singleton class! */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
123 |
static get_datatype_id_str_c *singleton; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
124 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
125 |
public: |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
126 |
static const char *get_id_str(symbol_c *symbol) { |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
127 |
if (NULL == singleton) singleton = new get_datatype_id_str_c; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
128 |
if (NULL == singleton) ERROR; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
129 |
const char *res = (const char *)symbol->accept(*singleton); |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
130 |
if (NULL == res) ERROR; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
131 |
return res; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
132 |
} |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
133 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
134 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
135 |
/*************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
136 |
/* B.1 - Common elements */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
137 |
/*************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
138 |
/*******************************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
139 |
/* B 1.1 - Letters, digits and identifiers */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
140 |
/*******************************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
141 |
void *visit(identifier_c *symbol) {return (void *)symbol->value;}; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
142 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
143 |
/***********************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
144 |
/* B 1.3.1 - Elementary Data Types */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
145 |
/***********************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
146 |
void *visit(time_type_name_c *symbol) {return (void *)"TIME"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
147 |
void *visit(bool_type_name_c *symbol) {return (void *)"BOOL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
148 |
void *visit(sint_type_name_c *symbol) {return (void *)"SINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
149 |
void *visit(int_type_name_c *symbol) {return (void *)"INT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
150 |
void *visit(dint_type_name_c *symbol) {return (void *)"DINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
151 |
void *visit(lint_type_name_c *symbol) {return (void *)"LINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
152 |
void *visit(usint_type_name_c *symbol) {return (void *)"USINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
153 |
void *visit(uint_type_name_c *symbol) {return (void *)"UINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
154 |
void *visit(udint_type_name_c *symbol) {return (void *)"UDINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
155 |
void *visit(ulint_type_name_c *symbol) {return (void *)"ULINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
156 |
void *visit(real_type_name_c *symbol) {return (void *)"REAL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
157 |
void *visit(lreal_type_name_c *symbol) {return (void *)"LREAL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
158 |
void *visit(date_type_name_c *symbol) {return (void *)"DATE"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
159 |
void *visit(tod_type_name_c *symbol) {return (void *)"TOD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
160 |
void *visit(dt_type_name_c *symbol) {return (void *)"DT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
161 |
void *visit(byte_type_name_c *symbol) {return (void *)"BYTE"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
162 |
void *visit(word_type_name_c *symbol) {return (void *)"WORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
163 |
void *visit(lword_type_name_c *symbol) {return (void *)"LWORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
164 |
void *visit(dword_type_name_c *symbol) {return (void *)"DWORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
165 |
void *visit(string_type_name_c *symbol) {return (void *)"STRING"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
166 |
void *visit(wstring_type_name_c *symbol) {return (void *)"WSTRING"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
167 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
168 |
void *visit(safetime_type_name_c *symbol) {return (void *)"SAFETIME"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
169 |
void *visit(safebool_type_name_c *symbol) {return (void *)"SAFEBOOL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
170 |
void *visit(safesint_type_name_c *symbol) {return (void *)"SAFESINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
171 |
void *visit(safeint_type_name_c *symbol) {return (void *)"SAFEINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
172 |
void *visit(safedint_type_name_c *symbol) {return (void *)"SAFEDINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
173 |
void *visit(safelint_type_name_c *symbol) {return (void *)"SAFELINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
174 |
void *visit(safeusint_type_name_c *symbol) {return (void *)"SAFEUSINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
175 |
void *visit(safeuint_type_name_c *symbol) {return (void *)"SAFEUINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
176 |
void *visit(safeudint_type_name_c *symbol) {return (void *)"SAFEUDINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
177 |
void *visit(safeulint_type_name_c *symbol) {return (void *)"SAFEULINT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
178 |
void *visit(safereal_type_name_c *symbol) {return (void *)"SAFEREAL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
179 |
void *visit(safelreal_type_name_c *symbol) {return (void *)"SAFELREAL"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
180 |
void *visit(safedate_type_name_c *symbol) {return (void *)"SAFEDATE"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
181 |
void *visit(safetod_type_name_c *symbol) {return (void *)"SAFETOD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
182 |
void *visit(safedt_type_name_c *symbol) {return (void *)"SAFEDT"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
183 |
void *visit(safebyte_type_name_c *symbol) {return (void *)"SAFEBYTE"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
184 |
void *visit(safeword_type_name_c *symbol) {return (void *)"SAFEWORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
185 |
void *visit(safelword_type_name_c *symbol) {return (void *)"SAFELWORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
186 |
void *visit(safedword_type_name_c *symbol) {return (void *)"SAFEDWORD"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
187 |
void *visit(safestring_type_name_c *symbol) {return (void *)"SAFESTRING"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
188 |
void *visit(safewstring_type_name_c *symbol) {return (void *)"SAFEWSTRING"; }; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
189 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
190 |
/********************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
191 |
/* B 1.3.3 - Derived data types */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
192 |
/********************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
193 |
/* simple_type_name ':' simple_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
194 |
void *visit(simple_type_declaration_c *symbol) {return symbol->simple_type_name->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
195 |
/* subrange_type_name ':' subrange_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
196 |
void *visit(subrange_type_declaration_c *symbol) {return symbol->subrange_type_name->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
197 |
/* enumerated_type_name ':' enumerated_spec_init */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
198 |
void *visit(enumerated_type_declaration_c *symbol) {return symbol->enumerated_type_name->accept(*this);} |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
199 |
/* identifier ':' array_spec_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
200 |
void *visit(array_type_declaration_c *symbol) {return symbol->identifier->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
201 |
/* structure_type_name ':' structure_specification */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
202 |
void *visit(structure_type_declaration_c *symbol) {return symbol->structure_type_name->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
203 |
/* string_type_name ':' elementary_string_type_name string_type_declaration_size string_type_declaration_init */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
204 |
void *visit(string_type_declaration_c *symbol) {return symbol->string_type_name->accept(*this);} |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
205 |
/* ref_type_decl: identifier ':' ref_spec_init */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
206 |
void *visit(ref_type_decl_c *symbol) {return symbol->ref_type_name->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
207 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
208 |
/*****************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
209 |
/* B 1.5.2 - Function Blocks */ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
210 |
/*****************************/ |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
211 |
/* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
212 |
void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name->accept(*this);} |
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
213 |
}; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
214 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
215 |
get_datatype_id_str_c *get_datatype_id_str_c::singleton = NULL; |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
216 |
|
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
217 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
218 |
|
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
219 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
220 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
221 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
222 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
223 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
224 |
/***** GET_DATATYPE_INFO_C *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
225 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
226 |
/***** *****/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
227 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
228 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
229 |
/**********************************************************/ |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
230 |
|
778
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
231 |
const char *get_datatype_info_c::get_id_str(symbol_c *datatype) { |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
232 |
return get_datatype_id_str_c::get_id_str(datatype); |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
233 |
} |
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
234 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
235 |
|
44e02a88f1e7
moved class to obtain datatype name (in char *) to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
727
diff
changeset
|
236 |
symbol_c *get_datatype_info_c::get_id(symbol_c *datatype) { |
727
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
237 |
return get_datatype_id_c::get_id(datatype); |
db5881e6facd
Add method to determine the id (name) of a datatype.
Mario de Sousa <msousa@fe.up.pt>
parents:
718
diff
changeset
|
238 |
} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
239 |
|
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
240 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
241 |
bool get_datatype_info_c::is_type_equal(symbol_c *first_type, symbol_c *second_type) { |
695 | 242 |
if ((NULL == first_type) || (NULL == second_type)) {return false;} |
243 |
if (typeid(* first_type) == typeid(invalid_type_name_c)) {return false;} |
|
244 |
if (typeid(*second_type) == typeid(invalid_type_name_c)) {return false;} |
|
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
245 |
|
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
246 |
/* ANY_ELEMENTARY */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
247 |
if ((is_ANY_ELEMENTARY(first_type)) && |
695 | 248 |
(typeid(*first_type) == typeid(*second_type))) {return true;} |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
249 |
|
695 | 250 |
/* ANY_DERIVED */ |
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
251 |
if (is_ref_to(first_type) && is_ref_to(second_type)) |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
252 |
return is_type_equal(search_base_type_c::get_basetype_decl(get_ref_to(first_type )), |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
253 |
search_base_type_c::get_basetype_decl(get_ref_to(second_type))); |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
254 |
|
695 | 255 |
return (first_type == second_type); |
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
256 |
} |
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
257 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
258 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
259 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
260 |
bool get_datatype_info_c::is_type_valid(symbol_c *type) { |
695 | 261 |
if (NULL == type) {return false;} |
262 |
if (typeid(*type) == typeid(invalid_type_name_c)) {return false;} |
|
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
263 |
return true; |
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
264 |
} |
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
265 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
266 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
267 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
268 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
269 |
|
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
270 |
|
909
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
271 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
272 |
/* returns the datatype the REF_TO datatype references/points to... */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
273 |
symbol_c *get_datatype_info_c::get_ref_to(symbol_c *type_symbol) { |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
274 |
ref_type_decl_c *type1 = dynamic_cast<ref_type_decl_c *>(type_symbol); |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
275 |
if (NULL != type1) type_symbol = type1->ref_spec_init; |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
276 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
277 |
ref_spec_init_c *type2 = dynamic_cast<ref_spec_init_c *>(type_symbol); |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
278 |
if (NULL != type2) type_symbol = type2->ref_spec; |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
279 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
280 |
ref_spec_c *type3 = dynamic_cast<ref_spec_c *>(type_symbol); |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
281 |
if (NULL != type3) return type3->type_name; |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
282 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
283 |
return NULL; /* this is not a ref datatype!! */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
284 |
} |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
285 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
286 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
287 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
288 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
289 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
290 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
291 |
bool get_datatype_info_c::is_ref_to(symbol_c *type_symbol) { |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
292 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
293 |
if (NULL == type_decl) {return false;} |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
294 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
295 |
if (typeid(*type_decl) == typeid(ref_type_decl_c)) {return true;} /* identifier ':' ref_spec_init */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
296 |
if (typeid(*type_decl) == typeid(ref_spec_init_c)) {return true;} /* ref_spec [ ASSIGN ref_initialization ]; */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
297 |
if (typeid(*type_decl) == typeid(ref_spec_c)) {return true;} /* REF_TO (non_generic_type_name | function_block_type_name) */ |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
298 |
return false; |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
299 |
} |
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
300 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
301 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
302 |
|
8b2a31dea131
Add support for REF_TO derived datatypes (along with datatype verification)
mjsousa
parents:
858
diff
changeset
|
303 |
|
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
304 |
bool get_datatype_info_c::is_sfc_initstep(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
305 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
306 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
307 |
if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
308 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
309 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
310 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
311 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
312 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
313 |
bool get_datatype_info_c::is_sfc_step(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
314 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
315 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
316 |
if (typeid(*type_decl) == typeid(initial_step_c)) {return true;} /* INITIAL_STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
317 |
if (typeid(*type_decl) == typeid( step_c)) {return true;} /* STEP step_name ':' action_association_list END_STEP */ /* A pseudo data type! */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
318 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
319 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
320 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
321 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
322 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
323 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
324 |
bool get_datatype_info_c::is_function_block(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
325 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
326 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
327 |
if (typeid(*type_decl) == typeid(function_block_declaration_c)) {return true;} /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
328 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
329 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
330 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
331 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
332 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
333 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
334 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
335 |
bool get_datatype_info_c::is_subrange(symbol_c *type_symbol) { |
858
c5f145364a4f
Fix get_datatype_info_c::is_subrange(), which did not work when using base type! (we now use get_equivtype() instead of get_base_type() )
mjsousa
parents:
832
diff
changeset
|
336 |
symbol_c *type_decl = search_base_type_c::get_equivtype_decl(type_symbol); /* NOTE: do NOT call search_base_type_c !! */ |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
337 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
338 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
339 |
if (typeid(*type_decl) == typeid(subrange_type_declaration_c)) {return true;} /* subrange_type_name ':' subrange_spec_init */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
340 |
if (typeid(*type_decl) == typeid(subrange_spec_init_c)) {return true;} /* subrange_specification ASSIGN signed_integer */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
341 |
if (typeid(*type_decl) == typeid(subrange_specification_c)) {return true;} /* integer_type_name '(' subrange')' */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
342 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
343 |
if (typeid(*type_decl) == typeid(subrange_c)) {ERROR;} /* signed_integer DOTDOT signed_integer */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
344 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
345 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
346 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
347 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
348 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
349 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
350 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
351 |
bool get_datatype_info_c::is_enumerated(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
352 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
353 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
354 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
355 |
if (typeid(*type_decl) == typeid(enumerated_type_declaration_c)) {return true;} /* enumerated_type_name ':' enumerated_spec_init */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
356 |
if (typeid(*type_decl) == typeid(enumerated_spec_init_c)) {return true;} /* enumerated_specification ASSIGN enumerated_value */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
357 |
if (typeid(*type_decl) == typeid(enumerated_value_list_c)) {return true;} /* enumerated_value_list ',' enumerated_value */ /* once we change the way we handle enums, this will probably become an ERROR! */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
358 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
359 |
if (typeid(*type_decl) == typeid(enumerated_value_c)) {ERROR;} /* enumerated_type_name '#' identifier */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
360 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
361 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
362 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
363 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
364 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
365 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
366 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
367 |
bool get_datatype_info_c::is_array(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
368 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
369 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
370 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
371 |
if (typeid(*type_decl) == typeid(array_type_declaration_c)) {return true;} /* identifier ':' array_spec_init */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
372 |
if (typeid(*type_decl) == typeid(array_spec_init_c)) {return true;} /* array_specification [ASSIGN array_initialization} */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
373 |
if (typeid(*type_decl) == typeid(array_specification_c)) {return true;} /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
374 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
375 |
if (typeid(*type_decl) == typeid(array_subrange_list_c)) {ERROR;} /* array_subrange_list ',' subrange */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
376 |
if (typeid(*type_decl) == typeid(array_initial_elements_list_c)) {ERROR;} /* array_initialization: '[' array_initial_elements_list ']' */ /* array_initial_elements_list ',' array_initial_elements */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
377 |
if (typeid(*type_decl) == typeid(array_initial_elements_c)) {ERROR;} /* integer '(' [array_initial_element] ')' */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
378 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
379 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
380 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
381 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
382 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
383 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
384 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
385 |
bool get_datatype_info_c::is_structure(symbol_c *type_symbol) { |
718
a9f8cc778444
Make search_base_type_c a singleton!
Mario de Sousa <msousa@fe.up.pt>
parents:
699
diff
changeset
|
386 |
symbol_c *type_decl = search_base_type_c::get_basetype_decl(type_symbol); |
832
8cd104e483c6
Allow get_datatype_info_c to be called with NULL parameters.
mjsousa
parents:
778
diff
changeset
|
387 |
if (NULL == type_decl) {return false;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
388 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
389 |
if (typeid(*type_decl) == typeid(structure_type_declaration_c)) {return true;} /* structure_type_name ':' structure_specification */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
390 |
if (typeid(*type_decl) == typeid(initialized_structure_c)) {return true;} /* structure_type_name ASSIGN structure_initialization */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
391 |
if (typeid(*type_decl) == typeid(structure_element_declaration_list_c)) {return true;} /* structure_declaration: STRUCT structure_element_declaration_list END_STRUCT */ /* structure_element_declaration_list structure_element_declaration ';' */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
392 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
393 |
if (typeid(*type_decl) == typeid(structure_element_declaration_c)) {ERROR;} /* structure_element_name ':' *_spec_init */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
394 |
if (typeid(*type_decl) == typeid(structure_element_initialization_list_c)) {ERROR;} /* structure_initialization: '(' structure_element_initialization_list ')' */ /* structure_element_initialization_list ',' structure_element_initialization */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
395 |
if (typeid(*type_decl) == typeid(structure_element_initialization_c)) {ERROR;} /* structure_element_name ASSIGN value */ |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
396 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
397 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
398 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
399 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
400 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
401 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
402 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
403 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
404 |
bool get_datatype_info_c::is_ANY_ELEMENTARY(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
405 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
406 |
if (is_ANY_MAGNITUDE(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
407 |
if (is_ANY_BIT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
408 |
if (is_ANY_STRING (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
409 |
if (is_ANY_DATE (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
410 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
411 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
412 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
413 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
414 |
bool get_datatype_info_c::is_ANY_SAFEELEMENTARY(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
415 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
416 |
if (is_ANY_SAFEMAGNITUDE(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
417 |
if (is_ANY_SAFEBIT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
418 |
if (is_ANY_SAFESTRING (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
419 |
if (is_ANY_SAFEDATE (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
420 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
421 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
422 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
423 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
424 |
bool get_datatype_info_c::is_ANY_ELEMENTARY_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
425 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
426 |
if (is_ANY_ELEMENTARY (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
427 |
if (is_ANY_SAFEELEMENTARY(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
428 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
429 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
430 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
431 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
432 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
433 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
434 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
435 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
436 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
437 |
bool get_datatype_info_c::is_ANY_MAGNITUDE(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
438 |
if (type_symbol == NULL) {return false;} |
668
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
439 |
if (is_TIME(type_symbol)) {return true;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
440 |
if (is_ANY_NUM(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
441 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
442 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
443 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
444 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
445 |
bool get_datatype_info_c::is_ANY_SAFEMAGNITUDE(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
446 |
if (type_symbol == NULL) {return false;} |
668
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
447 |
if (is_SAFETIME(type_symbol)) {return true;} |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
448 |
if (is_ANY_SAFENUM(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
449 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
450 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
451 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
452 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
453 |
bool get_datatype_info_c::is_ANY_MAGNITUDE_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
454 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
455 |
if (is_ANY_MAGNITUDE (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
456 |
if (is_ANY_SAFEMAGNITUDE(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
457 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
458 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
459 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
460 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
461 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
462 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
463 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
464 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
465 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
466 |
bool get_datatype_info_c::is_ANY_signed_MAGNITUDE(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
467 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
468 |
if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
469 |
if (is_ANY_signed_NUM(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
470 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
471 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
472 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
473 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
474 |
bool get_datatype_info_c::is_ANY_signed_SAFEMAGNITUDE(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
475 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
476 |
if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
477 |
return is_ANY_signed_SAFENUM(type_symbol); |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
478 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
479 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
480 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
481 |
bool get_datatype_info_c::is_ANY_signed_MAGNITUDE_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
482 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
483 |
if (is_ANY_signed_MAGNITUDE (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
484 |
if (is_ANY_signed_SAFEMAGNITUDE(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
485 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
486 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
487 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
488 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
489 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
490 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
491 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
492 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
493 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
494 |
bool get_datatype_info_c::is_ANY_NUM(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
495 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
496 |
if (is_ANY_REAL(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
497 |
if (is_ANY_INT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
498 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
499 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
500 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
501 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
502 |
bool get_datatype_info_c::is_ANY_SAFENUM(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
503 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
504 |
if (is_ANY_SAFEREAL(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
505 |
if (is_ANY_SAFEINT (type_symbol)) {return true;} |
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
506 |
return false; |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
507 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
508 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
509 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
510 |
bool get_datatype_info_c::is_ANY_NUM_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
511 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
512 |
if (is_ANY_NUM (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
513 |
if (is_ANY_SAFENUM(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
514 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
515 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
516 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
517 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
518 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
519 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
520 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
521 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
522 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
523 |
bool get_datatype_info_c::is_ANY_signed_NUM(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
524 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
525 |
if (is_ANY_REAL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
526 |
if (is_ANY_signed_INT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
527 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
528 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
529 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
530 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
531 |
bool get_datatype_info_c::is_ANY_signed_SAFENUM(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
532 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
533 |
if (is_ANY_SAFEREAL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
534 |
if (is_ANY_signed_SAFEINT(type_symbol)) {return true;} |
676
ca4f17211251
Move is_datatype_valid/equal() to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
668
diff
changeset
|
535 |
return false; |
666
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
536 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
537 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
538 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
539 |
bool get_datatype_info_c::is_ANY_signed_NUM_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
540 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
541 |
if (is_ANY_signed_NUM (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
542 |
if (is_ANY_signed_SAFENUM(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
543 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
544 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
545 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
546 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
547 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
548 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
549 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
550 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
551 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
552 |
bool get_datatype_info_c::is_ANY_INT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
553 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
554 |
if (is_ANY_signed_INT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
555 |
if (is_ANY_unsigned_INT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
556 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
557 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
558 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
559 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
560 |
bool get_datatype_info_c::is_ANY_SAFEINT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
561 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
562 |
if (is_ANY_signed_SAFEINT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
563 |
if (is_ANY_unsigned_SAFEINT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
564 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
565 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
566 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
567 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
568 |
bool get_datatype_info_c::is_ANY_INT_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
569 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
570 |
if (is_ANY_INT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
571 |
if (is_ANY_SAFEINT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
572 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
573 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
574 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
575 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
576 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
577 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
578 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
579 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
580 |
bool get_datatype_info_c::is_ANY_signed_INT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
581 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
582 |
if (typeid(*type_symbol) == typeid(sint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
583 |
if (typeid(*type_symbol) == typeid(int_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
584 |
if (typeid(*type_symbol) == typeid(dint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
585 |
if (typeid(*type_symbol) == typeid(lint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
586 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
587 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
588 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
589 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
590 |
bool get_datatype_info_c::is_ANY_signed_SAFEINT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
591 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
592 |
if (typeid(*type_symbol) == typeid(safesint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
593 |
if (typeid(*type_symbol) == typeid(safeint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
594 |
if (typeid(*type_symbol) == typeid(safedint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
595 |
if (typeid(*type_symbol) == typeid(safelint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
596 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
597 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
598 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
599 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
600 |
bool get_datatype_info_c::is_ANY_signed_INT_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
601 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
602 |
if (is_ANY_signed_INT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
603 |
if (is_ANY_signed_SAFEINT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
604 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
605 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
606 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
607 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
608 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
609 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
610 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
611 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
612 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
613 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
614 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
615 |
bool get_datatype_info_c::is_ANY_unsigned_INT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
616 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
617 |
if (typeid(*type_symbol) == typeid(usint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
618 |
if (typeid(*type_symbol) == typeid(uint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
619 |
if (typeid(*type_symbol) == typeid(udint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
620 |
if (typeid(*type_symbol) == typeid(ulint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
621 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
622 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
623 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
624 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
625 |
bool get_datatype_info_c::is_ANY_unsigned_SAFEINT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
626 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
627 |
if (typeid(*type_symbol) == typeid(safeusint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
628 |
if (typeid(*type_symbol) == typeid(safeuint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
629 |
if (typeid(*type_symbol) == typeid(safeudint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
630 |
if (typeid(*type_symbol) == typeid(safeulint_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
631 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
632 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
633 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
634 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
635 |
bool get_datatype_info_c::is_ANY_unsigned_INT_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
636 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
637 |
if (is_ANY_unsigned_INT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
638 |
if (is_ANY_unsigned_SAFEINT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
639 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
640 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
641 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
642 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
643 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
644 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
645 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
646 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
647 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
648 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
649 |
bool get_datatype_info_c::is_ANY_REAL(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
650 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
651 |
if (typeid(*type_symbol) == typeid(real_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
652 |
if (typeid(*type_symbol) == typeid(lreal_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
653 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
654 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
655 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
656 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
657 |
bool get_datatype_info_c::is_ANY_SAFEREAL(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
658 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
659 |
if (typeid(*type_symbol) == typeid(safereal_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
660 |
if (typeid(*type_symbol) == typeid(safelreal_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
661 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
662 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
663 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
664 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
665 |
bool get_datatype_info_c::is_ANY_REAL_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
666 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
667 |
if (is_ANY_REAL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
668 |
if (is_ANY_SAFEREAL(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
669 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
670 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
671 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
672 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
673 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
674 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
675 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
676 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
677 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
678 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
679 |
bool get_datatype_info_c::is_ANY_nBIT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
680 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
681 |
if (typeid(*type_symbol) == typeid(byte_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
682 |
if (typeid(*type_symbol) == typeid(word_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
683 |
if (typeid(*type_symbol) == typeid(dword_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
684 |
if (typeid(*type_symbol) == typeid(lword_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
685 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
686 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
687 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
688 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
689 |
bool get_datatype_info_c::is_ANY_SAFEnBIT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
690 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
691 |
if (typeid(*type_symbol) == typeid(safebyte_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
692 |
if (typeid(*type_symbol) == typeid(safeword_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
693 |
if (typeid(*type_symbol) == typeid(safedword_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
694 |
if (typeid(*type_symbol) == typeid(safelword_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
695 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
696 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
697 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
698 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
699 |
bool get_datatype_info_c::is_ANY_nBIT_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
700 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
701 |
if (is_ANY_nBIT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
702 |
if (is_ANY_SAFEnBIT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
703 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
704 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
705 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
706 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
707 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
708 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
709 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
710 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
711 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
712 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
713 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
714 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
715 |
bool get_datatype_info_c::is_BOOL(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
716 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
717 |
if (typeid(*type_symbol) == typeid(bool_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
718 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
719 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
720 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
721 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
722 |
bool get_datatype_info_c::is_SAFEBOOL(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
723 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
724 |
if (typeid(*type_symbol) == typeid(safebool_type_name_c)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
725 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
726 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
727 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
728 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
729 |
bool get_datatype_info_c::is_BOOL_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
730 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
731 |
if (is_BOOL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
732 |
if (is_SAFEBOOL(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
733 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
734 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
735 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
736 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
737 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
738 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
739 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
740 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
741 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
742 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
743 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
744 |
bool get_datatype_info_c::is_ANY_BIT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
745 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
746 |
if (is_BOOL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
747 |
if (is_ANY_nBIT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
748 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
749 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
750 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
751 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
752 |
bool get_datatype_info_c::is_ANY_SAFEBIT(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
753 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
754 |
if (is_SAFEBOOL (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
755 |
if (is_ANY_SAFEnBIT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
756 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
757 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
758 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
759 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
760 |
bool get_datatype_info_c::is_ANY_BIT_compatible(symbol_c *type_symbol) { |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
761 |
if (type_symbol == NULL) {return false;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
762 |
if (is_ANY_BIT (type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
763 |
if (is_ANY_SAFEBIT(type_symbol)) {return true;} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
764 |
return false; |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
765 |
} |
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
766 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
767 |
|
8ba9ec4bae50
Add new get_datatype_info_c (preparing to remove search_expression_type_c)
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
768 |
|
668
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
769 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
770 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
771 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
772 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
773 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
774 |
bool get_datatype_info_c::is_TIME(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
775 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
776 |
if (typeid(*type_symbol) == typeid(time_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
777 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
778 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
779 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
780 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
781 |
bool get_datatype_info_c::is_SAFETIME(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
782 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
783 |
if (typeid(*type_symbol) == typeid(safetime_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
784 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
785 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
786 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
787 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
788 |
bool get_datatype_info_c::is_TIME_compatible(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
789 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
790 |
if (is_TIME (type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
791 |
if (is_SAFETIME(type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
792 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
793 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
794 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
795 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
796 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
797 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
798 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
799 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
800 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
801 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
802 |
bool get_datatype_info_c::is_ANY_DATE(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
803 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
804 |
if (typeid(*type_symbol) == typeid(date_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
805 |
if (typeid(*type_symbol) == typeid(tod_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
806 |
if (typeid(*type_symbol) == typeid(dt_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
807 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
808 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
809 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
810 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
811 |
bool get_datatype_info_c::is_ANY_SAFEDATE(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
812 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
813 |
if (typeid(*type_symbol) == typeid(safedate_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
814 |
if (typeid(*type_symbol) == typeid(safetod_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
815 |
if (typeid(*type_symbol) == typeid(safedt_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
816 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
817 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
818 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
819 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
820 |
bool get_datatype_info_c::is_ANY_DATE_compatible(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
821 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
822 |
if (is_ANY_DATE (type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
823 |
if (is_ANY_SAFEDATE(type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
824 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
825 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
826 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
827 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
828 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
829 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
830 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
831 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
832 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
833 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
834 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
835 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
836 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
837 |
bool get_datatype_info_c::is_ANY_STRING(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
838 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
839 |
if (typeid(*type_symbol) == typeid(string_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
840 |
if (typeid(*type_symbol) == typeid(wstring_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
841 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
842 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
843 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
844 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
845 |
bool get_datatype_info_c::is_ANY_SAFESTRING(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
846 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
847 |
if (typeid(*type_symbol) == typeid(safestring_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
848 |
if (typeid(*type_symbol) == typeid(safewstring_type_name_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
849 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
850 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
851 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
852 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
853 |
bool get_datatype_info_c::is_ANY_STRING_compatible(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
854 |
if (type_symbol == NULL) {return false;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
855 |
if (is_ANY_STRING (type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
856 |
if (is_ANY_SAFESTRING(type_symbol)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
857 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
858 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
859 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
860 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
861 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
862 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
863 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
864 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
865 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
866 |
/* Can't we do away with this?? */ |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
867 |
bool get_datatype_info_c::is_ANY_REAL_literal(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
868 |
if (type_symbol == NULL) {return true;} /* Please make sure things will work correctly before changing this to false!! */ |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
869 |
if (typeid(*type_symbol) == typeid(real_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
870 |
if (typeid(*type_symbol) == typeid(neg_real_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
871 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
872 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
873 |
|
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
874 |
/* Can't we do away with this?? */ |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
875 |
bool get_datatype_info_c::is_ANY_INT_literal(symbol_c *type_symbol) { |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
876 |
if (type_symbol == NULL) {return true;} /* Please make sure things will work correctly before changing this to false!! */ |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
877 |
if (typeid(*type_symbol) == typeid(integer_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
878 |
if (typeid(*type_symbol) == typeid(neg_integer_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
879 |
if (typeid(*type_symbol) == typeid(binary_integer_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
880 |
if (typeid(*type_symbol) == typeid(octal_integer_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
881 |
if (typeid(*type_symbol) == typeid(hex_integer_c)) {return true;} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
882 |
return false; |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
883 |
} |
90b6eb7f1775
Deprecating use of search_expression_type_c, so it may later be deleted!
Mario de Sousa <msousa@fe.up.pt>
parents:
666
diff
changeset
|
884 |
|
693
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
885 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
886 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
887 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
888 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
889 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
890 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
891 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
892 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
893 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
894 |
invalid_type_name_c get_datatype_info_c::invalid_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
895 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
896 |
/**********************/ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
897 |
/* B.1.3 - Data types */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
898 |
/**********************/ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
899 |
/***********************************/ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
900 |
/* B 1.3.1 - Elementary Data Types */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
901 |
/***********************************/ |
699 | 902 |
lreal_type_name_c get_datatype_info_c::lreal_type_name; |
693
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
903 |
real_type_name_c get_datatype_info_c::real_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
904 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
905 |
lint_type_name_c get_datatype_info_c::lint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
906 |
dint_type_name_c get_datatype_info_c::dint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
907 |
int_type_name_c get_datatype_info_c::int_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
908 |
sint_type_name_c get_datatype_info_c::sint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
909 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
910 |
ulint_type_name_c get_datatype_info_c::ulint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
911 |
udint_type_name_c get_datatype_info_c::udint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
912 |
uint_type_name_c get_datatype_info_c::uint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
913 |
usint_type_name_c get_datatype_info_c::usint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
914 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
915 |
lword_type_name_c get_datatype_info_c::lword_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
916 |
dword_type_name_c get_datatype_info_c::dword_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
917 |
word_type_name_c get_datatype_info_c::word_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
918 |
byte_type_name_c get_datatype_info_c::byte_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
919 |
bool_type_name_c get_datatype_info_c::bool_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
920 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
921 |
wstring_type_name_c get_datatype_info_c::wstring_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
922 |
string_type_name_c get_datatype_info_c::string_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
923 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
924 |
dt_type_name_c get_datatype_info_c::dt_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
925 |
date_type_name_c get_datatype_info_c::date_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
926 |
tod_type_name_c get_datatype_info_c::tod_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
927 |
time_type_name_c get_datatype_info_c::time_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
928 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
929 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
930 |
/******************************************************/ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
931 |
/* Extensions to the base standard as defined in */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
932 |
/* "Safety Software Technical Specification, */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
933 |
/* Part 1: Concepts and Function Blocks, */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
934 |
/* Version 1.0 – Official Release" */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
935 |
/* by PLCopen - Technical Committee 5 - 2006-01-31 */ |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
936 |
/******************************************************/ |
699 | 937 |
safelreal_type_name_c get_datatype_info_c::safelreal_type_name; |
693
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
938 |
safereal_type_name_c get_datatype_info_c::safereal_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
939 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
940 |
safelint_type_name_c get_datatype_info_c::safelint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
941 |
safedint_type_name_c get_datatype_info_c::safedint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
942 |
safeint_type_name_c get_datatype_info_c::safeint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
943 |
safesint_type_name_c get_datatype_info_c::safesint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
944 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
945 |
safeulint_type_name_c get_datatype_info_c::safeulint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
946 |
safeudint_type_name_c get_datatype_info_c::safeudint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
947 |
safeuint_type_name_c get_datatype_info_c::safeuint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
948 |
safeusint_type_name_c get_datatype_info_c::safeusint_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
949 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
950 |
safelword_type_name_c get_datatype_info_c::safelword_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
951 |
safedword_type_name_c get_datatype_info_c::safedword_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
952 |
safeword_type_name_c get_datatype_info_c::safeword_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
953 |
safebyte_type_name_c get_datatype_info_c::safebyte_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
954 |
safebool_type_name_c get_datatype_info_c::safebool_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
955 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
956 |
safewstring_type_name_c get_datatype_info_c::safewstring_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
957 |
safestring_type_name_c get_datatype_info_c::safestring_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
958 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
959 |
safedt_type_name_c get_datatype_info_c::safedt_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
960 |
safedate_type_name_c get_datatype_info_c::safedate_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
961 |
safetod_type_name_c get_datatype_info_c::safetod_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
962 |
safetime_type_name_c get_datatype_info_c::safetime_type_name; |
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
963 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
964 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
965 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
966 |
|
51a2fa6441b9
Prepare to delete search_constant_type_c -> Move the static variables from search_constant_type_c to get_datatype_info_c
Mario de Sousa <msousa@fe.up.pt>
parents:
676
diff
changeset
|
967 |