com.sun.tools.javac.parser
public class: Keywords [javadoc |
source]
java.lang.Object
com.sun.tools.javac.parser.Keywords
Map from Name to Token and Token to String.
This is NOT part of any supported API.
If you write code that depends on this, you do so at your own risk.
This code and its internal interfaces are subject to change or
deletion without notice.
Field Summary |
---|
public static final Key<Keywords> | keywordsKey | |
Constructor: |
protected Keywords(Context context) {
context.put(keywordsKey, this);
names = Names.instance(context);
for (Token t : Token.values()) {
if (t.name != null)
enterKeyword(t.name, t);
else
tokenName[t.ordinal()] = null;
}
key = new Token[maxKey+1];
for (int i = 0; i < = maxKey; i++) key[i] = IDENTIFIER;
for (Token t : Token.values()) {
if (t.name != null)
key[tokenName[t.ordinal()].getIndex()] = t;
}
}
|
Method from com.sun.tools.javac.parser.Keywords Summary: |
---|
instance, key |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.sun.tools.javac.parser.Keywords Detail: |
public static Keywords instance(Context context) {
Keywords instance = context.get(keywordsKey);
if (instance == null)
instance = new Keywords(context);
return instance;
}
|
public Token key(Name name) {
return (name.getIndex() > maxKey) ? IDENTIFIER : key[name.getIndex()];
}
|