2004-07-20 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Thu, 22 Jul 2004 13:51:24 +0000 (13:51 -0000)
committerMartin Baulig <martin@novell.com>
Thu, 22 Jul 2004 13:51:24 +0000 (13:51 -0000)
* tree.cs (Tree.RecordNamespace): Removed.
(Tree.Namespaces): Removed.

* rootcontext.cs (RootContext.IsNamespace): Removed.

* cs-parser.jay (namespace_declaration): Just create a new
NamespaceEntry here.

svn path=/trunk/mcs/; revision=31374

mcs/mcs/ChangeLog
mcs/mcs/cs-parser.jay
mcs/mcs/rootcontext.cs
mcs/mcs/tree.cs

index c54665068d1dcebd952cb72ec16a3a00661c2d80..775ebef347e4b37779900d24d64aae6e9b1ce381 100755 (executable)
@@ -1,3 +1,13 @@
+2004-07-20  Martin Baulig  <martin@ximian.com>
+
+       * tree.cs (Tree.RecordNamespace): Removed.
+       (Tree.Namespaces): Removed.
+
+       * rootcontext.cs (RootContext.IsNamespace): Removed.
+
+       * cs-parser.jay (namespace_declaration): Just create a new
+       NamespaceEntry here.
+
 2004-07-20  Martin Baulig  <martin@ximian.com>
 
        * statement.cs (ExceptionStatement): New abstract class.  This is
index 200432ec3e9657dbab2f12b4f4a6f6e5219164ce..a0be585c97023dc99e67eb566e6d080c9e05ce1a 100755 (executable)
@@ -350,8 +350,9 @@ namespace_declaration
                        Report.Error_T (134, lexer.Location);
                }
 
-               current_namespace = RootContext.Tree.RecordNamespace (current_namespace, file, $3.ToString (), lexer.Location);
-       } 
+               current_namespace = new NamespaceEntry (
+                       current_namespace, file, $3.ToString (), lexer.Location);
+         } 
          namespace_body opt_semicolon
          { 
                current_namespace = current_namespace.Parent;
index 6dc4f56f04496cf86548a1226e4225bc237f72d3..b7437dace2cde5b28039477695dbfff2cfcd9217 100755 (executable)
@@ -581,20 +581,6 @@ namespace Mono.CSharp {
                        return LookupType (tc, name, true, loc);
                }
 
-               static public bool IsNamespace (string name)
-               {
-                       Namespace ns;
-
-                       if (tree.Namespaces != null){
-                               ns = (Namespace) tree.Namespaces [name];
-
-                               if (ns != null)
-                                       return true;
-                       }
-
-                       return false;
-               }
-
                static void Report1530 (Location loc)
                {
                        Report.Error (1530, loc, "Keyword new not allowed for namespace elements");
index 0267f451d94ab24e91fff3a28be510f8f824d250..d5bace59d6dba7102638339e57e443a1149c1435 100755 (executable)
@@ -33,11 +33,6 @@ namespace Mono.CSharp
        public class Tree {
                TypeContainer root_types;
 
-               // <summary>
-               //  Keeps track of namespaces defined in the source code
-               // </summary>
-               Hashtable namespaces;
-
                // <summary>
                //   Keeps track of all the types definied (classes, structs, ifaces, enums)
                // </summary>
@@ -48,7 +43,6 @@ namespace Mono.CSharp
                        root_types = new TypeContainer ();
 
                        decls = new Hashtable ();
-                       namespaces = new Hashtable ();
                }
 
                DoubleHash decl_ns_name = new DoubleHash ();
@@ -85,26 +79,6 @@ namespace Mono.CSharp
                        return (DeclSpace) res;
                }
                
-               public NamespaceEntry RecordNamespace (NamespaceEntry parent, SourceFile file, string name, Location loc)
-               {
-                       NamespaceEntry ns = new NamespaceEntry (parent, file, name, loc);
-
-                       if (namespaces.Contains (file)){
-                               Hashtable ns_ns = (Hashtable) namespaces [file];
-
-                               if (ns_ns.Contains (ns.FullName))
-                                       return (NamespaceEntry) ns_ns [ns.FullName];
-                               ns_ns.Add (ns.FullName, ns);
-                       } else {
-                               Hashtable new_table = new Hashtable ();
-                               namespaces [file] = new_table;
-
-                               new_table.Add (ns.FullName, ns);
-                       }
-
-                       return ns;
-               }
-
                //
                // FIXME: Why are we using Types?
                //
@@ -119,11 +93,5 @@ namespace Mono.CSharp
                                return decls;
                        }
                }
-
-               public Hashtable Namespaces {
-                       get {
-                               return namespaces;
-                       }
-               }
        }
 }