mario@178: /* mario@178: * (c) 2009 Mario de Sousa mario@178: * mario@178: * Offered to the public under the terms of the GNU General Public License mario@178: * as published by the Free Software Foundation; either version 2 of the mario@178: * License, or (at your option) any later version. mario@178: * mario@178: * This program is distributed in the hope that it will be useful, but mario@178: * WITHOUT ANY WARRANTY; without even the implied warranty of mario@178: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General mario@178: * Public License for more details. mario@178: * mario@178: * This code is made available on the understanding that it will not be mario@178: * used in safety-critical situations without a full and competent review. mario@178: */ mario@178: mario@178: /* mario@178: * An IEC 61131-3 IL and ST compiler. mario@178: * mario@178: * Based on the mario@178: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10) mario@178: * mario@178: */ mario@178: mario@178: mario@178: /* mario@178: * This is the main stage 3a file. mario@178: * mario@178: * In stage 3a some helpful symbol tables are instanciated and populated. mario@178: * These symbol tables wll then be used by stage3b and atage4 code generators. mario@178: */ mario@178: mario@178: mario@178: mario@178: mario@178: mario@178: mario@178: // #include /* required for NULL */ mario@178: #include "../util/symtable.hh" mario@178: #include "../util/dsymtable.hh" mario@178: #include "../absyntax/visitor.hh" mario@178: mario@178: mario@178: mario@178: mario@178: mario@178: /* A symbol table with all globally declared functions... */ mario@178: extern function_declaration_c null_symbol1; mario@178: extern dsymtable_c function_symtable; mario@178: mario@178: /* A symbol table with all globally declared functions block types... */ mario@178: extern function_block_declaration_c null_symbol2; mario@178: extern symtable_c function_block_type_symtable; mario@178: mario@178: /* A symbol table with all globally declared program types... */ mario@178: extern program_declaration_c null_symbol3; mario@178: extern symtable_c program_type_symtable; mario@178: mario@178: /* A symbol table with all user declared type definitions... */ mario@178: /* Note that function block types and program types have their mario@178: * own symbol tables, so do not get placed in this symbol table! mario@178: */ mario@178: extern symbol_c null_symbol4; mario@178: extern symtable_c type_symtable; mario@178: mario@178: mario@178: mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: mario@178: /* mario@178: #include "spec_init_separator.cc" mario@178: #include "function_param_iterator.cc" mario@178: #include "function_call_iterator.cc" mario@178: #include "function_call_param_iterator.cc" mario@178: #include "type_initial_value.cc" mario@178: #include "search_fb_instance_decl.cc" mario@178: #include "search_fb_typedecl.cc" mario@178: #include "search_base_type.cc" mario@178: #include "search_var_instance_decl.cc" mario@178: #include "decompose_var_instance_name.cc" mario@178: #include "search_varfb_instance_type.cc" mario@178: #include "search_constant_type.cc" mario@178: #include "search_expression_type.cc" mario@178: mario@178: #include "generate_c_base.cc" mario@178: #include "generate_c_typedecl.cc" mario@178: #include "generate_c_sfcdecl.cc" mario@178: #include "generate_c_vardecl.cc" mario@178: #include "generate_c_configbody.cc" mario@178: #include "generate_location_list.cc" mario@178: #include "generate_var_list.cc" mario@178: */ mario@178: mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: /***********************************************************************/ mario@178: mario@178: mario@178: mario@178: mario@178: void search_utils_init(symbol_c *tree_root);