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