Package eu.bandm.tools.lljava.parser
Class LLJavaLexer.Token<D>
java.lang.Object
eu.bandm.tools.lljava.parser.LLJavaLexer.Token<D>
- Type Parameters:
D
- the type of source document identifiers
- All Implemented Interfaces:
Parser.Token<D,
LLJavaLexer.TokenType>
- Enclosing class:
- LLJavaLexer<D>
public static class LLJavaLexer.Token<D>
extends Object
implements Parser.Token<D,LLJavaLexer.TokenType>
Immutable LLJava tokens.
-
Method Summary
-
Method Details
-
getLocation
Returns the source location of this token.The default implementation returns
null
.- Specified by:
getLocation
in interfaceParser.Token<D,
LLJavaLexer.TokenType> - Returns:
- the source location of this token, or
null
if not available.
-
getText
Returns the text content of this token.- Specified by:
getText
in interfaceParser.Token<D,
LLJavaLexer.TokenType> - Returns:
- the text content of this token.
-
getType
Returns the type of this token.- Specified by:
getType
in interfaceParser.Token<D,
LLJavaLexer.TokenType> - Returns:
- the type of this token.
-
withType
Creates a variant of this token with the given type.- Parameters:
type
- a token type- Returns:
- a new token with the same location and text, and the new type.
-
withText
Creates a variant of this token with the given text.- Parameters:
text
- a token text- Returns:
- a new token with the same location and type, and the new text.
-
toString
-