author | 'Laurent Bessard <laurent.bessard@lolitech.fr>' |
Wed, 02 Sep 2009 14:05:27 +0200 | |
changeset 205 | 96d8b6e006f0 |
parent 202 | da1a8186f86f |
child 217 | f5dfadf5de54 |
permissions | -rwxr-xr-x |
181 | 1 |
/* |
2 |
* (c) 2003 Mario de Sousa |
|
3 |
* |
|
4 |
* Offered to the public under the terms of the GNU General Public License |
|
5 |
* as published by the Free Software Foundation; either version 2 of the |
|
6 |
* License, or (at your option) any later version. |
|
7 |
* |
|
8 |
* This program is distributed in the hope that it will be useful, but |
|
9 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
11 |
* Public License for more details. |
|
12 |
* |
|
13 |
* This code is made available on the understanding that it will not be |
|
14 |
* used in safety-critical situations without a full and competent review. |
|
15 |
*/ |
|
16 |
||
17 |
/* |
|
18 |
* An IEC 61131-3 IL and ST compiler. |
|
19 |
* |
|
20 |
* Based on the |
|
21 |
* FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
/* Determine the data type of a specific variable instance, including |
|
26 |
* function block instances. |
|
27 |
* A reference to the relevant variable declaration is returned. |
|
28 |
* The variable instance may NOT be a member of a structure of a memeber |
|
29 |
* of a structure of an element of an array of ... |
|
30 |
* |
|
31 |
* example: |
|
32 |
* window.points[1].coordinate.x |
|
33 |
* window.points[1].colour |
|
34 |
* etc... ARE NOT ALLOWED! |
|
35 |
* |
|
36 |
* This class must only be passed the name of the variable that will appear |
|
37 |
* in the variable declaration. In the above examples, this would be |
|
38 |
* 'window' !! |
|
39 |
* |
|
40 |
* |
|
41 |
* If you need to pass a complete name of a variable instance (such as |
|
42 |
* 'window.points[1].coordinate.x') use the search_varfb_instance_type_c instead! |
|
43 |
*/ |
|
44 |
||
45 |
/* Note that current_type_decl that this class returns may reference the |
|
46 |
* name of a type, or the type declaration itself! |
|
47 |
* For an example of the first, consider a variable declared as ... |
|
48 |
* x : AAA; |
|
49 |
* where the AAA type is previously declared as whatever. |
|
50 |
* For an example of the second, consider a variable declared as ... |
|
51 |
* x : array of int [10]; ----> is allowed |
|
52 |
* |
|
53 |
* If it is the first, we will return a reference to the name, if the second |
|
54 |
* we return a reference to the declaration!! |
|
55 |
*/ |
|
56 |
#include "absyntax_utils.hh" |
|
57 |
||
58 |
||
59 |
search_var_instance_decl_c::search_var_instance_decl_c(symbol_c *search_scope) { |
|
60 |
this->current_vartype = none_vt; |
|
61 |
this->search_scope = search_scope; |
|
62 |
this->search_name = NULL; |
|
63 |
this->current_type_decl = NULL; |
|
64 |
} |
|
65 |
||
66 |
symbol_c *search_var_instance_decl_c::get_decl(symbol_c *variable_instance_name) { |
|
67 |
this->search_name = variable_instance_name; |
|
68 |
return (symbol_c *)search_scope->accept(*this); |
|
69 |
} |
|
70 |
||
71 |
unsigned int search_var_instance_decl_c::get_vartype() { |
|
72 |
return current_vartype; |
|
73 |
} |
|
74 |
||
75 |
/***************************/ |
|
76 |
/* B 0 - Programming Model */ |
|
77 |
/***************************/ |
|
78 |
void *search_var_instance_decl_c::visit(library_c *symbol) { |
|
79 |
/* we do not want to search multiple declaration scopes, |
|
80 |
* so we do not visit all the functions, fucntion blocks, etc... |
|
81 |
*/ |
|
82 |
return NULL; |
|
83 |
} |
|
84 |
||
85 |
||
86 |
||
87 |
/******************************************/ |
|
88 |
/* B 1.4.3 - Declaration & Initialisation */ |
|
89 |
/******************************************/ |
|
90 |
/* edge -> The F_EDGE or R_EDGE directive */ |
|
91 |
// SYM_REF2(edge_declaration_c, edge, var1_list) |
|
92 |
// TODO |
|
93 |
||
94 |
void *search_var_instance_decl_c::visit(input_declarations_c *symbol) { |
|
95 |
current_vartype = input_vt; |
|
96 |
void *res = symbol->input_declaration_list->accept(*this); |
|
97 |
if (res == NULL) { |
|
98 |
current_vartype = none_vt; |
|
99 |
} |
|
100 |
return res; |
|
101 |
} |
|
102 |
||
103 |
/* VAR_OUTPUT [RETAIN | NON_RETAIN] var_init_decl_list END_VAR */ |
|
104 |
/* option -> may be NULL ! */ |
|
105 |
void *search_var_instance_decl_c::visit(output_declarations_c *symbol) { |
|
106 |
current_vartype = output_vt; |
|
107 |
void *res = symbol->var_init_decl_list->accept(*this); |
|
108 |
if (res == NULL) { |
|
109 |
current_vartype = none_vt; |
|
110 |
} |
|
111 |
return res; |
|
112 |
} |
|
113 |
||
114 |
/* VAR_IN_OUT var_declaration_list END_VAR */ |
|
115 |
void *search_var_instance_decl_c::visit(input_output_declarations_c *symbol) { |
|
116 |
current_vartype = inoutput_vt; |
|
117 |
void *res = symbol->var_declaration_list->accept(*this); |
|
118 |
if (res == NULL) { |
|
119 |
current_vartype = none_vt; |
|
120 |
} |
|
121 |
return res; |
|
122 |
} |
|
123 |
||
202
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
124 |
/* ENO : BOOL */ |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
125 |
void *search_var_instance_decl_c::visit(eno_param_declaration_c *symbol) { |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
126 |
if (compare_identifiers(symbol->name, search_name) == 0) |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
127 |
return symbol->type; |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
128 |
return NULL; |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
129 |
} |
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
130 |
|
da1a8186f86f
Initial (very rough) version of semantic checker (stage3)
Catarina Boucinha <ccb@fe.up.pt>
parents:
181
diff
changeset
|
131 |
|
181 | 132 |
/* VAR [CONSTANT] var_init_decl_list END_VAR */ |
133 |
/* option -> may be NULL ! */ |
|
134 |
/* helper symbol for input_declarations */ |
|
135 |
void *search_var_instance_decl_c::visit(var_declarations_c *symbol) { |
|
136 |
current_vartype = private_vt; |
|
137 |
void *res = symbol->var_init_decl_list->accept(*this); |
|
138 |
if (res == NULL) { |
|
139 |
current_vartype = none_vt; |
|
140 |
} |
|
141 |
return res; |
|
142 |
} |
|
143 |
||
144 |
/* VAR RETAIN var_init_decl_list END_VAR */ |
|
145 |
void *search_var_instance_decl_c::visit(retentive_var_declarations_c *symbol) { |
|
146 |
current_vartype = private_vt; |
|
147 |
void *res = symbol->var_init_decl_list->accept(*this); |
|
148 |
if (res == NULL) { |
|
149 |
current_vartype = none_vt; |
|
150 |
} |
|
151 |
return res; |
|
152 |
} |
|
153 |
||
154 |
/* VAR [CONSTANT|RETAIN|NON_RETAIN] located_var_decl_list END_VAR */ |
|
155 |
/* option -> may be NULL ! */ |
|
156 |
//SYM_REF2(located_var_declarations_c, option, located_var_decl_list) |
|
157 |
void *search_var_instance_decl_c::visit(located_var_declarations_c *symbol) { |
|
158 |
current_vartype = located_vt; |
|
159 |
void *res = symbol->located_var_decl_list->accept(*this); |
|
160 |
if (res == NULL) { |
|
161 |
current_vartype = none_vt; |
|
162 |
} |
|
163 |
return res; |
|
164 |
} |
|
165 |
||
166 |
/*| VAR_EXTERNAL [CONSTANT] external_declaration_list END_VAR */ |
|
167 |
/* option -> may be NULL ! */ |
|
168 |
//SYM_REF2(external_var_declarations_c, option, external_declaration_list) |
|
169 |
void *search_var_instance_decl_c::visit(external_var_declarations_c *symbol) { |
|
170 |
current_vartype = external_vt; |
|
171 |
void *res = symbol->external_declaration_list->accept(*this); |
|
172 |
if (res == NULL) { |
|
173 |
current_vartype = none_vt; |
|
174 |
} |
|
175 |
return res; |
|
176 |
} |
|
177 |
||
178 |
/*| VAR_GLOBAL [CONSTANT|RETAIN] global_var_decl_list END_VAR */ |
|
179 |
/* option -> may be NULL ! */ |
|
180 |
//SYM_REF2(global_var_declarations_c, option, global_var_decl_list) |
|
181 |
void *search_var_instance_decl_c::visit(global_var_declarations_c *symbol) { |
|
182 |
current_vartype = global_vt; |
|
183 |
void *res = symbol->global_var_decl_list->accept(*this); |
|
184 |
if (res == NULL) { |
|
185 |
current_vartype = none_vt; |
|
186 |
} |
|
187 |
return res; |
|
188 |
} |
|
189 |
||
190 |
/* var1_list is one of the following... |
|
191 |
* simple_spec_init_c * |
|
192 |
* subrange_spec_init_c * |
|
193 |
* enumerated_spec_init_c * |
|
194 |
*/ |
|
195 |
// SYM_REF2(var1_init_decl_c, var1_list, spec_init) |
|
196 |
void *search_var_instance_decl_c::visit(var1_init_decl_c *symbol) { |
|
197 |
current_type_decl = symbol->spec_init; |
|
198 |
return symbol->var1_list->accept(*this); |
|
199 |
} |
|
200 |
||
201 |
/* var1_list ',' variable_name */ |
|
202 |
// SYM_LIST(var1_list_c) |
|
203 |
void *search_var_instance_decl_c::visit(var1_list_c *symbol) { |
|
204 |
list_c *list = symbol; |
|
205 |
for(int i = 0; i < list->n; i++) { |
|
206 |
if (compare_identifiers(list->elements[i], search_name) == 0) |
|
207 |
/* by now, current_type_decl should be != NULL */ |
|
208 |
return current_type_decl; |
|
209 |
} |
|
210 |
return NULL; |
|
211 |
} |
|
212 |
||
213 |
/* name_list ':' function_block_type_name ASSIGN structure_initialization */ |
|
214 |
/* structure_initialization -> may be NULL ! */ |
|
215 |
void *search_var_instance_decl_c::visit(fb_name_decl_c *symbol) { |
|
216 |
current_type_decl = symbol->function_block_type_name; |
|
217 |
return symbol->fb_name_list->accept(*this); |
|
218 |
} |
|
219 |
||
220 |
/* name_list ',' fb_name */ |
|
221 |
void *search_var_instance_decl_c::visit(fb_name_list_c *symbol) { |
|
222 |
list_c *list = symbol; |
|
223 |
for(int i = 0; i < list->n; i++) { |
|
224 |
if (compare_identifiers(list->elements[i], search_name) == 0) |
|
225 |
/* by now, current_fb_declaration should be != NULL */ |
|
226 |
return current_type_decl; |
|
227 |
} |
|
228 |
return NULL; |
|
229 |
} |
|
230 |
||
231 |
/* var1_list ':' array_spec_init */ |
|
232 |
// SYM_REF2(array_var_init_decl_c, var1_list, array_spec_init) |
|
233 |
void *search_var_instance_decl_c::visit(array_var_init_decl_c *symbol) { |
|
234 |
current_type_decl = symbol->array_spec_init; |
|
235 |
return symbol->var1_list->accept(*this); |
|
236 |
} |
|
237 |
||
238 |
/* var1_list ':' initialized_structure */ |
|
239 |
// SYM_REF2(structured_var_init_decl_c, var1_list, initialized_structure) |
|
240 |
void *search_var_instance_decl_c::visit(structured_var_init_decl_c *symbol) { |
|
241 |
current_type_decl = symbol->initialized_structure; |
|
242 |
return symbol->var1_list->accept(*this); |
|
243 |
} |
|
244 |
||
245 |
/* var1_list ':' array_specification */ |
|
246 |
// SYM_REF2(array_var_declaration_c, var1_list, array_specification) |
|
247 |
void *search_var_instance_decl_c::visit(array_var_declaration_c *symbol) { |
|
248 |
current_type_decl = symbol->array_specification; |
|
249 |
return symbol->var1_list->accept(*this); |
|
250 |
} |
|
251 |
||
252 |
/* var1_list ':' structure_type_name */ |
|
253 |
// SYM_REF2(structured_var_declaration_c, var1_list, structure_type_name) |
|
254 |
void *search_var_instance_decl_c::visit(structured_var_declaration_c *symbol) { |
|
255 |
current_type_decl = symbol->structure_type_name; |
|
256 |
return symbol->var1_list->accept(*this); |
|
257 |
} |
|
258 |
||
259 |
/* [variable_name] location ':' located_var_spec_init */ |
|
260 |
/* variable_name -> may be NULL ! */ |
|
261 |
// SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused) |
|
262 |
// TODO!! |
|
263 |
||
264 |
/* global_var_name ':' (simple_specification|subrange_specification|enumerated_specification|array_specification|prev_declared_structure_type_name|function_block_type_name */ |
|
265 |
// SYM_REF2(external_declaration_c, global_var_name, specification) |
|
266 |
void *search_var_instance_decl_c::visit(external_declaration_c *symbol) { |
|
267 |
if (compare_identifiers(symbol->global_var_name, search_name) == 0) |
|
268 |
return symbol->specification; |
|
269 |
return NULL; |
|
270 |
} |
|
271 |
||
272 |
/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */ |
|
273 |
/* type_specification ->may be NULL ! */ |
|
274 |
// SYM_REF2(global_var_decl_c, global_var_spec, type_specification) |
|
275 |
void *search_var_instance_decl_c::visit(global_var_decl_c *symbol) { |
|
276 |
if (symbol->type_specification != NULL) { |
|
277 |
current_type_decl = symbol->type_specification; |
|
278 |
return symbol->global_var_spec->accept(*this); |
|
279 |
} |
|
280 |
else |
|
281 |
return NULL; |
|
282 |
} |
|
283 |
||
284 |
/*| global_var_name location */ |
|
285 |
//SYM_REF2(global_var_spec_c, global_var_name, location) |
|
286 |
void *search_var_instance_decl_c::visit(global_var_spec_c *symbol) { |
|
287 |
if (symbol->global_var_name != NULL && compare_identifiers(symbol->global_var_name, search_name) == 0) |
|
288 |
return current_type_decl; |
|
289 |
else |
|
290 |
return symbol->location->accept(*this); |
|
291 |
} |
|
292 |
||
293 |
/*| global_var_list ',' global_var_name */ |
|
294 |
//SYM_LIST(global_var_list_c) |
|
295 |
void *search_var_instance_decl_c::visit(global_var_list_c *symbol) { |
|
296 |
list_c *list = symbol; |
|
297 |
for(int i = 0; i < list->n; i++) { |
|
298 |
if (compare_identifiers(list->elements[i], search_name) == 0) |
|
299 |
/* by now, current_type_decl should be != NULL */ |
|
300 |
return current_type_decl; |
|
301 |
} |
|
302 |
return NULL; |
|
303 |
} |
|
304 |
||
305 |
/* [variable_name] location ':' located_var_spec_init */ |
|
306 |
/* variable_name -> may be NULL ! */ |
|
307 |
//SYM_REF4(located_var_decl_c, variable_name, location, located_var_spec_init, unused) |
|
308 |
void *search_var_instance_decl_c::visit(located_var_decl_c *symbol) { |
|
309 |
if (symbol->variable_name != NULL && compare_identifiers(symbol->variable_name, search_name) == 0) |
|
310 |
return symbol->located_var_spec_init; |
|
311 |
else { |
|
312 |
current_type_decl = symbol->located_var_spec_init; |
|
313 |
return symbol->location->accept(*this); |
|
314 |
} |
|
315 |
} |
|
316 |
||
317 |
/*| global_var_spec ':' [located_var_spec_init|function_block_type_name] */ |
|
318 |
/* type_specification ->may be NULL ! */ |
|
319 |
// SYM_REF2(global_var_decl_c, global_var_spec, type_specification) |
|
320 |
// TODO!! |
|
321 |
||
322 |
/* AT direct_variable */ |
|
323 |
// SYM_REF2(location_c, direct_variable, unused) |
|
324 |
void *search_var_instance_decl_c::visit(location_c *symbol) { |
|
325 |
if (compare_identifiers(symbol->direct_variable, search_name) == 0) |
|
326 |
return current_type_decl; |
|
327 |
else |
|
328 |
return NULL; |
|
329 |
} |
|
330 |
||
331 |
/*| global_var_list ',' global_var_name */ |
|
332 |
// SYM_LIST(global_var_list_c) |
|
333 |
// TODO!! |
|
334 |
||
335 |
/* var1_list ':' single_byte_string_spec */ |
|
336 |
// SYM_REF2(single_byte_string_var_declaration_c, var1_list, single_byte_string_spec) |
|
337 |
void *search_var_instance_decl_c::visit(single_byte_string_var_declaration_c *symbol) { |
|
338 |
current_type_decl = symbol->single_byte_string_spec; |
|
339 |
return symbol->var1_list->accept(*this); |
|
340 |
} |
|
341 |
||
342 |
/* STRING ['[' integer ']'] [ASSIGN single_byte_character_string] */ |
|
343 |
/* integer ->may be NULL ! */ |
|
344 |
/* single_byte_character_string ->may be NULL ! */ |
|
345 |
// SYM_REF2(single_byte_string_spec_c, integer, single_byte_character_string) |
|
346 |
// TODO!! |
|
347 |
||
348 |
/* var1_list ':' double_byte_string_spec */ |
|
349 |
// SYM_REF2(double_byte_string_var_declaration_c, var1_list, double_byte_string_spec) |
|
350 |
void *search_var_instance_decl_c::visit(double_byte_string_var_declaration_c *symbol) { |
|
351 |
current_type_decl = symbol->double_byte_string_spec; |
|
352 |
return symbol->var1_list->accept(*this); |
|
353 |
} |
|
354 |
||
355 |
/* WSTRING ['[' integer ']'] [ASSIGN double_byte_character_string] */ |
|
356 |
/* integer ->may be NULL ! */ |
|
357 |
/* double_byte_character_string ->may be NULL ! */ |
|
358 |
// SYM_REF2(double_byte_string_spec_c, integer, double_byte_character_string) |
|
359 |
// TODO!! |
|
360 |
||
361 |
/* variable_name incompl_location ':' var_spec */ |
|
362 |
// SYM_REF4(incompl_located_var_decl_c, variable_name, incompl_location, var_spec, unused) |
|
363 |
// TODO!! |
|
364 |
||
365 |
/* AT incompl_location_token */ |
|
366 |
// SYM_TOKEN(incompl_location_c) |
|
367 |
// TODO!! |
|
368 |
||
369 |
||
370 |
/**************************************/ |
|
371 |
/* B.1.5 - Program organization units */ |
|
372 |
/**************************************/ |
|
373 |
/***********************/ |
|
374 |
/* B 1.5.1 - Functions */ |
|
375 |
/***********************/ |
|
376 |
// SYM_REF4(function_declaration_c, derived_function_name, type_name, var_declarations_list, function_body) |
|
377 |
void *search_var_instance_decl_c::visit(function_declaration_c *symbol) { |
|
378 |
/* functions have a variable named after themselves, to store |
|
379 |
* the variable that will be returned!! |
|
380 |
*/ |
|
381 |
if (compare_identifiers(symbol->derived_function_name, search_name) == 0) |
|
382 |
return symbol->type_name; |
|
383 |
||
384 |
/* no need to search through all the body, so we only |
|
385 |
* visit the variable declarations...! |
|
386 |
*/ |
|
387 |
return symbol->var_declarations_list->accept(*this); |
|
388 |
} |
|
389 |
||
390 |
/*****************************/ |
|
391 |
/* B 1.5.2 - Function Blocks */ |
|
392 |
/*****************************/ |
|
393 |
void *search_var_instance_decl_c::visit(function_block_declaration_c *symbol) { |
|
394 |
/* no need to search through all the body, so we only |
|
395 |
* visit the variable declarations...! |
|
396 |
*/ |
|
397 |
return symbol->var_declarations->accept(*this); |
|
398 |
} |
|
399 |
||
400 |
/**********************/ |
|
401 |
/* B 1.5.3 - Programs */ |
|
402 |
/**********************/ |
|
403 |
void *search_var_instance_decl_c::visit(program_declaration_c *symbol) { |
|
404 |
/* no need to search through all the body, so we only |
|
405 |
* visit the variable declarations...! |
|
406 |
*/ |
|
407 |
return symbol->var_declarations->accept(*this); |
|
408 |
} |
|
409 |
||
410 |
||
411 |
/********************************/ |
|
412 |
/* B 1.7 Configuration elements */ |
|
413 |
/********************************/ |
|
414 |
||
415 |
/* |
|
416 |
CONFIGURATION configuration_name |
|
417 |
optional_global_var_declarations |
|
418 |
(resource_declaration_list | single_resource_declaration) |
|
419 |
optional_access_declarations |
|
420 |
optional_instance_specific_initializations |
|
421 |
END_CONFIGURATION |
|
422 |
*/ |
|
423 |
/* |
|
424 |
SYM_REF6(configuration_declaration_c, configuration_name, global_var_declarations, resource_declarations, access_declarations, instance_specific_initializations, unused) |
|
425 |
*/ |
|
426 |
void *search_var_instance_decl_c::visit(configuration_declaration_c *symbol) { |
|
427 |
/* no need to search through all the configuration, so we only |
|
428 |
* visit the global variable declarations...! |
|
429 |
*/ |
|
430 |
if (symbol->global_var_declarations != NULL) |
|
431 |
return symbol->global_var_declarations->accept(*this); |
|
432 |
else |
|
433 |
return NULL; |
|
434 |
} |
|
435 |
||
436 |
/* |
|
437 |
RESOURCE resource_name ON resource_type_name |
|
438 |
optional_global_var_declarations |
|
439 |
single_resource_declaration |
|
440 |
END_RESOURCE |
|
441 |
*/ |
|
442 |
// SYM_REF4(resource_declaration_c, resource_name, resource_type_name, global_var_declarations, resource_declaration) |
|
443 |
void *search_var_instance_decl_c::visit(resource_declaration_c *symbol) { |
|
444 |
/* no need to search through all the resource, so we only |
|
445 |
* visit the global variable declarations...! |
|
446 |
*/ |
|
447 |
if (symbol->global_var_declarations != NULL) |
|
448 |
return symbol->global_var_declarations->accept(*this); |
|
449 |
else |
|
450 |
return NULL; |
|
451 |
} |
|
452 |
||
453 |
/* task_configuration_list program_configuration_list */ |
|
454 |
// SYM_REF2(single_resource_declaration_c, task_configuration_list, program_configuration_list) |
|
455 |
void *search_var_instance_decl_c::visit(single_resource_declaration_c *symbol) { |
|
456 |
/* no need to search through all the resource, |
|
457 |
* and there is no global variable declarations...! |
|
458 |
*/ |
|
459 |
return NULL; |
|
460 |
} |
|
461 |
||
462 |
#if 0 |
|
463 |
/*********************/ |
|
464 |
/* B 1.4 - Variables */ |
|
465 |
/*********************/ |
|
466 |
SYM_REF2(symbolic_variable_c, var_name, unused) |
|
467 |
||
468 |
/********************************************/ |
|
469 |
/* B.1.4.1 Directly Represented Variables */ |
|
470 |
/********************************************/ |
|
471 |
SYM_TOKEN(direct_variable_c) |
|
472 |
||
473 |
/*************************************/ |
|
474 |
/* B.1.4.2 Multi-element Variables */ |
|
475 |
/*************************************/ |
|
476 |
/* subscripted_variable '[' subscript_list ']' */ |
|
477 |
SYM_REF2(array_variable_c, subscripted_variable, subscript_list) |
|
478 |
||
479 |
/* subscript_list ',' subscript */ |
|
480 |
SYM_LIST(subscript_list_c) |
|
481 |
||
482 |
/* record_variable '.' field_selector */ |
|
483 |
/* WARNING: input and/or output variables of function blocks |
|
484 |
* may be accessed as fields of a tructured variable! |
|
485 |
* Code handling a structured_variable_c must take |
|
486 |
* this into account! |
|
487 |
*/ |
|
488 |
SYM_REF2(structured_variable_c, record_variable, field_selector) |
|
489 |
||
490 |
||
491 |
||
492 |
}; |
|
493 |
#endif |