Package eu.bandm.tools.d2d2.parser2
Class Lexer.Token<D>
java.lang.Object
eu.bandm.tools.d2d2.parser2.Lexer.Token<D>
- All Implemented Interfaces:
eu.bandm.tools.ramus.runtime2.Parser.Token<D,Lexer.TokenType>
public static class Lexer.Token<D>
extends Object
implements eu.bandm.tools.ramus.runtime2.Parser.Token<D,Lexer.TokenType>
Immutable tokens.
-
Method Summary
Modifier and TypeMethodDescriptionReturns the source location of this token.getText()Returns the text content of this token.getType()Returns the type of this token.toString()withPrefix(String prefix) Creates a variant of this token with the given text prefix.Creates a variant of this token with the given text.withType(Lexer.TokenType type) Creates a variant of this token with the given type.
-
Method Details
-
getLocation
Description copied from interface:eu.bandm.tools.ramus.runtime2.Parser.TokenReturns the source location of this token.The default implementation returns
null.- Specified by:
getLocationin interfaceeu.bandm.tools.ramus.runtime2.Parser.Token<D,Lexer.TokenType> - Returns:
- the source location of this token, or
nullif not available.
-
getText
Description copied from interface:eu.bandm.tools.ramus.runtime2.Parser.TokenReturns the text content of this token.- Specified by:
getTextin interfaceeu.bandm.tools.ramus.runtime2.Parser.Token<D,Lexer.TokenType> - Returns:
- the text content of this token.
-
getType
Description copied from interface:eu.bandm.tools.ramus.runtime2.Parser.TokenReturns the type of this token.- Specified by:
getTypein interfaceeu.bandm.tools.ramus.runtime2.Parser.Token<D,Lexer.TokenType> - Returns:
- the type of this token.
-
withType
Creates a variant of this token with the given type. -
withText
Creates a variant of this token with the given text. -
withPrefix
Creates a variant of this token with the given text prefix. -
toString
-