1 /* |
|
2 * (c) 2009 Mario de Sousa |
|
3 * |
|
4 * Offered to the public under the terms of the GNU General Public License |
|
5 * as published by the Free Software Foundation; either version 2 of the |
|
6 * License, or (at your option) any later version. |
|
7 * |
|
8 * This program is distributed in the hope that it will be useful, but |
|
9 * WITHOUT ANY WARRANTY; without even the implied warranty of |
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
|
11 * Public License for more details. |
|
12 * |
|
13 * This code is made available on the understanding that it will not be |
|
14 * used in safety-critical situations without a full and competent review. |
|
15 */ |
|
16 |
|
17 /* |
|
18 * An IEC 61131-3 IL and ST compiler. |
|
19 * |
|
20 * Based on the |
|
21 * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) |
|
22 * |
|
23 */ |
|
24 |
|
25 |
|
26 /* |
|
27 * This is the main stage 3a file. |
|
28 * |
|
29 * In stage 3a some helpful symbol tables are instanciated and populated. |
|
30 * These symbol tables wll then be used by stage3b and atage4 code generators. |
|
31 */ |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 // #include <stdio.h> /* required for NULL */ |
|
39 #include "../util/symtable.hh" |
|
40 #include "../util/dsymtable.hh" |
|
41 #include "../absyntax/visitor.hh" |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 /* A symbol table with all globally declared functions... */ |
|
48 extern function_declaration_c null_symbol1; |
|
49 extern dsymtable_c<function_declaration_c *, &null_symbol1> function_symtable; |
|
50 |
|
51 /* A symbol table with all globally declared functions block types... */ |
|
52 extern function_block_declaration_c null_symbol2; |
|
53 extern symtable_c<function_block_declaration_c *, &null_symbol2> function_block_type_symtable; |
|
54 |
|
55 /* A symbol table with all globally declared program types... */ |
|
56 extern program_declaration_c null_symbol3; |
|
57 extern symtable_c<program_declaration_c *, &null_symbol3> program_type_symtable; |
|
58 |
|
59 /* A symbol table with all user declared type definitions... */ |
|
60 /* Note that function block types and program types have their |
|
61 * own symbol tables, so do not get placed in this symbol table! |
|
62 */ |
|
63 extern symbol_c null_symbol4; |
|
64 extern symtable_c<symbol_c *, &null_symbol4> type_symtable; |
|
65 |
|
66 |
|
67 |
|
68 /***********************************************************************/ |
|
69 /***********************************************************************/ |
|
70 /***********************************************************************/ |
|
71 /***********************************************************************/ |
|
72 |
|
73 /* |
|
74 #include "spec_init_separator.cc" |
|
75 #include "function_param_iterator.cc" |
|
76 #include "function_call_iterator.cc" |
|
77 #include "function_call_param_iterator.cc" |
|
78 #include "type_initial_value.cc" |
|
79 #include "search_fb_instance_decl.cc" |
|
80 #include "search_fb_typedecl.cc" |
|
81 #include "search_base_type.cc" |
|
82 #include "search_var_instance_decl.cc" |
|
83 #include "decompose_var_instance_name.cc" |
|
84 #include "search_varfb_instance_type.cc" |
|
85 #include "search_constant_type.cc" |
|
86 #include "search_expression_type.cc" |
|
87 |
|
88 #include "generate_c_base.cc" |
|
89 #include "generate_c_typedecl.cc" |
|
90 #include "generate_c_sfcdecl.cc" |
|
91 #include "generate_c_vardecl.cc" |
|
92 #include "generate_c_configbody.cc" |
|
93 #include "generate_location_list.cc" |
|
94 #include "generate_var_list.cc" |
|
95 */ |
|
96 |
|
97 /***********************************************************************/ |
|
98 /***********************************************************************/ |
|
99 /***********************************************************************/ |
|
100 /***********************************************************************/ |
|
101 /***********************************************************************/ |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 void search_utils_init(symbol_c *tree_root); |
|