Package com.jogamp.gluegen.jcpp
Class Token
- java.lang.Object
-
- com.jogamp.gluegen.jcpp.Token
-
public final class Token extends Object
A Preprocessor token.- See Also:
Preprocessor
-
-
Field Summary
Fields Modifier and Type Field Description static intAND_EQstatic intARROWstatic intCCOMMENTstatic intCHARACTERstatic intCPPCOMMENTstatic intDECstatic intDIV_EQstatic intELLIPSISstatic intEOFstatic intEQstatic intGEstatic intHASHstatic intHEADERstatic intIDENTIFIERstatic intINCstatic intINVALIDstatic intLANDstatic intLAND_EQstatic intLEstatic intLITERALstatic intLORstatic intLOR_EQstatic intLSHstatic intLSH_EQstatic intM_ARGstatic intM_PASTEstatic intM_STRINGstatic intMOD_EQstatic intMULT_EQstatic intNEstatic intNLstatic intNUMBERstatic intOR_EQstatic intP_LINEstatic intPASTEstatic intPLUS_EQstatic intRANGEstatic intRSHstatic intRSH_EQstatic intSQSTRINGstatic intSTRINGstatic intSUB_EQstatic intWHITESPACEstatic intXOR_EQ
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumn()Returns the column at which this token started.intgetLine()Returns the line at which this token started.StringgetText()Returns the original or generated text of this token.static StringgetTokenName(int type)Returns the descriptive name of the given token type.intgetType()Returns the semantic type of this token.ObjectgetValue()Returns the semantic value of this token.StringtoString()Returns a description of this token, for debugging purposes.
-
-
-
Field Detail
-
AND_EQ
public static final int AND_EQ
- See Also:
- Constant Field Values
-
ARROW
public static final int ARROW
- See Also:
- Constant Field Values
-
CHARACTER
public static final int CHARACTER
- See Also:
- Constant Field Values
-
CCOMMENT
public static final int CCOMMENT
- See Also:
- Constant Field Values
-
CPPCOMMENT
public static final int CPPCOMMENT
- See Also:
- Constant Field Values
-
DEC
public static final int DEC
- See Also:
- Constant Field Values
-
DIV_EQ
public static final int DIV_EQ
- See Also:
- Constant Field Values
-
ELLIPSIS
public static final int ELLIPSIS
- See Also:
- Constant Field Values
-
EOF
public static final int EOF
- See Also:
- Constant Field Values
-
EQ
public static final int EQ
- See Also:
- Constant Field Values
-
GE
public static final int GE
- See Also:
- Constant Field Values
-
HASH
public static final int HASH
- See Also:
- Constant Field Values
-
HEADER
public static final int HEADER
- See Also:
- Constant Field Values
-
IDENTIFIER
public static final int IDENTIFIER
- See Also:
- Constant Field Values
-
INC
public static final int INC
- See Also:
- Constant Field Values
-
NUMBER
public static final int NUMBER
- See Also:
- Constant Field Values
-
LAND
public static final int LAND
- See Also:
- Constant Field Values
-
LAND_EQ
public static final int LAND_EQ
- See Also:
- Constant Field Values
-
LE
public static final int LE
- See Also:
- Constant Field Values
-
LITERAL
public static final int LITERAL
- See Also:
- Constant Field Values
-
LOR
public static final int LOR
- See Also:
- Constant Field Values
-
LOR_EQ
public static final int LOR_EQ
- See Also:
- Constant Field Values
-
LSH
public static final int LSH
- See Also:
- Constant Field Values
-
LSH_EQ
public static final int LSH_EQ
- See Also:
- Constant Field Values
-
MOD_EQ
public static final int MOD_EQ
- See Also:
- Constant Field Values
-
MULT_EQ
public static final int MULT_EQ
- See Also:
- Constant Field Values
-
NE
public static final int NE
- See Also:
- Constant Field Values
-
NL
public static final int NL
- See Also:
- Constant Field Values
-
OR_EQ
public static final int OR_EQ
- See Also:
- Constant Field Values
-
PASTE
public static final int PASTE
- See Also:
- Constant Field Values
-
PLUS_EQ
public static final int PLUS_EQ
- See Also:
- Constant Field Values
-
RANGE
public static final int RANGE
- See Also:
- Constant Field Values
-
RSH
public static final int RSH
- See Also:
- Constant Field Values
-
RSH_EQ
public static final int RSH_EQ
- See Also:
- Constant Field Values
-
SQSTRING
public static final int SQSTRING
- See Also:
- Constant Field Values
-
STRING
public static final int STRING
- See Also:
- Constant Field Values
-
SUB_EQ
public static final int SUB_EQ
- See Also:
- Constant Field Values
-
WHITESPACE
public static final int WHITESPACE
- See Also:
- Constant Field Values
-
XOR_EQ
public static final int XOR_EQ
- See Also:
- Constant Field Values
-
M_ARG
public static final int M_ARG
- See Also:
- Constant Field Values
-
M_PASTE
public static final int M_PASTE
- See Also:
- Constant Field Values
-
M_STRING
public static final int M_STRING
- See Also:
- Constant Field Values
-
P_LINE
public static final int P_LINE
- See Also:
- Constant Field Values
-
INVALID
public static final int INVALID
- See Also:
- Constant Field Values
-
-
Method Detail
-
getType
public int getType()
Returns the semantic type of this token.- Returns:
- the semantic type of this token.
- See Also:
getTokenName(int)
-
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:
LexerSource.getLine()
-
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:
LexerSource.getColumn()
-
getText
public String 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()
-
getValue
public Object 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:
getText()
-
toString
public String toString()
Returns a description of this token, for debugging purposes.
-
getTokenName
@Nonnull public static String getTokenName(int type)
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:
getType()
-
-