author | Mario de Sousa <msousa@fe.up.pt> |
Mon, 27 Feb 2012 11:44:03 +0000 | |
changeset 457 | 67d8b07bac22 |
parent 445 | e6c34ee82954 |
child 458 | 587884880be6 |
permissions | -rw-r--r-- |
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
1 |
/* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
2 |
* matiec - a compiler for the programming languages defined in IEC 61131-3 |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
3 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
4 |
* Copyright (C) 2009-2012 Mario de Sousa (msousa@fe.up.pt) |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
5 |
* Copyright (C) 2012 Manuele Conti (conti.ma@alice.it) |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
6 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
7 |
* This program is free software: you can redistribute it and/or modify |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
8 |
* it under the terms of the GNU General Public License as published by |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
9 |
* the Free Software Foundation, either version 3 of the License, or |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
10 |
* (at your option) any later version. |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
11 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
12 |
* This program is distributed in the hope that it will be useful, |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
15 |
* GNU General Public License for more details. |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
16 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
19 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
20 |
* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
21 |
* This code is made available on the understanding that it will not be |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
22 |
* used in safety-critical situations without a full and competent review. |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
23 |
*/ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
24 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
25 |
#ifndef _HELPER_FUNCTIONS_HH_ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
26 |
#define _HELPER_FUNCTIONS_HH_ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
27 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
28 |
#include "../absyntax/visitor.hh" |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
29 |
#include <typeinfo> |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
30 |
|
434
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
31 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
32 |
|
436 | 33 |
#define is_type(type_name_symbol, type_name_class) ((type_name_symbol == NULL) ? false : (typeid(*type_name_symbol) == typeid(type_name_class))) |
34 |
#define sizeoftype(symbol) get_sizeof_datatype_c::getsize(symbol) |
|
35 |
||
36 |
||
434
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
37 |
|
438
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
38 |
|
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
39 |
typedef struct { |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
40 |
symbol_c *function_name; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
41 |
symbol_c *nonformal_operand_list; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
42 |
symbol_c * formal_operand_list; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
43 |
|
441
e8de43eefcc5
Add printing of semantic errors when calling FB from IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
44 |
enum {POU_FB, POU_function} POU_type; |
438
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
45 |
//symbol_c &*datatype; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
46 |
//std::vector <symbol_c *> &candidate_datatypes; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
47 |
std::vector <symbol_c *> &candidate_functions; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
48 |
symbol_c *&called_function_declaration; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
49 |
int &extensible_param_count; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
50 |
} generic_function_call_t; |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
51 |
|
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
52 |
|
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
436
diff
changeset
|
53 |
|
434
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
54 |
/* A small helper class, to transform elementary data type to string. |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
55 |
* this allows us to generate more relevant error messages... |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
56 |
*/ |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
57 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
58 |
class elementary_type_c: public null_visitor_c { |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
59 |
protected: |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
60 |
elementary_type_c(void) {}; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
61 |
~elementary_type_c(void) {}; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
62 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
63 |
private: |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
64 |
/* singleton class! */ |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
65 |
static elementary_type_c *singleton; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
66 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
67 |
public: |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
68 |
static const char * to_string(symbol_c *symbol); |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
69 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
70 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
71 |
/***********************************/ |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
72 |
/* B 1.3.1 - Elementary Data Types */ |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
73 |
/***********************************/ |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
74 |
void *visit(time_type_name_c *symbol) {return (void *)"TIME"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
75 |
void *visit(bool_type_name_c *symbol) {return (void *)"BOOL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
76 |
void *visit(sint_type_name_c *symbol) {return (void *)"SINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
77 |
void *visit(int_type_name_c *symbol) {return (void *)"INT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
78 |
void *visit(dint_type_name_c *symbol) {return (void *)"DINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
79 |
void *visit(lint_type_name_c *symbol) {return (void *)"LINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
80 |
void *visit(usint_type_name_c *symbol) {return (void *)"USINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
81 |
void *visit(uint_type_name_c *symbol) {return (void *)"UINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
82 |
void *visit(udint_type_name_c *symbol) {return (void *)"UDINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
83 |
void *visit(ulint_type_name_c *symbol) {return (void *)"ULINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
84 |
void *visit(real_type_name_c *symbol) {return (void *)"REAL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
85 |
void *visit(lreal_type_name_c *symbol) {return (void *)"LREAL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
86 |
void *visit(date_type_name_c *symbol) {return (void *)"DATE"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
87 |
void *visit(tod_type_name_c *symbol) {return (void *)"TOD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
88 |
void *visit(dt_type_name_c *symbol) {return (void *)"DT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
89 |
void *visit(byte_type_name_c *symbol) {return (void *)"BYTE"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
90 |
void *visit(word_type_name_c *symbol) {return (void *)"WORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
91 |
void *visit(lword_type_name_c *symbol) {return (void *)"LWORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
92 |
void *visit(dword_type_name_c *symbol) {return (void *)"DWORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
93 |
void *visit(string_type_name_c *symbol) {return (void *)"STRING"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
94 |
void *visit(wstring_type_name_c *symbol) {return (void *)"WSTRING"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
95 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
96 |
void *visit(safetime_type_name_c *symbol) {return (void *)"SAFETIME"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
97 |
void *visit(safebool_type_name_c *symbol) {return (void *)"SAFEBOOL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
98 |
void *visit(safesint_type_name_c *symbol) {return (void *)"SAFESINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
99 |
void *visit(safeint_type_name_c *symbol) {return (void *)"SAFEINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
100 |
void *visit(safedint_type_name_c *symbol) {return (void *)"SAFEDINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
101 |
void *visit(safelint_type_name_c *symbol) {return (void *)"SAFELINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
102 |
void *visit(safeusint_type_name_c *symbol) {return (void *)"SAFEUSINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
103 |
void *visit(safeuint_type_name_c *symbol) {return (void *)"SAFEUINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
104 |
void *visit(safeudint_type_name_c *symbol) {return (void *)"SAFEUDINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
105 |
void *visit(safeulint_type_name_c *symbol) {return (void *)"SAFEULINT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
106 |
void *visit(safereal_type_name_c *symbol) {return (void *)"SAFEREAL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
107 |
void *visit(safelreal_type_name_c *symbol) {return (void *)"SAFELREAL"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
108 |
void *visit(safedate_type_name_c *symbol) {return (void *)"SAFEDATE"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
109 |
void *visit(safetod_type_name_c *symbol) {return (void *)"SAFETOD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
110 |
void *visit(safedt_type_name_c *symbol) {return (void *)"SAFEDT"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
111 |
void *visit(safebyte_type_name_c *symbol) {return (void *)"SAFEBYTE"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
112 |
void *visit(safeword_type_name_c *symbol) {return (void *)"SAFEWORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
113 |
void *visit(safelword_type_name_c *symbol) {return (void *)"SAFELWORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
114 |
void *visit(safedword_type_name_c *symbol) {return (void *)"SAFEDWORD"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
115 |
void *visit(safestring_type_name_c *symbol) {return (void *)"SAFESTRING"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
116 |
void *visit(safewstring_type_name_c *symbol) {return (void *)"SAFEWSTRING"; }; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
117 |
}; |
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
118 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
119 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
120 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
121 |
|
c1278e52bcbc
Move elementary_c::to_string() to datatype_functions.cc/hh
Mario de Sousa <msousa@fe.up.pt>
parents:
425
diff
changeset
|
122 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
123 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
124 |
/* Widening Primitive Conversion */ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
125 |
struct widen_entry { |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
126 |
symbol_c *left; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
127 |
symbol_c *right; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
128 |
symbol_c *result; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
129 |
}; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
130 |
/* |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
131 |
* 2.5.1.5.6 Functions of time data types |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
132 |
* Table 30 - page 64 |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
133 |
*/ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
134 |
extern const struct widen_entry widen_ADD_table[]; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
135 |
extern const struct widen_entry widen_SUB_table[]; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
136 |
extern const struct widen_entry widen_MUL_table[]; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
137 |
extern const struct widen_entry widen_DIV_table[]; |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
138 |
|
425
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
139 |
/* Search for a datatype inside a candidate_datatypes list. |
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
140 |
* Returns: position of datatype in the list, or -1 if not found. |
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
141 |
*/ |
445
e6c34ee82954
Change name help function.
Conti Manuele <conti.ma@alice.it>
parents:
443
diff
changeset
|
142 |
int search_in_candidate_datatype_list(symbol_c *datatype, std::vector <symbol_c *> candidate_datatypes); |
425
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
143 |
|
443
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
144 |
/* Copy the elements in the candidate_datatype_list in one symbol (from) |
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
145 |
* into the candidate_datatype_list of another symbol (to) |
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
146 |
*/ |
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
147 |
void copy_candidate_datatype_list(symbol_c *from, symbol_c *to); |
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
148 |
|
457
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
149 |
/* Intersect two candidate_datatype_lists. |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
150 |
* Remove from list1 (origin, dest.) all elements that are not found in list2 (with). |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
151 |
* In essence, list1 will contain the result of the intersection of list1 with list2. |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
152 |
* In other words, modify list1 so it only contains the elelements that are simultaneously in list1 and list2! |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
153 |
*/ |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
154 |
void intersect_candidate_datatype_list(symbol_c *list1 /*origin, dest.*/, symbol_c *list2 /*with*/); |
67d8b07bac22
Change prev_il_instruction to a vector<>
Mario de Sousa <msousa@fe.up.pt>
parents:
445
diff
changeset
|
155 |
|
443
ff4d26b7e51d
Narrow IL code backwords, so as to correctly handle invocations to overloaded functions from IL code.
Mario de Sousa <msousa@fe.up.pt>
parents:
441
diff
changeset
|
156 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
157 |
/* A helper function... */ |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
158 |
bool is_ANY_ELEMENTARY_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
159 |
bool is_ANY_SAFEELEMENTARY_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
160 |
bool is_ANY_ELEMENTARY_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
161 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
162 |
bool is_ANY_MAGNITUDE_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
163 |
bool is_ANY_SAFEMAGNITUDE_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
164 |
bool is_ANY_MAGNITUDE_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
165 |
|
435
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
166 |
bool is_ANY_signed_MAGNITUDE_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
167 |
bool is_ANY_signed_SAFEMAGNITUDE_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
168 |
bool is_ANY_signed_MAGNITUDE_compatible (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
169 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
170 |
bool is_ANY_DATE_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
171 |
bool is_ANY_SAFEDATE_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
172 |
bool is_ANY_DATE_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
173 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
174 |
bool is_ANY_STRING_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
175 |
bool is_ANY_SAFESTRING_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
176 |
bool is_ANY_STRING_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
177 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
178 |
bool is_ANY_INT_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
179 |
bool is_ANY_SAFEINT_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
180 |
bool is_ANY_INT_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
181 |
|
435
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
182 |
bool is_ANY_signed_INT_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
183 |
bool is_ANY_signed_SAFEINT_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
184 |
bool is_ANY_signed_INT_compatible (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
185 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
186 |
bool is_ANY_REAL_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
187 |
bool is_ANY_SAFEREAL_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
188 |
bool is_ANY_REAL_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
189 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
190 |
bool is_ANY_NUM_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
191 |
bool is_ANY_SAFENUM_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
192 |
bool is_ANY_NUM_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
193 |
|
435
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
194 |
bool is_ANY_signed_NUM_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
195 |
bool is_ANY_signed_SAFENUM_type (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
196 |
bool is_ANY_signed_NUM_compatible (symbol_c *type_symbol); |
82cb6a64a763
Change negation expression (neg_expression_c) to only allow signed data types.
Mario de Sousa <msousa@fe.up.pt>
parents:
434
diff
changeset
|
197 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
198 |
bool is_ANY_BIT_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
199 |
bool is_ANY_SAFEBIT_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
200 |
bool is_ANY_BIT_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
201 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
202 |
bool is_BOOL_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
203 |
bool is_SAFEBOOL_type (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
204 |
bool is_ANY_BOOL_compatible (symbol_c *type_symbol); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
205 |
|
425
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
206 |
|
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
207 |
bool is_type_equal(symbol_c *first_type, symbol_c *second_type); |
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
208 |
|
425
c8e6cf57324a
Print error messages when datatype erros found in ST function/FB calls.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
209 |
// typedef bool (*helper_function_t) (symbol_c *type_symbol); /* a pointer to a function! */ |
417
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
210 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
211 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
diff
changeset
|
212 |
#endif /* _HELPER_FUNCTIONS_HH_ */ |