147 /* NOTE: DO NOT place any code here that references symbol->anotations_map["generate_c_annotaton__implicit_type_id"] !! |
147 /* NOTE: DO NOT place any code here that references symbol->anotations_map["generate_c_annotaton__implicit_type_id"] !! |
148 * All anotations in the symbol->anotations_map[] are considered a stage4 construct. In the above example, |
148 * All anotations in the symbol->anotations_map[] are considered a stage4 construct. In the above example, |
149 * That anotation is specific to the generate_c stage4 code, and must therefore NOT be referenced |
149 * That anotation is specific to the generate_c stage4 code, and must therefore NOT be referenced |
150 * in the absyntax_utils code, as this last code should be independent of the stage4 version! |
150 * in the absyntax_utils code, as this last code should be independent of the stage4 version! |
151 */ |
151 */ |
152 |
152 |
153 /*****************************/ |
153 /*****************************/ |
154 /* B 1.5.2 - Function Blocks */ |
154 /* B 1.5.2 - Function Blocks */ |
155 /*****************************/ |
155 /*****************************/ |
156 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
156 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
157 void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name;} |
157 void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name;} |
|
158 /**********************/ |
|
159 /* B 1.5.3 - Programs */ |
|
160 /**********************/ |
|
161 /* PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */ |
|
162 void *visit(program_declaration_c *symbol) {return symbol->program_type_name;} |
|
163 |
158 }; // get_datatype_id_c |
164 }; // get_datatype_id_c |
159 |
165 |
160 get_datatype_id_c *get_datatype_id_c::singleton = NULL; |
166 get_datatype_id_c *get_datatype_id_c::singleton = NULL; |
161 |
167 |
162 |
168 |
198 /*************************/ |
204 /*************************/ |
199 /*******************************************/ |
205 /*******************************************/ |
200 /* B 1.1 - Letters, digits and identifiers */ |
206 /* B 1.1 - Letters, digits and identifiers */ |
201 /*******************************************/ |
207 /*******************************************/ |
202 void *visit( identifier_c *symbol) {return (void *)symbol->value;}; |
208 void *visit( identifier_c *symbol) {return (void *)symbol->value;}; |
203 void *visit(derived_datatype_identifier_c *symbol) {return (void *)symbol->value;}; |
209 // Should not be necessary, as datatype declarations currently use an identifier_c for their name! |
|
210 // Only references to the datatype (when declaring variable, for ex., will use poutype_identifier_c |
|
211 void *visit(derived_datatype_identifier_c *symbol) {return (void *)symbol->value;}; |
|
212 // Should not be necessary, as FB declarations currently use an identifier_c for their name! |
|
213 // Only references to the FB (when declaring variable, for ex., will use poutype_identifier_c |
|
214 void *visit( poutype_identifier_c *symbol) {return (void *)symbol->value;}; |
204 |
215 |
205 /***********************************/ |
216 /***********************************/ |
206 /* B 1.3.1 - Elementary Data Types */ |
217 /* B 1.3.1 - Elementary Data Types */ |
207 /***********************************/ |
218 /***********************************/ |
208 void *visit(time_type_name_c *symbol) {return (void *)"TIME"; }; |
219 void *visit(time_type_name_c *symbol) {return (void *)"TIME"; }; |
275 * All anotations in the symbol->anotations_map[] are considered a stage4 construct. In the above example, |
286 * All anotations in the symbol->anotations_map[] are considered a stage4 construct. In the above example, |
276 * That anotation is specific to the generate_c stage4 code, and must therefore NOT be referenced |
287 * That anotation is specific to the generate_c stage4 code, and must therefore NOT be referenced |
277 * in the absyntax_utils code, as this last code should be independent of the stage4 version! |
288 * in the absyntax_utils code, as this last code should be independent of the stage4 version! |
278 */ |
289 */ |
279 |
290 |
|
291 /***********************/ |
|
292 /* B 1.5.1 - Functions */ |
|
293 /***********************/ |
|
294 /* Functions are not really datatypes, but we include it here as it helps in printing out error messages! */ |
|
295 /* Currently this is needed only by remove_forward_depencies_c::print_circ_error() */ |
|
296 /* FUNCTION derived_function_name ':' elementary_type_name io_OR_function_var_declarations_list function_body END_FUNCTION */ |
|
297 void *visit( function_declaration_c *symbol) {return symbol->derived_function_name->accept(*this);} |
280 /*****************************/ |
298 /*****************************/ |
281 /* B 1.5.2 - Function Blocks */ |
299 /* B 1.5.2 - Function Blocks */ |
282 /*****************************/ |
300 /*****************************/ |
283 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
301 /* FUNCTION_BLOCK derived_function_block_name io_OR_other_var_declarations function_block_body END_FUNCTION_BLOCK */ |
284 void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name->accept(*this);} |
302 void *visit(function_block_declaration_c *symbol) {return symbol->fblock_name->accept(*this);} |
|
303 /**********************/ |
|
304 /* B 1.5.3 - Programs */ |
|
305 /**********************/ |
|
306 /* PROGRAM program_type_name program_var_declarations_list function_block_body END_PROGRAM */ |
|
307 void *visit( program_declaration_c *symbol) {return symbol->program_type_name->accept(*this);} |
285 }; |
308 }; |
286 |
309 |
287 get_datatype_id_str_c *get_datatype_id_str_c::singleton = NULL; |
310 get_datatype_id_str_c *get_datatype_id_str_c::singleton = NULL; |
288 |
311 |
289 |
312 |