--- a/stage4/generate_c/generate_c_typedecl.cc Sun Jul 20 21:57:10 2014 +0100
+++ b/stage4/generate_c/generate_c_typedecl.cc Mon Jul 21 10:39:46 2014 +0100
@@ -629,6 +629,15 @@
/* ref_spec: REF_TO (non_generic_type_name | function_block_type_name) */
// SYM_REF1(ref_spec_c, type_name)
void *visit(ref_spec_c *symbol) {
+ int implicit_id_count = symbol->anotations_map.count("generate_c_annotaton__implicit_type_id");
+ if (implicit_id_count > 1) ERROR;
+ if (implicit_id_count == 1) {
+ /* this is part of an implicitly declared datatype (i.e. inside a variable decaration), for which an equivalent C datatype
+ * has already been defined. So, we simly print out the id of that C datatpe...
+ */
+ symbol->anotations_map["generate_c_annotaton__implicit_type_id"]->accept(*basedecl);
+ return NULL;
+ }
return symbol->type_name->accept(*this);
}
@@ -637,6 +646,15 @@
/* NOTE: ref_initialization may be NULL!! */
// SYM_REF2(ref_spec_init_c, ref_spec, ref_initialization)
void *visit(ref_spec_init_c *symbol) {
+ int implicit_id_count = symbol->anotations_map.count("generate_c_annotaton__implicit_type_id");
+ if (implicit_id_count > 1) ERROR;
+ if (implicit_id_count == 1) {
+ /* this is part of an implicitly declared datatype (i.e. inside a variable decaration), for which an equivalent C datatype
+ * has already been defined. So, we simly print out the id of that C datatpe...
+ */
+ symbol->anotations_map["generate_c_annotaton__implicit_type_id"]->accept(*basedecl);
+ return NULL;
+ }
return symbol->ref_spec->accept(*this);
}