Uses of Interface
org.antlr.v4.runtime.Token
Packages that use Token
Package
Description
-
Uses of Token in org.antlr.v4.runtime
Classes in org.antlr.v4.runtime with type parameters of type TokenModifier and TypeInterfaceDescriptioninterface
TokenFactory<Symbol extends Token>
The default mechanism for creating tokens.class
UnbufferedTokenStream<T extends Token>
Subinterfaces of Token in org.antlr.v4.runtimeClasses in org.antlr.v4.runtime that implement TokenFields in org.antlr.v4.runtime declared as TokenModifier and TypeFieldDescriptionLexer._token
The goal of all lexer rules/methods is to create a token object.protected Token
ListTokenSource.eofToken
This field caches the EOF token for the token source.protected Token
UnbufferedTokenStream.lastToken
This is theLT(-1)
token for the current position.protected Token
UnbufferedTokenStream.lastTokenBufferStart
ParserRuleContext.start
For debugging/tracing purposes, we want to track all of the nodes in the ATN traversed by the parser for a particular rule.ParserRuleContext.stop
For debugging/tracing purposes, we want to track all of the nodes in the ATN traversed by the parser for a particular rule.protected Token[]
UnbufferedTokenStream.tokens
A moving window buffer of the data being scanned.Fields in org.antlr.v4.runtime with type parameters of type TokenModifier and TypeFieldDescriptionBufferedTokenStream.tokens
A collection of all tokens fetched from the token source.ListTokenSource.tokens
The wrapped collection ofToken
objects to return.Methods in org.antlr.v4.runtime that return TokenModifier and TypeMethodDescriptionParser.consume()
Consume and return the current symbol.Lexer.emit()
The standard method called to automatically emit a token at the outermost lexical rule.Lexer.emitEOF()
BufferedTokenStream.get
(int i) TokenStream.get
(int index) Gets theToken
at the specifiedindex
in the stream.UnbufferedTokenStream.get
(int i) Parser.getCurrentToken()
Match needs to return the current input symbol, which gets put into the label for the associated token ref; e.g., x=ID.protected Token
DefaultErrorStrategy.getMissingSymbol
(Parser recognizer) Conjure up a missing token during error recovery.RecognitionException.getOffendingToken()
ParserRuleContext.getStart()
Get the initial token in this context.NoViableAltException.getStartToken()
ParserRuleContext.getStop()
Get the final token in this context.Lexer.getToken()
Override if emitting multiple tokens.protected Token
BufferedTokenStream.LB
(int k) protected Token
CommonTokenStream.LB
(int k) BufferedTokenStream.LT
(int k) CommonTokenStream.LT
(int k) TokenStream.LT
(int k) UnbufferedTokenStream.LT
(int i) Parser.match
(int ttype) Match current input symbol againstttype
.Parser.matchWildcard()
Match current input symbol as a wildcard.Lexer.nextToken()
Return a token from this source; i.e., match a token on the char stream.ListTokenSource.nextToken()
Return aToken
object from your input stream (usually aCharStream
).TokenSource.nextToken()
Return aToken
object from your input stream (usually aCharStream
).ANTLRErrorStrategy.recoverInline
(Parser recognizer) This method is called when an unexpected symbol is encountered during an inline match operation, such asParser.match(int)
.BailErrorStrategy.recoverInline
(Parser recognizer) Make sure we don't attempt to recover inline; if the parser successfully recovers, it won't throw an exception.DefaultErrorStrategy.recoverInline
(Parser recognizer) This method is called when an unexpected symbol is encountered during an inline match operation, such asParser.match(int)
.protected Token
ParserInterpreter.recoverInline()
protected Token
DefaultErrorStrategy.singleTokenDeletion
(Parser recognizer) This method implements the single-token deletion inline error recovery strategy.Methods in org.antlr.v4.runtime that return types with arguments of type TokenModifier and TypeMethodDescriptionBufferedTokenStream.filterForChannel
(int from, int to, int channel) BufferedTokenStream.get
(int start, int stop) Get all tokens from start..stop inclusivelyLexer.getAllTokens()
Return a list of all Token objects in input char stream.BufferedTokenStream.getHiddenTokensToLeft
(int tokenIndex) Collect all hidden tokens (any off-default channel) to the left of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.BufferedTokenStream.getHiddenTokensToLeft
(int tokenIndex, int channel) Collect all tokens on specified channel to the left of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL.BufferedTokenStream.getHiddenTokensToRight
(int tokenIndex) Collect all hidden tokens (any off-default channel) to the right of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or EOF.BufferedTokenStream.getHiddenTokensToRight
(int tokenIndex, int channel) Collect all tokens on specified channel to the right of the current token up until we see a token on DEFAULT_TOKEN_CHANNEL or EOF.TokenFactory
<? extends Token> Lexer.getTokenFactory()
BufferedTokenStream.getTokens()
BufferedTokenStream.getTokens
(int start, int stop) BufferedTokenStream.getTokens
(int start, int stop, int ttype) Given a start and stop index, return a List of all tokens in the token type BitSet.Methods in org.antlr.v4.runtime with parameters of type TokenModifier and TypeMethodDescriptionprotected void
Deprecated.ParserRuleContext.addErrorNode
(Token badToken) Deprecated.Parser.createErrorNode
(ParserRuleContext parent, Token t) How to create an error node, given a token, associated with a parent.Parser.createTerminalNode
(ParserRuleContext parent, Token t) How to create a token leaf node associated with a parent.void
void
void
void
By default does not support multiple emits per nextToken invocation for efficiency reasons.protected String
DefaultErrorStrategy.getSymbolText
(Token symbol) protected int
DefaultErrorStrategy.getSymbolType
(Token symbol) Return the text of all tokens in this stream betweenstart
andstop
(inclusive).protected String
DefaultErrorStrategy.getTokenErrorDisplay
(Token t) How should a token be displayed in an error message? The default is to display just the text, but during development you might want to have a lot of information spit out.Recognizer.getTokenErrorDisplay
(Token t) Deprecated.This method is not called by the ANTLR 4 Runtime.void
TokenStreamRewriter.insertAfter
(String programName, Token t, Object text) void
TokenStreamRewriter.insertAfter
(Token t, Object text) void
TokenStreamRewriter.insertBefore
(String programName, Token t, Object text) void
TokenStreamRewriter.insertBefore
(Token t, Object text) void
Parser.notifyErrorListeners
(Token offendingToken, String msg, RecognitionException e) void
void
void
protected final void
RecognitionException.setOffendingToken
(Token offendingToken) void
Constructors in org.antlr.v4.runtime with parameters of type TokenModifierConstructorDescriptionCommonToken
(Token oldToken) Constructs a newCommonToken
as a copy of anotherToken
.NoViableAltException
(Parser recognizer, TokenStream input, Token startToken, Token offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx) Constructor parameters in org.antlr.v4.runtime with type arguments of type TokenModifierConstructorDescriptionListTokenSource
(List<? extends Token> tokens) Constructs a newListTokenSource
instance from the specified collection ofToken
objects.ListTokenSource
(List<? extends Token> tokens, String sourceName) Constructs a newListTokenSource
instance from the specified collection ofToken
objects and source name. -
Uses of Token in org.antlr.v4.runtime.tree
Fields in org.antlr.v4.runtime.tree declared as TokenMethods in org.antlr.v4.runtime.tree that return TokenModifier and TypeMethodDescriptionTerminalNodeImpl.getPayload()
TerminalNode.getSymbol()
TerminalNodeImpl.getSymbol()
Constructors in org.antlr.v4.runtime.tree with parameters of type Token -
Uses of Token in org.antlr.v4.runtime.tree.pattern
Classes in org.antlr.v4.runtime.tree.pattern that implement TokenModifier and TypeClassDescriptionclass
AToken
object representing an entire subtree matched by a parser rule; e.g.,<expr>
.class
AToken
object representing a token of a particular type; e.g.,<ID>
.Methods in org.antlr.v4.runtime.tree.pattern that return types with arguments of type Token -
Uses of Token in org.antlr.v4.runtime.tree.xpath
Methods in org.antlr.v4.runtime.tree.xpath with parameters of type TokenModifier and TypeMethodDescriptionprotected XPathElement
XPath.getXPathElement
(Token wordToken, boolean anywhere) Convert word like*
orID
orexpr
to a path element. -
Uses of Token in org.antlr.v4.tool
Methods in org.antlr.v4.tool that return TokenModifier and TypeMethodDescriptionGrammarParserInterpreter.BailButConsumeErrorStrategy.recoverInline
(Parser recognizer)