conti@656: /*
conti@656: * matiec - a compiler for the programming languages defined in IEC 61131-3
conti@656: *
msousa@658: * Copyright (C) 2003-2012 Mario de Sousa (msousa@fe.up.pt)
conti@656: * Copyright (C) 2012 Manuele Conti (conti.ma@alice.it)
conti@656: *
conti@656: * This program is free software: you can redistribute it and/or modify
conti@656: * it under the terms of the GNU General Public License as published by
conti@656: * the Free Software Foundation, either version 3 of the License, or
conti@656: * (at your option) any later version.
conti@656: *
conti@656: * This program is distributed in the hope that it will be useful,
conti@656: * but WITHOUT ANY WARRANTY; without even the implied warranty of
conti@656: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
conti@656: * GNU General Public License for more details.
conti@656: *
conti@656: * You should have received a copy of the GNU General Public License
conti@656: * along with this program. If not, see .
conti@656: *
conti@656: *
conti@656: * This code is made available on the understanding that it will not be
conti@656: * used in safety-critical situations without a full and competent review.
conti@656: */
conti@656:
conti@656: /*
conti@656: * An IEC 61131-3 compiler.
conti@656: *
conti@656: * Based on the
conti@656: * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
conti@656: *
conti@656: */
conti@656:
conti@656: #include
conti@656:
conti@656: #include "../absyntax_utils/absyntax_utils.hh"
conti@656:
conti@656:
conti@656: class declaration_check_c : public iterator_visitor_c {
conti@656: int error_count;
conti@656: int current_display_error_level;
conti@656: search_base_type_c search_base_type;
msousa@658: symbol_c *current_pou_decl;
conti@656:
conti@656: public:
conti@656: declaration_check_c(symbol_c *ignore);
conti@656: virtual ~declaration_check_c(void);
conti@656: int get_error_count();
conti@656:
conti@656: void check_global_decl(symbol_c *p_decl);
msousa@660:
msousa@660: /*****************************/
msousa@660: /* B 1.5.2 - Function Blocks */
msousa@660: /*****************************/
msousa@660: void *visit(function_block_declaration_c *symbol);
msousa@660:
conti@656: /******************************************/
msousa@658: /* B 1.5.3 - Declaration & Initialisation */
conti@656: /******************************************/
msousa@658: void *visit(program_declaration_c *symbol);
msousa@660:
conti@656: /********************************/
conti@656: /* B 1.7 Configuration elements */
conti@656: /********************************/
msousa@660: void *visit(configuration_declaration_c *symbol);
conti@656: void *visit(program_configuration_c *symbol);
conti@656: };