|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.iu.cnets.klatsch.parser.Token
class Token
This class represents a single token within the Klatsch language.
Nested Class Summary | |
---|---|
static class |
Token.Type
|
Field Summary | |
---|---|
(package private) static java.lang.String[] |
KEYWORDS
any strings defined here are automatically recognized as language keywords |
(package private) Token.Type |
type
|
(package private) java.lang.Object |
value
|
Constructor Summary | |
---|---|
Token(Token.Type type)
Initializes a new token of a type that does not take a value. |
|
Token(Token.Type type,
java.lang.Object value)
Initializes a new token of a type that does take a value. |
Method Summary | |
---|---|
(package private) boolean |
isKeyword(java.lang.String keyword)
Determine whether this token is a keyword of the given type. |
(package private) boolean |
isType(Token.Type type)
Determine whether this token is of the given type. |
(package private) double |
numberValue()
Returns the numeric value of the token. |
(package private) java.lang.String |
stringValue()
Returns the string value of the token. |
(package private) java.lang.String |
toDebugString()
Renders this token as a debugging string that identifies the type of the token. |
java.lang.String |
toString()
Renders this token as a string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
static final java.lang.String[] KEYWORDS
Token.Type type
java.lang.Object value
Constructor Detail |
---|
Token(Token.Type type)
type
- the type of the tokenpublic Token(Token.Type type, java.lang.Object value)
type
- the type of the tokenvalue
- the value of the tokenMethod Detail |
---|
double numberValue()
boolean isKeyword(java.lang.String keyword)
keyword
- the keyword to check
boolean isType(Token.Type type)
type
- the type to check
java.lang.String stringValue()
java.lang.String toDebugString()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |