absyntax_utils/spec_init_separator.cc
changeset 945 477393b00f95
parent 912 252a69d6ecae
child 958 7474d2cd1d6e
--- a/absyntax_utils/spec_init_separator.cc	Sat Oct 25 13:20:10 2014 +0100
+++ b/absyntax_utils/spec_init_separator.cc	Sun Nov 16 12:54:10 2014 +0000
@@ -74,7 +74,22 @@
 /* B 1.1 - Letters, digits and identifiers */
 /*******************************************/
 // SYM_TOKEN(identifier_c)
-void *spec_init_sperator_c::visit(identifier_c *symbol) {
+/* visitor for identifier_c is necessary because spec_init_sperator_c will be called to analyse PROGRAM identfiers,
+ * which are still transformed into identfier_c, instead of a derived_datatype_identifier_c
+ */
+void *spec_init_sperator_c::visit(                 identifier_c *symbol) {
+  TRACE("spec_init_sperator_c::identifier_c");
+  switch (search_what) {
+    /* if we ever get called sith a simple identifier_c, then it must be a previously declared type... */
+    case search_spec: return symbol;
+    case search_init: return NULL;
+  }
+  ERROR; /* should never occur */
+  return NULL;
+  }
+  
+  
+void *spec_init_sperator_c::visit(derived_datatype_identifier_c *symbol) {
   TRACE("spec_init_sperator_c::identifier_c");
   switch (search_what) {
     /* if we ever get called sith a simple identifier_c, then it must be a previously declared type... */