summaryrefslogtreecommitdiff
path: root/sources/scalac/symtab/Symbol.java
diff options
context:
space:
mode:
authorpaltherr <paltherr@epfl.ch>2004-02-29 20:08:40 +0000
committerpaltherr <paltherr@epfl.ch>2004-02-29 20:08:40 +0000
commit00478513fc3a30fb152ba1934274031ad03d28be (patch)
tree665ffadc07fdde606a7ae857f63fcf0b3808cfa6 /sources/scalac/symtab/Symbol.java
parent810d03161421b48964bb0a81339a02c9644eb7a8 (diff)
downloadscala-00478513fc3a30fb152ba1934274031ad03d28be.tar.gz
scala-00478513fc3a30fb152ba1934274031ad03d28be.tar.bz2
scala-00478513fc3a30fb152ba1934274031ad03d28be.zip
- Removed Definitions.ROOT
- Changed ROOT_CLASS into a non-module class.
Diffstat (limited to 'sources/scalac/symtab/Symbol.java')
-rw-r--r--sources/scalac/symtab/Symbol.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java
index 321b49459a..b074145bf6 100644
--- a/sources/scalac/symtab/Symbol.java
+++ b/sources/scalac/symtab/Symbol.java
@@ -37,6 +37,10 @@ public abstract class Symbol implements Modifiers, Kinds {
/** The absent symbol */
public static final NoSymbol NONE = new NoSymbol();
+// Attribues -------------------------------------------------------------
+
+ public static final int IS_ROOT = 0x00000001;
+
// Fields -------------------------------------------------------------
/** The unique identifier generator */
@@ -365,7 +369,8 @@ public abstract class Symbol implements Modifiers, Kinds {
/** Does this symbol denote the root class or root module?
*/
public final boolean isRoot() {
- return this.moduleClass() == Global.instance.definitions.ROOT_CLASS;
+ return (attrs & IS_ROOT) != 0;
+ //return this.moduleClass() == Global.instance.definitions.ROOT_CLASS;
}
/** Does this symbol denote something loaded from a Java class? */
@@ -1741,6 +1746,21 @@ public class ClassSymbol extends TypeSymbol {
this.setInfo(parser);
}
+ /** Creates the root class. */
+ public static Symbol newRootClass(PackageParser parser) {
+ int pos = Position.NOPOS;
+ Name name = Names.ROOT.toTypeName();
+ Symbol owner = Symbol.NONE;
+ int flags = JAVA | PACKAGE | FINAL | SYNTHETIC;
+ int attrs = IS_ROOT;
+ Symbol clasz = new ClassSymbol(pos, name, owner, flags, attrs);
+ clasz.setInfo(parser);
+ clasz.primaryConstructor().setInfo(
+ Type.MethodType(Symbol.EMPTY_ARRAY, clasz.typeConstructor()));
+ // Type.MethodType(Symbol.EMPTY_ARRAY, clasz.thisType()));
+ return clasz;
+ }
+
/** Return a fresh symbol with the same fields as this one.
*/
public Symbol cloneSymbol(Symbol owner) {