D - the type of source document identifierspublic static class LLJavaLexer.Token<D> extends Object implements Parser.Token<D,LLJavaLexer.TokenType>
| Modifier and Type | Method and Description |
|---|---|
@Opt Location<D> |
getLocation()
Returns the source location of this token.
|
String |
getText()
Returns the text content of this token.
|
LLJavaLexer.TokenType |
getType()
Returns the type of this token.
|
String |
toString() |
LLJavaLexer.Token<D> |
withText(String text)
Creates a variant of this token with the given text.
|
LLJavaLexer.Token<D> |
withType(LLJavaLexer.TokenType type)
Creates a variant of this token with the given type.
|
@Opt public @Opt Location<D> getLocation()
The default implementation returns null.
getLocation in interface Parser.Token<D,LLJavaLexer.TokenType>null if
not available.public String getText()
getText in interface Parser.Token<D,LLJavaLexer.TokenType>public LLJavaLexer.TokenType getType()
getType in interface Parser.Token<D,LLJavaLexer.TokenType>public LLJavaLexer.Token<D> withType(LLJavaLexer.TokenType type)
type - a token typepublic LLJavaLexer.Token<D> withText(String text)
text - a token textsee also the complete user documentation .