stage3/stage3.cc
changeset 738 e47cc8c954db
parent 677 740da3255d9d
child 959 8bfcc8e62bd6
equal deleted inserted replaced
737:f6bc5230aadd 738:e47cc8c954db
    41 #include "print_datatypes_error.hh"
    41 #include "print_datatypes_error.hh"
    42 #include "lvalue_check.hh"
    42 #include "lvalue_check.hh"
    43 #include "array_range_check.hh"
    43 #include "array_range_check.hh"
    44 #include "constant_folding.hh"
    44 #include "constant_folding.hh"
    45 #include "declaration_check.hh"
    45 #include "declaration_check.hh"
       
    46 #include "enum_declaration_check.hh"
       
    47 
       
    48 
       
    49 static int enum_declaration_check(symbol_c *tree_root){
       
    50     enum_declaration_check_c enum_declaration_check(NULL);
       
    51     tree_root->accept(enum_declaration_check);
       
    52     return enum_declaration_check.get_error_count();
       
    53 }
       
    54 
    46 
    55 
    47 static int declaration_safety(symbol_c *tree_root){
    56 static int declaration_safety(symbol_c *tree_root){
    48     declaration_check_c declaration_check(tree_root);
    57     declaration_check_c declaration_check(tree_root);
    49     tree_root->accept(declaration_check);
    58     tree_root->accept(declaration_check);
    50     return declaration_check.get_error_count();
    59     return declaration_check.get_error_count();
   105 }
   114 }
   106 
   115 
   107 
   116 
   108 int stage3(symbol_c *tree_root){
   117 int stage3(symbol_c *tree_root){
   109 	int error_count = 0;
   118 	int error_count = 0;
       
   119 	error_count += enum_declaration_check(tree_root);
   110 	error_count += declaration_safety(tree_root);
   120 	error_count += declaration_safety(tree_root);
   111 	error_count += flow_control_analysis(tree_root);
   121 	error_count += flow_control_analysis(tree_root);
   112 	error_count += constant_folding(tree_root);
   122 	error_count += constant_folding(tree_root);
   113 	error_count += type_safety(tree_root);
   123 	error_count += type_safety(tree_root);
   114 	error_count += lvalue_check(tree_root);
   124 	error_count += lvalue_check(tree_root);