Package foundry.veil.lib.anarres.cpp
Class Token
java.lang.Object
foundry.veil.lib.anarres.cpp.Token
A Preprocessor token.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the column at which this token started.int
getLine()
Returns the line at which this token started.getText()
Returns the original or generated text of this token.static @NotNull String
getTokenName
(int type) Returns the descriptive name of the given token type.int
getType()
Returns the semantic type of this token.getValue()
Returns the semantic value of this token.toString()
Returns a description of this token, for debugging purposes.
-
Field Details
-
AND_EQ
public static final int AND_EQ- See Also:
-
ARROW
public static final int ARROW- See Also:
-
CHARACTER
public static final int CHARACTER- See Also:
-
CCOMMENT
public static final int CCOMMENT- See Also:
-
CPPCOMMENT
public static final int CPPCOMMENT- See Also:
-
DEC
public static final int DEC- See Also:
-
DIV_EQ
public static final int DIV_EQ- See Also:
-
ELLIPSIS
public static final int ELLIPSIS- See Also:
-
EOF
public static final int EOF- See Also:
-
EQ
public static final int EQ- See Also:
-
GE
public static final int GE- See Also:
-
HASH
public static final int HASH- See Also:
-
HEADER
public static final int HEADER- See Also:
-
IDENTIFIER
public static final int IDENTIFIER- See Also:
-
INC
public static final int INC- See Also:
-
NUMBER
public static final int NUMBER- See Also:
-
LAND
public static final int LAND- See Also:
-
LAND_EQ
public static final int LAND_EQ- See Also:
-
LE
public static final int LE- See Also:
-
LITERAL
public static final int LITERAL- See Also:
-
LOR
public static final int LOR- See Also:
-
LOR_EQ
public static final int LOR_EQ- See Also:
-
LSH
public static final int LSH- See Also:
-
LSH_EQ
public static final int LSH_EQ- See Also:
-
MOD_EQ
public static final int MOD_EQ- See Also:
-
MULT_EQ
public static final int MULT_EQ- See Also:
-
NE
public static final int NE- See Also:
-
NL
public static final int NL- See Also:
-
OR_EQ
public static final int OR_EQ- See Also:
-
PASTE
public static final int PASTE- See Also:
-
PLUS_EQ
public static final int PLUS_EQ- See Also:
-
RANGE
public static final int RANGE- See Also:
-
RSH
public static final int RSH- See Also:
-
RSH_EQ
public static final int RSH_EQ- See Also:
-
SQSTRING
public static final int SQSTRING- See Also:
-
STRING
public static final int STRING- See Also:
-
SUB_EQ
public static final int SUB_EQ- See Also:
-
WHITESPACE
public static final int WHITESPACE- See Also:
-
XOR_EQ
public static final int XOR_EQ- See Also:
-
M_ARG
public static final int M_ARG- See Also:
-
M_PASTE
public static final int M_PASTE- See Also:
-
M_STRING
public static final int M_STRING- See Also:
-
P_LINE
public static final int P_LINE- See Also:
-
INVALID
public static final int INVALID- See Also:
-
-
Constructor Details
-
Token
-
Token
-
-
Method Details
-
getType
public int getType()Returns the semantic type of this token.- Returns:
- the semantic type of this token.
- See Also:
-
getLine
public int getLine()Returns the line at which this token started.Lines are numbered from 1.
- Returns:
- the line at which this token started.
- See Also:
-
getColumn
public int getColumn()Returns the column at which this token started.Columns are numbered from 0.
- Returns:
- the column at which this token started.
- See Also:
-
getText
Returns the original or generated text of this token.This is distinct from the semantic value of the token.
- Returns:
- the original or generated text of this token.
- See Also:
-
getValue
Returns the semantic value of this token.For strings, this is the parsed String. For integers, this is an Integer object. For other token types, as appropriate.
- Returns:
- the semantic value of this token, or null.
- See Also:
-
toString
Returns a description of this token, for debugging purposes. -
getTokenName
Returns the descriptive name of the given token type.This is mostly used for stringification and debugging.
- Parameters:
type
- The type constant from this class to name.- Returns:
- the descriptive name of the given token type.
- See Also:
-