Uses of Interface
org.antlr.v4.runtime.Token
Packages that use Token
Package
Description
-
Uses of Token in org.antlr.v4.runtime
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.private TokenBufferedTokenStream.cachedLT1CachedLT(1)/tokens.get(p)after the stream cursor is positioned.protected TokenListTokenSource.eofTokenThis field caches the EOF token for the token source.protected TokenParser.lastConsumedLast symbol actually consumed byParser.consume(Token).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 with type parameters of type TokenModifier and TypeMethodDescriptionDiagnosticErrorListener.getDecisionDescription(Parser recognizer, DFA dfa) protected final <Symbol extends Token>
voidRecognitionException.setOffendingToken(Recognizer<Symbol, ?> recognizer, Symbol offendingToken) <T extends Token>
voidBaseErrorListener.syntaxError(Recognizer<T, ?> recognizer, T offendingSymbol, int line, int charPositionInLine, String msg, RecognitionException e) Methods in org.antlr.v4.runtime that return TokenModifier and TypeMethodDescription(package private) final TokenBufferedTokenStream.cachedLT1()Visible for same-package tests.protected TokenDefaultErrorStrategy.constructToken(TokenSource tokenSource, int expectedTokenType, String tokenText, Token current) Parser.consume()Consume and return the current symbol.protected TokenConsumecurrent, which must be the currentLT(1)symbol.Generically usefulTokenFactory.create(Tuple2<? extends TokenSource, CharStream> source, int type, String text, int channel, int start, int stop, int line, int charPositionInLine) This is the method used to create tokens in the lexer and in the error handling strategy.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 i) 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 inclusively.Lexer.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 onLexer.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 onLexer.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 onLexer.DEFAULT_TOKEN_CHANNELor 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 onLexer.DEFAULT_TOKEN_CHANNELor EOF.BufferedTokenStream.getTokens()BufferedTokenStream.getTokens(int start, int stop) BufferedTokenStream.getTokens(int start, int stop, int ttype) Given a start and stop index, return aListof all tokens in the token typeBitSet.Methods in org.antlr.v4.runtime with parameters of type TokenModifier and TypeMethodDescriptionprotected voidDeprecated.ParserRuleContext.addErrorNode(Token badToken) Deprecated.protected TokenDefaultErrorStrategy.constructToken(TokenSource tokenSource, int expectedTokenType, String tokenText, Token current) protected TokenConsumecurrent, which must be the currentLT(1)symbol.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) 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) voidvoidvoidvoidConstructors in org.antlr.v4.runtime with parameters of type TokenModifierConstructorDescriptionCommonToken(Token oldToken) Constructs a newCommonTokenas a copy of anotherToken.NoViableAltException(Recognizer<Token, ?> 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.NoViableAltException(Recognizer<Token, ?> recognizer, TokenStream input, Token startToken, Token offendingToken, ATNConfigSet deadEndConfigs, ParserRuleContext ctx) ProxyParserErrorListener(Collection<? extends ANTLRErrorListener<? super Token>> delegates) RecognitionException(String message, Recognizer<Token, ?> recognizer, IntStream input, ParserRuleContext ctx) RecognitionException(Recognizer<Token, ?> recognizer, IntStream input, ParserRuleContext ctx) -
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 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.test.runtime.java.api
Methods in org.antlr.v4.test.runtime.java.api that return Token -
Uses of Token in org.antlr.v4.test.runtime.java.api.perf
Methods in org.antlr.v4.test.runtime.java.api.perf that return Token -
Uses of Token in org.antlr.v4.tool
Methods in org.antlr.v4.tool that return TokenModifier and TypeMethodDescriptionGrammarParserInterpreter.BailButConsumeErrorStrategy.recoverInline(Parser recognizer)