63 |
63 |
64 public: |
64 public: |
65 constant_folding_c(symbol_c *symbol = NULL); |
65 constant_folding_c(symbol_c *symbol = NULL); |
66 virtual ~constant_folding_c(void); |
66 virtual ~constant_folding_c(void); |
67 int get_error_count(); |
67 int get_error_count(); |
68 |
68 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); |
|
69 private: |
|
70 void *handle_var_list_decl(symbol_c *var_list, symbol_c *type_decl); |
|
71 public: |
69 #if 0 |
72 #if 0 |
70 // not currently needed, so comment it out!... |
73 // not currently needed, so comment it out!... |
71 /* utility functions for other stage3 algorithms to access the contant folded values */ |
74 /* utility functions for other stage3 algorithms to access the contant folded values */ |
72 /* written as static since we do not need to iteratively visit the symbols! */ |
75 /* written as static since we do not need to iteratively visit the symbols! */ |
73 // returns true if both symbols have the same value in all the cvalues |
76 // returns true if both symbols have the same value in all the cvalues |
103 /*********************/ |
106 /*********************/ |
104 /* B 1.4 - Variables */ |
107 /* B 1.4 - Variables */ |
105 /*********************/ |
108 /*********************/ |
106 #if DO_CONSTANT_PROPAGATION__ |
109 #if DO_CONSTANT_PROPAGATION__ |
107 void *visit(symbolic_variable_c *symbol); |
110 void *visit(symbolic_variable_c *symbol); |
108 #endif |
111 #endif // DO_CONSTANT_PROPAGATION__ |
|
112 void *visit(symbolic_constant_c *symbol); |
|
113 |
|
114 /******************************************/ |
|
115 /* B 1.4.3 - Declaration & Initialisation */ |
|
116 /******************************************/ |
|
117 void *visit( var1_init_decl_c *symbol); |
|
118 void *visit( input_declarations_c *symbol); |
|
119 void *visit( input_output_declarations_c *symbol); |
|
120 void *visit(retentive_var_declarations_c *symbol); |
|
121 void *visit( external_declaration_c *symbol); |
|
122 |
|
123 /**************************************/ |
|
124 /* B.1.5 - Program organization units */ |
|
125 /**************************************/ |
|
126 /***********************/ |
|
127 /* B 1.5.1 - Functions */ |
|
128 /***********************/ |
|
129 void *visit(function_declaration_c *symbol); |
|
130 |
|
131 /*****************************/ |
|
132 /* B 1.5.2 - Function Blocks */ |
|
133 /*****************************/ |
|
134 void *visit(function_block_declaration_c *symbol); |
109 |
135 |
110 /**********************/ |
136 /**********************/ |
111 /* B 1.5.3 - Programs */ |
137 /* B 1.5.3 - Programs */ |
112 /**********************/ |
138 /**********************/ |
113 #if DO_CONSTANT_PROPAGATION__ |
|
114 void *visit(program_declaration_c *symbol); |
139 void *visit(program_declaration_c *symbol); |
115 #endif |
140 |
116 |
141 |
117 /****************************************/ |
142 /****************************************/ |
118 /* B.2 - Language IL (Instruction List) */ |
143 /* B.2 - Language IL (Instruction List) */ |
119 /****************************************/ |
144 /****************************************/ |
120 /***********************************/ |
145 /***********************************/ |