stage3/constant_folding.hh
changeset 973 f86d5d6bb04e
parent 969 706a152731ab
child 981 aad6aa35ce60
equal deleted inserted replaced
972:bc90dd4bbf4f 973:f86d5d6bb04e
    39  *       etc...
    39  *       etc...
    40  */
    40  */
    41 
    41 
    42 #include <vector>
    42 #include <vector>
    43 #include "../absyntax_utils/absyntax_utils.hh"
    43 #include "../absyntax_utils/absyntax_utils.hh"
       
    44 #include "../util/symtable.hh"
    44 
    45 
    45 
    46 
    46 
    47 
    47 /* For the moment we disable constant propagation algorithm as it is not yet complete, 
    48 /* For the moment we disable constant propagation algorithm as it is not yet complete, 
    48  * and due to this is currently brocken and producing incorrect results!
    49  * and due to this is currently brocken and producing incorrect results!
    66   public:
    67   public:
    67     constant_folding_c(symbol_c *symbol = NULL);
    68     constant_folding_c(symbol_c *symbol = NULL);
    68     virtual ~constant_folding_c(void);
    69     virtual ~constant_folding_c(void);
    69     int get_error_count();
    70     int get_error_count();
    70     int handle_var_extern_global_pair(symbol_c *extern_var_name, symbol_c *extern_var_decl, symbol_c *global_var_name, symbol_c *global_var_decl);
    71     int handle_var_extern_global_pair(symbol_c *extern_var_name, symbol_c *extern_var_decl, symbol_c *global_var_name, symbol_c *global_var_decl);
    71     typedef std::map <std::string, const_value_c> map_values_t;
    72     typedef symtable_c<const_value_c> map_values_t;
    72   private:
    73   private:
    73     map_values_t values;
    74     map_values_t values;
    74     void *handle_var_list_decl(symbol_c *var_list, symbol_c *type_decl);
    75     void *handle_var_list_decl(symbol_c *var_list, symbol_c *type_decl);
    75     void *handle_var_decl     (symbol_c *var_list, bool fixed_init_value);
    76     void *handle_var_decl     (symbol_c *var_list, bool fixed_init_value);
    76     // Flag to indicate whether the variables in the variable declaration list will always have a fixed value when the POU is executed!
    77     // Flag to indicate whether the variables in the variable declaration list will always have a fixed value when the POU is executed!