diff options
author | paltherr <paltherr@epfl.ch> | 2004-03-25 09:57:51 +0000 |
---|---|---|
committer | paltherr <paltherr@epfl.ch> | 2004-03-25 09:57:51 +0000 |
commit | 9c2488391850128d247da2f7707f98af63168132 (patch) | |
tree | e0a095ed385b1a84e7ecedac9185407288750c7f | |
parent | 360cd14a72d9aa990c5a13a543552e07ba6b88bc (diff) | |
download | scala-9c2488391850128d247da2f7707f98af63168132.tar.gz scala-9c2488391850128d247da2f7707f98af63168132.tar.bz2 scala-9c2488391850128d247da2f7707f98af63168132.zip |
- Added a methods newAccessMethod and isAccessM...
- Added a methods newAccessMethod and isAccessMethod
-rw-r--r-- | sources/scalac/symtab/Symbol.java | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/sources/scalac/symtab/Symbol.java b/sources/scalac/symtab/Symbol.java index 1bdbf21bab..2df07c6b34 100644 --- a/sources/scalac/symtab/Symbol.java +++ b/sources/scalac/symtab/Symbol.java @@ -39,12 +39,13 @@ public abstract class Symbol implements Modifiers, Kinds { // Attribues ------------------------------------------------------------- - public static final int IS_ROOT = 0x00000001; - public static final int IS_ANONYMOUS = 0x00000002; - public static final int IS_LABEL = 0x00000010; - public static final int IS_THISTYPE = 0x20000000; - public static final int IS_LOCALDUMMY = 0x40000000; - public static final int IS_COMPOUND = 0x80000000; + public static final int IS_ROOT = 0x00000001; + public static final int IS_ANONYMOUS = 0x00000002; + public static final int IS_LABEL = 0x00000010; + public static final int IS_ACCESSMETHOD = 0x00000100; + public static final int IS_THISTYPE = 0x20000000; + public static final int IS_LOCALDUMMY = 0x40000000; + public static final int IS_COMPOUND = 0x80000000; // Fields ------------------------------------------------------------- @@ -108,6 +109,13 @@ public abstract class Symbol implements Modifiers, Kinds { return newTerm(pos, flags, name, 0); } + /** Creates a new access method owned by this symbol. */ + public final Symbol newAccessMethod(int pos, Name name) { + assert isClass(): Debug.show(this); + int flags = PRIVATE | FINAL | SYNTHETIC; + return newTerm(pos, flags, name, IS_ACCESSMETHOD); + } + /** Creates a new function owned by this symbol. */ public final Symbol newFunction(int pos, int flags, Name name) { assert isTerm(): Debug.show(this); @@ -724,6 +732,12 @@ public abstract class Symbol implements Modifiers, Kinds { return (flags & ACCESSOR) != 0; } + /** Does this symbol denote an access method? (a method to access + * private of protected members from inner classes) */ + public final boolean isAccessMethod() { + return (attrs & IS_ACCESSMETHOD) != 0; + } + /** Is this symbol locally defined? I.e. not a member of a class or module */ public final boolean isLocal() { return owner.kind == VAL && |