stage4/generate_c/search_base_type.cc
changeset 98 d0cdf1d00b74
parent 70 e1f0ebd2d9ec
child 123 a9b4af71cfa4
--- a/stage4/generate_c/search_base_type.cc	Sat Nov 17 10:08:38 2007 +0100
+++ b/stage4/generate_c/search_base_type.cc	Thu Dec 06 18:01:58 2007 +0100
@@ -38,9 +38,11 @@
 class search_base_type_c: public null_visitor_c {
   private:
     symbol_c *current_type_name;
+    bool is_subrange;
 
   public:
     search_base_type_c(void) {current_type_name = NULL;}
+    bool base_is_subrange() {return this->is_subrange;}
 
   public:
     void *visit(identifier_c *type_name) {
@@ -53,6 +55,11 @@
 
       return type_decl->accept(*this);
     }
+    
+    void *explore_type(symbol_c* type_decl) {
+      this->is_subrange = false;
+      return type_decl->accept(*this);
+    }
 
 /***********************************/
 /* B 1.3.1 - Elementary Data Types */
@@ -100,6 +107,7 @@
 
 /* subrange_specification ASSIGN signed_integer */
     void *visit(subrange_spec_init_c *symbol) {
+      this->is_subrange = true;
       return symbol->subrange_specification->accept(*this);
     }
 
@@ -148,7 +156,7 @@
 /* ARRAY '[' array_subrange_list ']' OF non_generic_type_name */
     void *visit(array_specification_c *symbol)	{
       if (NULL == this->current_type_name) ERROR;
-      return (void *)this->current_type_name;
+      return symbol->non_generic_type_name->accept(*this);
     }
 
 /* helper symbol for array_specification */