public class LiteralBaseToken extends LeafBaseToken
Modifier and Type | Field and Description |
---|---|
static int |
BOOLEANLITERAL
The numberic code for a boolean literal
|
static int |
DOUBLELITERAL
The numberic code for a double literal
|
static int |
FLOATLITERAL
The numberic code for a float literal
|
static int |
INTEGERLITERAL
The numberic code for a integer literal
|
static int |
LONGLITERAL
The numberic code for a long literal
|
static int |
NULLLITERAL
The numberic code for a boolean literal
|
static int |
SHORTLITERAL
The numberic code for a short literal
|
static int |
STRINGLITERAL
The numberic code for a string literal
|
Constructor and Description |
---|
LiteralBaseToken(int nType,
String s)
Construct a new LiteralBaseToken with the given parameters.
|
Modifier and Type | Method and Description |
---|---|
static LiteralBaseToken |
createBoolean(String s)
Create new LiteralBaseToken representing a Boolean with given value
|
static LiteralBaseToken |
createDouble(String s)
Create new LiteralBaseToken representing a Double with given value
|
static LiteralBaseToken |
createFloat(String s)
Create new LiteralBaseToken representing a float with given value
|
static LiteralBaseToken |
createInteger(String s)
Create new LiteralBaseToken representing a Integer with given value
|
static LiteralBaseToken |
createLong(String s)
Create new LiteralBaseToken representing a Long with given value
|
static LiteralBaseToken |
createNull(String s)
Create new LiteralBaseToken representing a null with given value
|
static LiteralBaseToken |
createShort(String s)
Create new LiteralBaseToken representing a Integer with given value
|
static LiteralBaseToken |
createString(String s)
Create new LiteralBaseToken representing a String with given value
|
int |
getType()
Obtain the type code of this token.
|
String |
getValue()
Return the string representation of this LeafBaseToken.
|
boolean |
isLiteral()
Answer whether this token represents a literal.
|
String |
toString()
Return a human-readable description for this token.
|
isCompound, isLeaf, match
getSimpleName, isIdentifier, isNest, isOperator, isPunctuation, match
public static final int STRINGLITERAL
public static final int INTEGERLITERAL
public static final int LONGLITERAL
public static final int FLOATLITERAL
public static final int DOUBLELITERAL
public static final int BOOLEANLITERAL
public static final int NULLLITERAL
public static final int SHORTLITERAL
public LiteralBaseToken(int nType, String s)
nType
- the type code for the tokens
- the string representation for the tokenpublic String getValue()
getValue
in class LeafBaseToken
public boolean isLiteral()
public int getType()
public String toString()
toString
in class LeafBaseToken
public static LiteralBaseToken createString(String s)
s
- the text of the literalpublic static LiteralBaseToken createShort(String s)
s
- the text of the literalpublic static LiteralBaseToken createInteger(String s)
s
- the text of the literalpublic static LiteralBaseToken createLong(String s)
s
- the text of the literalpublic static LiteralBaseToken createFloat(String s)
s
- the text of the literalpublic static LiteralBaseToken createDouble(String s)
s
- the text of the literalpublic static LiteralBaseToken createBoolean(String s)
s
- the text of the literalpublic static LiteralBaseToken createNull(String s)
s
- the text of the literal