author | Mario de Sousa <msousa@fe.up.pt> |
Wed, 18 Jul 2012 17:04:34 +0100 | |
changeset 605 | 06caf4782e51 |
parent 572 | c353bc67bf91 |
child 607 | be9ba3531afb |
permissions | -rwxr-xr-x |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
1 |
/* |
261
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
2 |
* matiec - a compiler for the programming languages defined in IEC 61131-3 |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
3 |
* Copyright (C) 2003-2011 Mario de Sousa (msousa@fe.up.pt) |
279
c0453b7f99df
Re-generated std lib related code, with updated headers, updated all forgotten headers
Edouard Tisserant
parents:
261
diff
changeset
|
4 |
* Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
261
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
5 |
* |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
6 |
* This program is free software: you can redistribute it and/or modify |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
7 |
* it under the terms of the GNU General Public License as published by |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
8 |
* the Free Software Foundation, either version 3 of the License, or |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
9 |
* (at your option) any later version. |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
10 |
* |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
11 |
* This program is distributed in the hope that it will be useful, |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
14 |
* GNU General Public License for more details. |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
15 |
* |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
16 |
* You should have received a copy of the GNU General Public License |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
17 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
18 |
* |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
19 |
* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
20 |
* This code is made available on the understanding that it will not be |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
21 |
* used in safety-critical situations without a full and competent review. |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
22 |
*/ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
23 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
24 |
/* |
261
db2ad6541d92
Updating licensing information.
Mario de Sousa <msousa@fe.up.pt>
parents:
69
diff
changeset
|
25 |
* An IEC 61131-3 compiler. |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
26 |
* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
27 |
* Based on the |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
28 |
* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
29 |
* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
30 |
*/ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
31 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
32 |
/* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
33 |
* Declaration of the Abstract Syntax data structure components |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
34 |
*/ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
35 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
36 |
/* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
37 |
* ABSYNTAX.H |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
38 |
* |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
39 |
* This generates the parse tree structure used to bind the components |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
40 |
* identified by Bison in the correct syntax order. At the end of the |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
41 |
* Bison analysis the tree is walked in a sequential fashion generating |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
42 |
* the relavent code. |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
43 |
*/ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
44 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
45 |
#ifndef _ABSYNTAX_HH |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
46 |
#define _ABSYNTAX_HH |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
47 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
48 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
49 |
#include <stdio.h> // required for NULL |
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:
350
diff
changeset
|
50 |
#include <vector> |
564
dabffc3086dc
Start constant_folding class.
Manuele Conti <conti.ma@alice.it>
parents:
459
diff
changeset
|
51 |
#include <string> |
565
8acbddf75333
Fix a few bugs of previous commit.
Mario de Sousa <msousa@fe.up.pt>
parents:
564
diff
changeset
|
52 |
#include <stdint.h> // required for uint64_t, etc... |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
53 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
54 |
|
569
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
55 |
/* Determine, for the current platform, which data type (float, double or long double) uses 64 bits. */ |
572
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
56 |
/* NOTE: We cant use sizeof() in pre-processor directives, so we have to do it another way... */ |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
57 |
/* CURIOSITY: We can use sizeof() and offsetof() inside static_assert() but: |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
58 |
* - this only allows us to make assertions, and not #define new macros |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
59 |
* - is only available in the C standard [ISO/IEC 9899:2011] and the C++ 0X draft standard [Becker 2008]. It is not available in C99. |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
60 |
* https://www.securecoding.cert.org/confluence/display/seccode/DCL03-C.+Use+a+static+assertion+to+test+the+value+of+a+constant+expression |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
61 |
* struct {int a, b, c, d} header_t; |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
62 |
* e.g.: static_assert(offsetof(struct header_t, c) == 8, "Compile time error message."); |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
63 |
*/ |
c353bc67bf91
Correctly implement MOD operation and overflow checks (still missing uint * / MOD).
Mario de Sousa <msousa@fe.up.pt>
parents:
569
diff
changeset
|
64 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
65 |
#include <float.h> |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
66 |
#if (LDBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
67 |
#define long_double long double |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
68 |
#define real64_t long_double /* so we can later use #if (real64_t == long_double) directives in the code! */ |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
69 |
#elif ( DBL_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
70 |
#define real64_t double |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
71 |
#elif ( FLT_MANT_DIG == 53) /* NOTE: 64 bit IEC559 real has 53 bits for mantissa! */ |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
72 |
#define real64_t float |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
73 |
#else |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
74 |
#error Could not find a 64 bit floating point data type on this platform. Aborting... |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
75 |
#endif |
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
76 |
|
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
77 |
|
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
78 |
/* Forward declaration of the visitor interface |
564
dabffc3086dc
Start constant_folding class.
Manuele Conti <conti.ma@alice.it>
parents:
459
diff
changeset
|
79 |
* declared in the visitor.hh file |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
80 |
* We cannot include the visitor.hh file, as it will |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
81 |
* include this same file first, as it too requires references |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
82 |
* to the abstract syntax classes defined here. |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
83 |
*/ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
84 |
class visitor_c; // forward declaration |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
85 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
86 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
87 |
class symbol_c; // forward declaration |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
88 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
89 |
|
569
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
90 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
91 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
92 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
93 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
94 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
95 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
96 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
97 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
98 |
|
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
99 |
/* The base class of all symbols */ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
100 |
class symbol_c { |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
101 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
102 |
public: |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
103 |
/* |
569
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
104 |
* Line number for the purposes of error checking. |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
105 |
* Annotated (inserted) by stage1_2 |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
106 |
*/ |
69 | 107 |
int first_line; |
108 |
int first_column; |
|
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
109 |
const char *first_file; /* filename referenced by first line/column */ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
110 |
long int first_order; /* relative order in which it is read by lexcial analyser */ |
69 | 111 |
int last_line; |
112 |
int last_column; |
|
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
113 |
const char *last_file; /* filename referenced by last line/column */ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
114 |
long int last_order; /* relative order in which it is read by lexcial analyser */ |
569
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
115 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
116 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
117 |
/* |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
118 |
* Annotations produced during stage 3 |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
119 |
*/ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
120 |
/*** Data type analysis ***/ |
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:
350
diff
changeset
|
121 |
std::vector <symbol_c *> candidate_datatypes; /* All possible data types the expression/literal/etc. may take. Filled in stage3 by fill_candidate_datatypes_c class */ |
459
01f6664bf8c5
Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
122 |
/* Data type of the expression/literal/etc. Filled in stage3 by narrow_candidate_datatypes_c |
01f6664bf8c5
Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
123 |
* If set to NULL, it means it has not yet been evaluated. |
01f6664bf8c5
Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
124 |
* If it points to an object of type invalid_type_name_c, it means it is invalid. |
01f6664bf8c5
Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
125 |
* Otherwise, it points to an object of the apropriate data type (e.g. int_type_name_c, bool_type_name_c, ...) |
01f6664bf8c5
Continue adding support for semantic verification of JMP and RET.
Mario de Sousa <msousa@fe.up.pt>
parents:
438
diff
changeset
|
126 |
*/ |
564
dabffc3086dc
Start constant_folding class.
Manuele Conti <conti.ma@alice.it>
parents:
459
diff
changeset
|
127 |
symbol_c *datatype; |
dabffc3086dc
Start constant_folding class.
Manuele Conti <conti.ma@alice.it>
parents:
459
diff
changeset
|
128 |
|
569
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
129 |
/*** constant folding ***/ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
130 |
/* During stage 3 (semantic analysis/checking) we will be doing constant folding. |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
131 |
* That algorithm will anotate the abstract syntax tree with the result of operations |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
132 |
* on literals (i.e. 44 + 55 will store the result 99). |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
133 |
* Since the same source code (e.g. 1 + 0) may actually be a BOOL or an ANY_INT, |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
134 |
* or an ANY_BIT, we need to handle all possibilities, and determine the result of the |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
135 |
* operation assuming each type. |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
136 |
* For this reason, we have one entry for each possible type, with some expressions |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
137 |
* having more than one entry filled in! |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
138 |
*/ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
139 |
typedef enum { cs_undefined, /* not defined --> const_value is not valid! */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
140 |
cs_const_value, /* const value is valid */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
141 |
cs_overflow /* result produced overflow or underflow --> const_value is not valid! */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
142 |
} const_status_t; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
143 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
144 |
typedef struct { |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
145 |
const_status_t status; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
146 |
real64_t value; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
147 |
} const_value_real64_t; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
148 |
const_value_real64_t *const_value_real64; /* when NULL --> UNDEFINED */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
149 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
150 |
typedef struct { |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
151 |
const_status_t status; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
152 |
int64_t value; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
153 |
} const_value_int64_t; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
154 |
const_value_int64_t *const_value_int64; /* when NULL --> UNDEFINED */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
155 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
156 |
typedef struct { |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
157 |
const_status_t status; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
158 |
uint64_t value; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
159 |
} const_value_uint64_t; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
160 |
const_value_uint64_t *const_value_uint64; /* when NULL --> UNDEFINED */ |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
161 |
|
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
162 |
typedef struct { |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
163 |
const_status_t status; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
164 |
bool value; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
165 |
} const_value_bool_t; |
0d1ab9e78574
Add data structure for storing overflow of constant values.
Mario de Sousa <msousa@fe.up.pt>
parents:
568
diff
changeset
|
166 |
const_value_bool_t *const_value_bool; /* when NULL --> UNDEFINED */ |
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:
350
diff
changeset
|
167 |
|
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
168 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
169 |
public: |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
170 |
/* default constructor */ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
171 |
symbol_c(int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
172 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0 /* order in which it is read by lexcial analyser */ |
69 | 173 |
); |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
174 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
175 |
/* default destructor */ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
176 |
/* must be virtual so compiler does not complain... */ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
177 |
virtual ~symbol_c(void) {return;}; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
178 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
179 |
virtual void *accept(visitor_c &visitor) {return NULL;}; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
180 |
}; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
181 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
182 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
183 |
class token_c: public symbol_c { |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
184 |
public: |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
185 |
/* the value of the symbol. */ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
186 |
const char *value; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
187 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
188 |
public: |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
189 |
token_c(const char *value, |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
190 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
191 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0 /* order in which it is read by lexcial analyser */ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
192 |
); |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
193 |
}; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
194 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
195 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
196 |
/* a list of symbols... */ |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
197 |
class list_c: public symbol_c { |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
198 |
public: |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
199 |
int n; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
200 |
symbol_c **elements; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
201 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
202 |
public: |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
203 |
list_c(int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
204 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0 /* order in which it is read by lexcial analyser */ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
205 |
); |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
206 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
207 |
list_c(symbol_c *elem, |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
208 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, /* order in which it is read by lexcial analyser */ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
209 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0 /* order in which it is read by lexcial analyser */ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
210 |
); |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
211 |
/* append a new element to the end of the list */ |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
212 |
virtual void add_element(symbol_c *elem); |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
213 |
/* insert a new element before position pos. */ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
214 |
/* To insert into the begining of list, call with pos=0 */ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
215 |
/* To insert into the end of list, call with pos=list->n */ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
216 |
virtual void insert_element(symbol_c *elem, int pos = 0); |
438
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
217 |
/* remove element at position pos. */ |
744b125d911e
Add support for semantic verification of function calls in IL.
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
218 |
virtual void remove_element(int pos = 0); |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
219 |
}; |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
220 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
221 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
222 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
223 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
224 |
#define SYM_LIST(class_name_c, ...) \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
225 |
class class_name_c: public list_c { \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
226 |
public: \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
227 |
__VA_ARGS__ \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
228 |
public: \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
229 |
class_name_c( \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
230 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
231 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
232 |
class_name_c(symbol_c *elem, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
233 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
234 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
235 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
236 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
237 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
238 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
239 |
#define SYM_TOKEN(class_name_c, ...) \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
240 |
class class_name_c: public token_c { \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
241 |
public: \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
242 |
__VA_ARGS__ \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
243 |
public: \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
244 |
class_name_c(const char *value, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
245 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
246 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
247 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
248 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
249 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
250 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
251 |
#define SYM_REF0(class_name_c, ...) \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
252 |
class class_name_c: public symbol_c { \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
253 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
254 |
__VA_ARGS__ \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
255 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
256 |
class_name_c( \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
257 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
258 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
259 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
260 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
261 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
262 |
|
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
263 |
#define SYM_REF1(class_name_c, ref1, ...) \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
264 |
class class_name_c: public symbol_c { \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
265 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
266 |
symbol_c *ref1; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
267 |
__VA_ARGS__ \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
268 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
269 |
class_name_c(symbol_c *ref1, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
270 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
271 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
272 |
virtual void *accept(visitor_c &visitor); \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
273 |
}; |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
274 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
275 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
276 |
#define SYM_REF2(class_name_c, ref1, ref2, ...) \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
277 |
class class_name_c: public symbol_c { \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
278 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
279 |
symbol_c *ref1; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
280 |
symbol_c *ref2; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
281 |
__VA_ARGS__ \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
282 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
283 |
class_name_c(symbol_c *ref1, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
284 |
symbol_c *ref2 = NULL, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
285 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
286 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
287 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
288 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
289 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
290 |
|
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
291 |
#define SYM_REF3(class_name_c, ref1, ref2, ref3, ...) \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
292 |
class class_name_c: public symbol_c { \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
293 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
294 |
symbol_c *ref1; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
295 |
symbol_c *ref2; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
296 |
symbol_c *ref3; \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
297 |
__VA_ARGS__ \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
298 |
public: \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
299 |
class_name_c(symbol_c *ref1, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
300 |
symbol_c *ref2, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
301 |
symbol_c *ref3, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
302 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
303 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
304 |
virtual void *accept(visitor_c &visitor); \ |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
305 |
}; |
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
306 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
307 |
|
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
308 |
#define SYM_REF4(class_name_c, ref1, ref2, ref3, ref4, ...) \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
309 |
class class_name_c: public symbol_c { \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
310 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
311 |
symbol_c *ref1; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
312 |
symbol_c *ref2; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
313 |
symbol_c *ref3; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
314 |
symbol_c *ref4; \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
315 |
__VA_ARGS__ \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
316 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
317 |
class_name_c(symbol_c *ref1, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
318 |
symbol_c *ref2, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
319 |
symbol_c *ref3, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
320 |
symbol_c *ref4 = NULL, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
321 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
322 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
323 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
324 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
325 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
326 |
|
568
5f79478142d7
make the compiler platform independent (i.e. no longer assume sizeof(double)==8).
Mario de Sousa <msousa@fe.up.pt>
parents:
565
diff
changeset
|
327 |
#define SYM_REF5(class_name_c, ref1, ref2, ref3, ref4, ref5, ...) \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
328 |
class class_name_c: public symbol_c { \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
329 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
330 |
symbol_c *ref1; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
331 |
symbol_c *ref2; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
332 |
symbol_c *ref3; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
333 |
symbol_c *ref4; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
334 |
symbol_c *ref5; \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
335 |
__VA_ARGS__ \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
336 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
337 |
class_name_c(symbol_c *ref1, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
338 |
symbol_c *ref2, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
339 |
symbol_c *ref3, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
340 |
symbol_c *ref4, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
341 |
symbol_c *ref5, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
342 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
343 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
344 |
virtual void *accept(visitor_c &visitor); \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
345 |
}; |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
346 |
|
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
347 |
|
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
348 |
#define SYM_REF6(class_name_c, ref1, ref2, ref3, ref4, ref5, ref6, ...) \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
349 |
class class_name_c: public symbol_c { \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
350 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
351 |
symbol_c *ref1; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
352 |
symbol_c *ref2; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
353 |
symbol_c *ref3; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
354 |
symbol_c *ref4; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
355 |
symbol_c *ref5; \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
356 |
symbol_c *ref6; \ |
350
2c3c4dc34979
Support for semantic verification of calls to standard functions.
Mario de Sousa <msousa@fe.up.pt>
parents:
287
diff
changeset
|
357 |
__VA_ARGS__ \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
358 |
public: \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
359 |
class_name_c(symbol_c *ref1, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
360 |
symbol_c *ref2, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
361 |
symbol_c *ref3, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
362 |
symbol_c *ref4, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
363 |
symbol_c *ref5, \ |
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
364 |
symbol_c *ref6 = NULL, \ |
287
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
365 |
int fl = 0, int fc = 0, const char *ffile = NULL /* filename */, long int forder=0, \ |
9df7fcb9bde5
Added tracking of order by which tokens are processed by lexical analyser.
Mario de Sousa <msousa@fe.up.pt>
parents:
286
diff
changeset
|
366 |
int ll = 0, int lc = 0, const char *lfile = NULL /* filename */, long int lorder=0); \ |
286
a4f4990d5c66
Adding tracking of filename in which token is located.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
367 |
virtual void *accept(visitor_c &visitor); \ |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
368 |
}; |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
369 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
370 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
371 |
#include "absyntax.def" |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
372 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
373 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
374 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
375 |
#undef SYM_LIST |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
376 |
#undef SYM_TOKEN |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
377 |
#undef SYM_REF0 |
69 | 378 |
#undef SYM_REF1 |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
379 |
#undef SYM_REF2 |
69 | 380 |
#undef SYM_REF3 |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
381 |
#undef SYM_REF4 |
69 | 382 |
#undef SYM_REF5 |
0
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
383 |
#undef SYM_REF6 |
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
384 |
|
fb772792efd1
Initial commit. Last MatPLC CVS with some makefile inclusion removed in order to compile fine out of MatPLC.
etisserant
parents:
diff
changeset
|
385 |
#endif /* _ABSYNTAX_HH */ |