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 TypeInterfaceDescriptioninterfaceTokenFactory<Symbol extends Token>The default mechanism for creating tokens.classUnbufferedTokenStream<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._tokenThe goal of all lexer rules/methods is to create a token object.protected TokenListTokenSource.eofTokenThis field caches the EOF token for the token source.protected TokenUnbufferedTokenStream.lastTokenThis is theLT(-1)token for the current position.protected TokenUnbufferedTokenStream.lastTokenBufferStartprivate TokenRecognitionException.offendingTokenThe currentTokenwhen an error occurred.ParserRuleContext.startFor debugging/tracing purposes, we want to track all of the nodes in the ATN traversed by the parser for a particular rule.private final TokenNoViableAltException.startTokenThe token object at the start index; the input stream might not be buffering tokens so get a reference to it.ParserRuleContext.stopFor 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.tokensA moving window buffer of the data being scanned.Fields in org.antlr.v4.runtime with type parameters of type TokenModifier and TypeFieldDescriptionBufferedTokenStream.tokensA collection of all tokens fetched from the token source.ListTokenSource.tokensThe wrapped collection ofTokenobjects 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 theTokenat the specifiedindexin 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 TokenDefaultErrorStrategy.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 TokenBufferedTokenStream.LB(int k) protected TokenCommonTokenStream.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 aTokenobject from your input stream (usually aCharStream).TokenSource.nextToken()Return aTokenobject 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 TokenParserInterpreter.recoverInline()protected TokenDefaultErrorStrategy.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 voidDeprecated.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.voidvoidvoidvoidBy default does not support multiple emits per nextToken invocation for efficiency reasons.protected StringDefaultErrorStrategy.getSymbolText(Token symbol) protected intDefaultErrorStrategy.getSymbolType(Token symbol) Return the text of all tokens in this stream betweenstartandstop(inclusive).protected StringDefaultErrorStrategy.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.voidTokenStreamRewriter.insertAfter(String programName, Token t, Object text) voidTokenStreamRewriter.insertAfter(Token t, Object text) voidTokenStreamRewriter.insertBefore(String programName, Token t, Object text) voidTokenStreamRewriter.insertBefore(Token t, Object text) voidParser.notifyErrorListeners(Token offendingToken, String msg, RecognitionException e) voidvoidvoidprotected final voidRecognitionException.setOffendingToken(Token offendingToken) voidConstructors in org.antlr.v4.runtime with parameters of type TokenModifierConstructorDescriptionCommonToken(Token oldToken) Constructs a newCommonTokenas 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 newListTokenSourceinstance from the specified collection ofTokenobjects.ListTokenSource(List<? extends Token> tokens, String sourceName) Constructs a newListTokenSourceinstance from the specified collection ofTokenobjects 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 TypeClassDescriptionclassATokenobject representing an entire subtree matched by a parser rule; e.g.,<expr>.classATokenobject 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 that return TokenMethods in org.antlr.v4.runtime.tree.xpath with parameters of type TokenModifier and TypeMethodDescriptionprotected XPathElementXPath.getXPathElement(Token wordToken, boolean anywhere) Convert word like*orIDorexprto 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)