Author: raja
Date: 2005-07-14 08:43:03 -0400 (Thu, 14 Jul 2005)
New Revision: 47302

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/decl.cs
   trunk/mcs/mcs/ecore.cs
   trunk/mcs/mcs/namespace.cs
   trunk/mcs/mcs/tree.cs
Log:
* ecore.cs (IAlias): Remove.
* decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
that implement the interface.
* namespace.cs (Namespace): Likewise.
(Namespace.declspaces): Renamed from 'defined_names'.
(Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
DeclSpace instead of an IAlias.
* tree.cs (Tree.AddDecl): Update.


Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-07-14 12:27:56 UTC (rev 47301)
+++ trunk/mcs/mcs/ChangeLog     2005-07-14 12:43:03 UTC (rev 47302)
@@ -1,3 +1,14 @@
+2005-07-14  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * ecore.cs (IAlias): Remove.
+       * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
+       that implement the interface.
+       * namespace.cs (Namespace): Likewise.
+       (Namespace.declspaces): Renamed from 'defined_names'.
+       (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
+       DeclSpace instead of an IAlias.
+       * tree.cs (Tree.AddDecl): Update.
+
 2005-07-12  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * statement.cs (Block.Flags); Remove HasVarargs.

Modified: trunk/mcs/mcs/decl.cs
===================================================================
--- trunk/mcs/mcs/decl.cs       2005-07-14 12:27:56 UTC (rev 47301)
+++ trunk/mcs/mcs/decl.cs       2005-07-14 12:43:03 UTC (rev 47302)
@@ -503,7 +503,7 @@
        ///   provides the common foundation for managing those name
        ///   spaces.
        /// </remarks>
-       public abstract class DeclSpace : MemberCore, IAlias {
+       public abstract class DeclSpace : MemberCore {
                /// <summary>
                ///   This points to the actual definition that is being
                ///   created with System.Reflection.Emit
@@ -588,9 +588,7 @@
                // why there is a non-obvious test down here.
                //
                public bool IsTopLevel {
-                       get {
-                               return (Parent != null && Parent.Parent == 
null);
-                       }
+                       get { return (Parent != null && Parent.Parent == null); 
}
                }
 
                public virtual void CloseType ()
@@ -615,9 +613,7 @@
                }
 
                protected virtual TypeAttributes TypeAttr {
-                       get {
-                               return CodeGen.Module.DefaultCharSetType;
-                       }
+                       get { return CodeGen.Module.DefaultCharSetType; }
                }
 
                /// <remarks>
@@ -993,26 +989,8 @@
                }
 
                public override string[] ValidAttributeTargets {
-                       get {
-                               return attribute_targets;
-                       }
+                       get { return attribute_targets; }
                }
-
-               bool IAlias.IsType {
-                       get { return true; }
-               }
-
-               string IAlias.Name {
-                       get { return Name; }
-               }
-
-               TypeExpr IAlias.ResolveAsType (EmitContext ec)
-               {
-                       if (TypeBuilder == null)
-                               throw new InvalidOperationException ();
-
-                       return new TypeExpression (TypeBuilder, Location);
-               }
        }
 
        /// <summary>

Modified: trunk/mcs/mcs/ecore.cs
===================================================================
--- trunk/mcs/mcs/ecore.cs      2005-07-14 12:27:56 UTC (rev 47301)
+++ trunk/mcs/mcs/ecore.cs      2005-07-14 12:43:03 UTC (rev 47302)
@@ -91,23 +91,6 @@
        }
 
        /// <summary>
-       ///   We are either a namespace or a type.
-       ///   If we're a type, `IsType' is true and we may use `Type' to get
-       ///   a TypeExpr representing that type.
-       /// </summary>
-       public interface IAlias {
-               bool IsType {
-                       get;
-               }
-
-               string Name {
-                       get;
-               }
-
-               TypeExpr ResolveAsType (EmitContext ec);
-       }
-
-       /// <summary>
        ///   This interface is implemented by variables
        /// </summary>
        public interface IVariable {
@@ -127,19 +110,12 @@
                protected Location loc;
                
                public Type Type {
-                       get {
-                               return type;
-                       }
-
-                       set {
-                               type = value;
-                       }
+                       get { return type; }
+                       set { type = value; }
                }
 
                public Location Location {
-                       get {
-                               return loc;
-                       }
+                       get { return loc; }
                }
 
                /// <summary>

Modified: trunk/mcs/mcs/namespace.cs
===================================================================
--- trunk/mcs/mcs/namespace.cs  2005-07-14 12:27:56 UTC (rev 47301)
+++ trunk/mcs/mcs/namespace.cs  2005-07-14 12:43:03 UTC (rev 47302)
@@ -17,7 +17,7 @@
        ///   This is an Expression to allow it to be referenced in the
        ///   compiler parse/intermediate tree during name resolution.
        /// </summary>
-       public class Namespace : FullNamedExpression, IAlias {
+       public class Namespace : FullNamedExpression {
                static ArrayList all_namespaces;
                static Hashtable namespaces_map;
                
@@ -25,7 +25,7 @@
                string fullname;
                ArrayList entries;
                Hashtable namespaces;
-               Hashtable defined_names;
+               Hashtable declspaces;
                Hashtable cached_types;
 
                public readonly MemberName MemberName;
@@ -75,7 +75,7 @@
 
                        entries = new ArrayList ();
                        namespaces = new Hashtable ();
-                       defined_names = new Hashtable ();
+                       declspaces = new Hashtable ();
                        cached_types = new Hashtable ();
 
                        all_namespaces.Add (this);
@@ -146,7 +146,7 @@
                                te = (TypeExpr) cached_types [name];
                        } else {
                                Type t;
-                               DeclSpace tdecl = defined_names [name] as 
DeclSpace;
+                               DeclSpace tdecl = declspaces [name] as 
DeclSpace;
                                if (tdecl != null) {
                                        //
                                        // Note that this is not:
@@ -178,30 +178,24 @@
                        entries.Add (entry);
                }
 
-               public void DefineName (string name, IAlias o)
+               public void AddDeclSpace (string name, DeclSpace ds)
                {
-                       defined_names.Add (name, o);
+                       declspaces.Add (name, ds);
                }
 
                static public ArrayList UserDefinedNamespaces {
-                       get {
-                               return all_namespaces;
-                       }
+                       get { return all_namespaces; }
                }
 
                /// <summary>
                ///   The qualified name of the current namespace
                /// </summary>
                public string Name {
-                       get {
-                               return fullname;
-                       }
+                       get { return fullname; }
                }
 
                public override string FullName {
-                       get {
-                               return fullname;
-                       }
+                       get { return fullname; }
                }
 
                /// <summary>
@@ -209,9 +203,7 @@
                ///   the current namespace declaration
                /// </summary>
                public Namespace Parent {
-                       get {
-                               return parent;
-                       }
+                       get { return parent; }
                }
 
                public static void DefineNamespaces (SymbolWriter symwriter)
@@ -241,15 +233,6 @@
                        else
                                return String.Format ("Namespace ({0})", Name);
                }
-
-               bool IAlias.IsType {
-                       get { return false; }
-               }
-
-               TypeExpr IAlias.ResolveAsType (EmitContext ec)
-               {
-                       throw new InvalidOperationException ();
-               }
        }
 
        public class NamespaceEntry

Modified: trunk/mcs/mcs/tree.cs
===================================================================
--- trunk/mcs/mcs/tree.cs       2005-07-14 12:27:56 UTC (rev 47301)
+++ trunk/mcs/mcs/tree.cs       2005-07-14 12:43:03 UTC (rev 47302)
@@ -69,16 +69,14 @@
                        decls.Add (name, ds);
 
                        if (ds.Parent == Types)
-                               ns.DefineName (name.Basename, ds);
+                               ns.AddDeclSpace (name.Basename, ds);
                }
                
                //
                // FIXME: Why are we using Types?
                //
                 public TypeContainer Types {
-                        get {
-                                return root_types;
-                        }
+                        get { return root_types; }
                 }
 
                public DeclSpace GetDecl (MemberName name)
@@ -87,9 +85,7 @@
                }
 
                public Hashtable AllDecls {
-                       get {
-                               return decls;
-                       }
+                       get { return decls; }
                }
        }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to