author | Mario de Sousa <msousa@fe.up.pt> |
Tue, 17 Apr 2012 14:21:31 +0100 | |
changeset 519 | 018093957030 |
parent 507 | 30b31d8f6d0f |
child 531 | e7d6f28fc882 |
permissions | -rw-r--r-- |
181 | 1 |
/* |
265
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
2 |
* matiec - a compiler for the programming languages defined in IEC 61131-3 |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
3 |
* |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
4 |
* 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:
265
diff
changeset
|
5 |
* Copyright (C) 2007-2011 Laurent Bessard and Edouard Tisserant |
265
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
6 |
* |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
7 |
* This program is free software: you can redistribute it and/or modify |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
8 |
* it under the terms of the GNU General Public License as published by |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
9 |
* the Free Software Foundation, either version 3 of the License, or |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
10 |
* (at your option) any later version. |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
11 |
* |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
12 |
* This program is distributed in the hope that it will be useful, |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
15 |
* GNU General Public License for more details. |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
16 |
* |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
18 |
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
19 |
* |
181 | 20 |
* |
21 |
* This code is made available on the understanding that it will not be |
|
22 |
* used in safety-critical situations without a full and competent review. |
|
23 |
*/ |
|
24 |
||
25 |
/* |
|
265
4d222f46f8cc
Updating license info (with Edouard's permission for relevant files).
Mario de Sousa <msousa@fe.up.pt>
parents:
226
diff
changeset
|
26 |
* An IEC 61131-3 compiler. |
181 | 27 |
* |
28 |
* Based on the |
|
29 |
* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
30 |
* |
|
31 |
*/ |
|
32 |
||
33 |
||
504
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
34 |
/* Search in a VAR* END_VAR declaration for the delcration of the specified variable instance. |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
35 |
* Will return: |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
36 |
* - the declaration itself (get_decl() ) |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
37 |
* - the type of declaration in which the variable was declared (get_vartype() ) |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
38 |
* |
181 | 39 |
* The variable instance may NOT be a member of a structure of a memeber |
40 |
* of a structure of an element of an array of ... |
|
41 |
* |
|
504
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
42 |
* For example, considering the following 'variables': |
181 | 43 |
* window.points[1].coordinate.x |
44 |
* window.points[1].colour |
|
504
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
45 |
* offset[99] |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
46 |
* |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
47 |
* passing a reference to 'points', 'points[1]', 'points[1].colour', 'colour' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
48 |
* ARE NOT ALLOWED! |
181 | 49 |
* |
50 |
* This class must only be passed the name of the variable that will appear |
|
51 |
* in the variable declaration. In the above examples, this would be |
|
504
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
52 |
* 'window.points[1].coordinate.x' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
53 |
* 'window.points[1].coordinate' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
54 |
* 'window.points[1]' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
55 |
* 'window' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
56 |
* 'window.points[1].colour' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
57 |
* 'offset' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
58 |
* 'offset[99]' |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
59 |
* |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
60 |
* |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
61 |
*/ |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
62 |
|
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
63 |
/* Note: |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
64 |
* Determining the declaration type of a specific variable instance (including |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
65 |
* function block instances) really means determining whether the variable was declared in a |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
66 |
* VAR_INPUT |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
67 |
* VAR_OUTPUT |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
68 |
* VAR_IN_OUT |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
69 |
* VAR |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
70 |
* VAR_TEMP |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
71 |
* VAR_EXTERNAL |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
72 |
* VAR_GLOBAL |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
73 |
* VAR <var_name> AT <location> -> Located variable! |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
74 |
* |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
75 |
*/ |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
76 |
|
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
77 |
/* Note: |
f8d422b98315
Fix bug by expanding permissible data input of search_var_instance_decl_c
Mario de Sousa <msousa@fe.up.pt>
parents:
417
diff
changeset
|
78 |
* The current_type_decl that this class returns may reference the |
181 | 79 |
* name of a type, or the type declaration itself! |
80 |
* For an example of the first, consider a variable declared as ... |
|
81 |
* x : AAA; |
|
82 |
* where the AAA type is previously declared as whatever. |
|
83 |
* For an example of the second, consider a variable declared as ... |
|
84 |
* x : array of int [10]; ----> is allowed |
|
85 |
* |
|
86 |
* If it is the first, we will return a reference to the name, if the second |
|
87 |
* we return a reference to the declaration!! |
|
88 |
*/ |
|
89 |
||
90 |
||
91 |
class search_var_instance_decl_c: public search_visitor_c { |
|
92 |
||
93 |
private: |
|
94 |
symbol_c *search_scope; |
|
95 |
symbol_c *search_name; |
|
96 |
symbol_c *current_type_decl; |
|
97 |
||
98 |
/* variable used to store the type of variable currently being processed... */ |
|
99 |
/* Will contain a single value of generate_c_vardecl_c::XXXX_vt */ |
|
100 |
unsigned int current_vartype; |
|
507
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
101 |
unsigned int current_option; |
181 | 102 |
|
103 |
public: |
|
104 |
search_var_instance_decl_c(symbol_c *search_scope); |
|
105 |
symbol_c *get_decl(symbol_c *variable_instance_name); |
|
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:
279
diff
changeset
|
106 |
|
d48f53715f77
Re-write of stage3 code (done by Manuele and I), re-write of search_varfb_instance_type_c (done by myself), and several other bug fixes.
Mario de Sousa <msousa@fe.up.pt>
parents:
279
diff
changeset
|
107 |
unsigned int get_vartype(symbol_c *variable_instance_name); |
507
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
108 |
unsigned int get_option(symbol_c *variable_instance_name); |
181 | 109 |
|
110 |
public: |
|
111 |
||
112 |
/* the types of variables that need to be processed... */ |
|
113 |
static const unsigned int none_vt = 0x0000; |
|
114 |
static const unsigned int input_vt = 0x0001; // VAR_INPUT |
|
115 |
static const unsigned int output_vt = 0x0002; // VAR_OUTPUT |
|
116 |
static const unsigned int inoutput_vt = 0x0004; // VAR_IN_OUT |
|
117 |
static const unsigned int private_vt = 0x0008; // VAR |
|
118 |
static const unsigned int temp_vt = 0x0010; // VAR_TEMP |
|
119 |
static const unsigned int external_vt = 0x0020; // VAR_EXTERNAL |
|
120 |
static const unsigned int global_vt = 0x0040; // VAR_GLOBAL |
|
121 |
static const unsigned int located_vt = 0x0080; // VAR <var_name> AT <location> |
|
122 |
||
507
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
123 |
static const unsigned int none_opt = 0x0000; |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
124 |
static const unsigned int constant_opt = 0x0001; |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
125 |
static const unsigned int retain_opt = 0x0002; |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
126 |
static const unsigned int non_retain_opt = 0x0003; |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
127 |
|
181 | 128 |
private: |
129 |
/***************************/ |
|
130 |
/* B 0 - Programming Model */ |
|
131 |
/***************************/ |
|
132 |
void *visit(library_c *symbol); |
|
133 |
||
134 |
/******************************************/ |
|
135 |
/* B 1.4.3 - Declaration & Initialisation */ |
|
136 |
/******************************************/ |
|
217
f5dfadf5de54
Adding support for declare, init, get and set macros
laurent
parents:
202
diff
changeset
|
137 |
|
181 | 138 |
/* edge -> The F_EDGE or R_EDGE directive */ |
139 |
// SYM_REF2(edge_declaration_c, edge, var1_list) |
|
140 |
// TODO |
|
507
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
141 |
void *visit(constant_option_c *symbol); |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
142 |
void *visit(retain_option_c *symbol); |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
143 |
void *visit(non_retain_option_c *symbol); |
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
144 |
|
30b31d8f6d0f
Determine the modifiers (CONST, REATAIN) used when declaring a variable.
manuele.conti@sirius-es.it
parents:
504
diff
changeset
|
145 |
|
181 | 146 |
void *visit(input_declarations_c *symbol); |
147 |
/* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */ |
|
148 |
/* option -> may be NULL ! */ |
|
149 |
void *visit(output_declarations_c *symbol); |
|
150 |
/* VAR_IN_OUT var_declaration_list END_VAR */ |
|
151 |
void *visit(input_output_declarations_c *symbol); |
|
202
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
152 |
/* ENO : BOOL */ |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
153 |
void *visit(eno_param_declaration_c *symbol); |
181 | 154 |
/* VAR [CONSTANT] var_init_decl_list END_VAR */ |
155 |
/* option -> may be NULL ! */ |
|
156 |
/* helper symbol for input_declarations */ |
|
157 |
void *visit(var_declarations_c *symbol); |
|
158 |
/* VAR RETAIN var_init_decl_list END_VAR */ |
|
159 |
void *visit(retentive_var_declarations_c *symbol); |
|
160 |
/* VAR [CONSTANT|RETAIN|NON_RETAIN] located_var_decl_list END_VAR */ |
|
161 |
/* option -> may be NULL ! */ |
|
162 |
//SYM_REF2(located_var_declarations_c, option, located_var_decl_list) |
|
163 |
void *visit(located_var_declarations_c *symbol); |
|
164 |
/*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */ |
|
165 |
/* option -> may be NULL ! */ |
|
166 |
//SYM_REF2(external_var_declarations_c, option, external_declaration_list) |
|
167 |
void *visit(external_var_declarations_c *symbol); |
|
168 |
/*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_decl_list END_VAR */ |
|
169 |
/* option -> may be NULL ! */ |
|
170 |
//SYM_REF2(global_var_declarations_c, option, global_var_decl_list) |
|
171 |
void *visit(global_var_declarations_c *symbol); |
|
172 |
/* var1_list is one of the following... |
|
173 |
* simple_spec_init_c * |
|
174 |
* subrange_spec_init_c * |
|
175 |
* enumerated_spec_init_c * |
|
176 |
*/ |
|
177 |
// SYM_REF2(var1_init_decl_c, var1_list, spec_init) |
|
178 |
void *visit(var1_init_decl_c *symbol); |
|
179 |
/* var1_list ',' variable_name */ |
|
180 |
// SYM_LIST(var1_list_c) |
|
181 |
void *visit(var1_list_c *symbol); |
|
182 |
/* name_list ':' function_block_type_name ASSIGN structure_initialization */ |
|
183 |
/* structure_initialization -> may be NULL ! */ |
|
184 |
void *visit(fb_name_decl_c *symbol); |
|
185 |
/* name_list ',' fb_name */ |
|
186 |
void *visit(fb_name_list_c *symbol); |
|
187 |
/* var1_list ':' array_spec_init */ |
|
188 |
// SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init) |
|
189 |
void *visit(array_var_init_decl_c *symbol); |
|
190 |
/* var1_list ':' initialized_structure */ |
|
191 |
// SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure) |
|
192 |
void *visit(structured_var_init_decl_c *symbol); |
|
193 |
/* var1_list ':' array_specification */ |
|
194 |
// SYM_REF2(array_var_declaration_c, var1_list, array_specification) |
|
195 |
void *visit(array_var_declaration_c *symbol); |
|
196 |
/* var1_list ':' structure_type_name */ |
|
197 |
// SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name) |
|
198 |
void *visit(structured_var_declaration_c *symbol); |
|
199 |
/* [variable_name] location ':' located_var_spec_init */ |
|
200 |
/* variable_name -> may be NULL ! */ |
|
201 |
// SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused) |
|
202 |
// TODO!! |
|
203 |
||
204 |
/* global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|function_block_type_name */ |
|
205 |
// SYM_REF2(external_declaration_c, global_var_name, specification) |
|
206 |
void *visit(external_declaration_c *symbol); |
|
207 |
/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */ |
|
208 |
/* type_specification ->may be NULL ! */ |
|
209 |
// SYM_REF2(global_var_decl_c, global_var_spec, type_specification) |
|
210 |
void *visit(global_var_decl_c *symbol); |
|
211 |
/*| global_var_name location */ |
|
212 |
//SYM_REF2(global_var_spec_c, global_var_name, location) |
|
213 |
void *visit(global_var_spec_c *symbol); |
|
214 |
/*| global_var_list ',' global_var_name */ |
|
215 |
//SYM_LIST(global_var_list_c) |
|
216 |
void *visit(global_var_list_c *symbol); |
|
217 |
/* [variable_name] location ':' located_var_spec_init */ |
|
218 |
/* variable_name -> may be NULL ! */ |
|
219 |
//SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused) |
|
220 |
void *visit(located_var_decl_c *symbol); |
|
221 |
/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */ |
|
222 |
/* type_specification ->may be NULL ! */ |
|
223 |
// SYM_REF2(global_var_decl_c, global_var_spec, type_specification) |
|
224 |
// TODO!! |
|
225 |
/* AT direct_variable */ |
|
226 |
// SYM_REF2(location_c, direct_variable, unused) |
|
227 |
void *visit(location_c *symbol); |
|
228 |
/*| global_var_list ',' global_var_name */ |
|
229 |
// SYM_LIST(global_var_list_c) |
|
230 |
// TODO!! |
|
231 |
/* var1_list ':' single_byte_string_spec */ |
|
232 |
// SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec) |
|
233 |
void *visit(single_byte_string_var_declaration_c *symbol); |
|
234 |
/* STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */ |
|
235 |
/* integer ->may be NULL ! */ |
|
236 |
/* single_byte_character_string ->may be NULL ! */ |
|
237 |
// SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string) |
|
238 |
// TODO!! |
|
239 |
||
240 |
/* var1_list ':' double_byte_string_spec */ |
|
241 |
// SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec) |
|
242 |
void *visit(double_byte_string_var_declaration_c *symbol); |
|
243 |
/* WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */ |
|
244 |
/* integer ->may be NULL ! */ |
|
245 |
/* double_byte_character_string ->may be NULL ! */ |
|
246 |
// SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string) |
|
247 |
// TODO!! |
|
248 |
||
249 |
/* variable_name incompl_location ':' var_spec */ |
|
250 |
// SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused) |
|
251 |
// TODO!! |
|
252 |
||
253 |
/* AT incompl_location_token */ |
|
254 |
// SYM_TOKEN(incompl_location_c) |
|
255 |
// TODO!! |
|
256 |
||
257 |
||
258 |
/**************************************/ |
|
259 |
/* B.1.5 - Program organization units */ |
|
260 |
/**************************************/ |
|
261 |
/***********************/ |
|
262 |
/* B 1.5.1 - Functions */ |
|
263 |
/***********************/ |
|
264 |
// SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body) |
|
265 |
void *visit(function_declaration_c *symbol); |
|
266 |
||
267 |
/*****************************/ |
|
268 |
/* B 1.5.2 - Function Blocks */ |
|
269 |
/*****************************/ |
|
270 |
void *visit(function_block_declaration_c *symbol); |
|
271 |
||
272 |
/**********************/ |
|
273 |
/* B 1.5.3 - Programs */ |
|
274 |
/**********************/ |
|
275 |
void *visit(program_declaration_c *symbol); |
|
276 |
||
277 |
/********************************/ |
|
278 |
/* B 1.7 Configuration elements */ |
|
279 |
/********************************/ |
|
280 |
||
281 |
/* |
|
282 |
CONFIGURATION configuration_name |
|
283 |
optional_global_var_declarations |
|
284 |
(resource_declaration_list | single_resource_declaration) |
|
285 |
optional_access_declarations |
|
286 |
optional_instance_specific_initializations |
|
287 |
END_CONFIGURATION |
|
288 |
*/ |
|
289 |
/* |
|
290 |
SYM_REF6(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, unused) |
|
291 |
*/ |
|
292 |
void *visit(configuration_declaration_c *symbol); |
|
293 |
/* |
|
294 |
RESOURCE resource_name ON resource_type_name |
|
295 |
optional_global_var_declarations |
|
296 |
single_resource_declaration |
|
297 |
END_RESOURCE |
|
298 |
*/ |
|
299 |
// SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration) |
|
300 |
void *visit(resource_declaration_c *symbol); |
|
301 |
||
302 |
/* task_configuration_list program_configuration_list */ |
|
303 |
// SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list) |
|
304 |
void *visit(single_resource_declaration_c *symbol); |
|
305 |
||
306 |
}; // search_var_instance_decl_c |
|
307 |