stage3/enum_declaration_check.hh
changeset 752 8f05bde3efa8
equal deleted inserted replaced
751:0a5c050d64bb 752:8f05bde3efa8
       
     1 /*
       
     2  *  matiec - a compiler for the programming languages defined in IEC 61131-3
       
     3  *
       
     4  *  Copyright (C) 2012  Mario de Sousa (msousa@fe.up.pt)
       
     5  *
       
     6  *  This program is free software: you can redistribute it and/or modify
       
     7  *  it under the terms of the GNU General Public License as published by
       
     8  *  the Free Software Foundation, either version 3 of the License, or
       
     9  *  (at your option) any later version.
       
    10  *
       
    11  *  This program is distributed in the hope that it will be useful,
       
    12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    14  *  GNU General Public License for more details.
       
    15  *
       
    16  *  You should have received a copy of the GNU General Public License
       
    17  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
       
    18  *
       
    19  *
       
    20  * This code is made available on the understanding that it will not be
       
    21  * used in safety-critical situations without a full and competent review.
       
    22  */
       
    23 
       
    24 /*
       
    25  * An IEC 61131-3 compiler.
       
    26  *
       
    27  * Based on the
       
    28  * FINAL DRAFT - IEC 61131-3, 2nd Ed. (2001-12-10)
       
    29  *
       
    30  */
       
    31 
       
    32 
       
    33 #include "../absyntax_utils/absyntax_utils.hh"
       
    34 
       
    35 class populate_enumvalue_symtable_c;
       
    36 
       
    37 class enum_declaration_check_c : public iterator_visitor_c {
       
    38   private:
       
    39     int error_count;
       
    40     int current_display_error_level;
       
    41     populate_enumvalue_symtable_c *populate_enumvalue_symtable;
       
    42     symbol_c::enumvalue_symtable_t *global_enumvalue_symtable;
       
    43     
       
    44   public:
       
    45      enum_declaration_check_c(symbol_c *ignore);
       
    46     ~enum_declaration_check_c(void);
       
    47     int get_error_count();
       
    48 
       
    49     
       
    50     /***************************/
       
    51     /* B 0 - Programming Model */
       
    52     /***************************/
       
    53     void *visit(library_c *symbol);
       
    54 
       
    55     /**********************/
       
    56     /* B.1.3 - Data types */
       
    57     /**********************/
       
    58     void *visit(data_type_declaration_c *symbol);
       
    59   
       
    60     /***********************/
       
    61     /* B 1.5.1 - Functions */
       
    62     /***********************/
       
    63     void *visit(function_declaration_c *symbol);
       
    64    
       
    65     /*****************************/
       
    66     /* B 1.5.2 - Function Blocks */
       
    67     /*****************************/
       
    68     void *visit(function_block_declaration_c *symbol);
       
    69 
       
    70     /******************************************/
       
    71     /* B 1.5.3 - Declaration & Initialisation */
       
    72     /******************************************/
       
    73     void *visit(program_declaration_c *symbol);
       
    74 
       
    75     /********************************/
       
    76     /* B 1.7 Configuration elements */
       
    77     /********************************/
       
    78     void *visit(configuration_declaration_c *symbol);
       
    79     void *visit(resource_declaration_c *symbol);
       
    80     void *visit(single_resource_declaration_c *symbol);    
       
    81 };