198 * |
198 * |
199 * Bison accesses these data structures directly. |
199 * Bison accesses these data structures directly. |
200 * |
200 * |
201 * In essence, they are a data passing mechanism between Bison and Flex. |
201 * In essence, they are a data passing mechanism between Bison and Flex. |
202 */ |
202 */ |
203 /* NOTE: BOGUS_TOKEN_ID is defined in the bison generated file iec_bison.hh. |
|
204 * We need this constant defined before we can declare the symbol tables. |
|
205 * However, we cannot #include "iec_bison.hh" in this file (stage1_2_priv.hh) directly |
|
206 * because of the way bison ver. 2.3 is copying all declarations in the prologue |
|
207 * of iec.y to the iec_bison.hh file (including an #include stage1_2_priv.hh). |
|
208 * So, if we were to include "iec_bison.hh" here, we would get a circular include. |
|
209 * All this means that whoever includes this file (stage1_2_priv.hh) will need |
|
210 * to take care to first inlcude iec_bison.hh !! |
|
211 */ |
|
212 /* A symbol table to store all the library elements */ |
203 /* A symbol table to store all the library elements */ |
213 /* e.g.: <function_name , function_decl> |
204 /* e.g.: <function_name , function_decl> |
214 * <fb_name , fb_decl> |
205 * <fb_name , fb_decl> |
215 * <type_name , type_decl> |
206 * <type_name , type_decl> |
216 * <program_name , program_decl> |
207 * <program_name , program_decl> |
217 * <configuration_name , configuration_decl> |
208 * <configuration_name , configuration_decl> |
218 */ |
209 */ |
219 extern symtable_c<int, BOGUS_TOKEN_ID> library_element_symtable; |
210 typedef symtable_c<int> library_element_symtable_t; |
|
211 extern library_element_symtable_t library_element_symtable; |
220 |
212 |
221 /* A symbol table to store the declared variables of |
213 /* A symbol table to store the declared variables of |
222 * the function currently being parsed... |
214 * the function currently being parsed... |
223 */ |
215 */ |
224 extern symtable_c<int, BOGUS_TOKEN_ID> variable_name_symtable; |
216 typedef symtable_c<int> variable_name_symtable_t; |
|
217 extern variable_name_symtable_t variable_name_symtable; |
225 |
218 |
226 /* A symbol table to store the declared direct variables of |
219 /* A symbol table to store the declared direct variables of |
227 * the function currently being parsed... |
220 * the function currently being parsed... |
228 */ |
221 */ |
229 extern symtable_c<int, BOGUS_TOKEN_ID> direct_variable_symtable; |
222 typedef symtable_c<int> direct_variable_symtable_t; |
|
223 extern direct_variable_symtable_t direct_variable_symtable; |
230 |
224 |
231 /* Function only called from within flex! |
225 /* Function only called from within flex! |
232 * |
226 * |
233 * search for a symbol in either of the two symbol tables |
227 * search for a symbol in either of the two symbol tables |
234 * declared above, and return the token id of the first |
228 * declared above, and return the token id of the first |