Uses of Interface
org.antlr.runtime.Token
Packages that use Token
Package
Description
-
Uses of Token in org.antlr.analysis
Fields in org.antlr.analysis with type parameters of type TokenModifier and TypeFieldDescriptionDecisionProbe.stateToIncompletelyCoveredAltsMapTracks alts insufficiently covered.Methods in org.antlr.analysis that return types with arguments of type TokenModifier and TypeMethodDescriptionMachineProbe.getGrammarLocationsForInputSequence(List<Set<NFAState>> nfaStates, List<IntSet> labels) Given an alternative associated with a DFA state, return the list of tokens (from grammar) associated with path through NFA following the labels sequence.DecisionProbe.getIncompletelyCoveredAlts(DFAState d) Return a list of alts whose predicate context was insufficient to resolve a nondeterminism for state d.Method parameters in org.antlr.analysis with type arguments of type Token -
Uses of Token in org.antlr.codegen
Methods in org.antlr.codegen with parameters of type TokenModifier and TypeMethodDescriptionvoidCodeGenerator.issueInvalidAttributeError(String x, String y, Rule enclosingRule, Token actionToken, int outerAltNum) voidCodeGenerator.issueInvalidAttributeError(String x, Rule enclosingRule, Token actionToken, int outerAltNum) voidCodeGenerator.issueInvalidScopeError(String x, String y, Rule enclosingRule, Token actionToken, int outerAltNum) Python3Target.postProcessAction(List<Object> chunks, Token actionToken) PythonTarget.postProcessAction(List<Object> chunks, Token actionToken) Target.postProcessAction(List<Object> chunks, Token actionToken) Give target a chance to do some postprocessing on actions.org.stringtemplate.v4.STCodeGenerator.translateTemplateConstructor(String ruleName, int outerAltNum, Token actionToken, String templateActionText) Given a template constructor action like %foo(a={...}) in an action, translate it to the appropriate template constructor from the templateLib. -
Uses of Token in org.antlr.grammar.v3
Fields in org.antlr.grammar.v3 declared as TokenModifier and TypeFieldDescription(package private) TokenActionAnalysis.actionToken(package private) TokenActionTranslator.actionTokenANTLRParser.GrammarASTErrorNode.startANTLRParser.GrammarASTErrorNode.stopMethods in org.antlr.grammar.v3 that return TokenModifier and TypeMethodDescriptionprivate final TokenANTLRParser.LT(int k) ActionAnalysis.nextToken()ActionTranslator.nextToken()ANTLRLexer.nextToken()Methods in org.antlr.grammar.v3 with parameters of type TokenModifier and TypeMethodDescriptionANTLRParser.grammar_Adaptor.errorNode(TokenStream input, Token start, Token stop, RecognitionException e) Constructors in org.antlr.grammar.v3 with parameters of type TokenModifierConstructorDescriptionActionTranslator(CodeGenerator generator, String ruleName, Token actionToken, int outerAltNum) GrammarASTErrorNode(TokenStream input, Token start, Token stop, RecognitionException e) -
Uses of Token in org.antlr.runtime
Classes in org.antlr.runtime that implement TokenModifier and TypeClassDescriptionclassA Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object.classFields in org.antlr.runtime declared as TokenModifier and TypeFieldDescriptionstatic final TokenToken.EOF_TOKENstatic final TokenToken.INVALID_TOKENstatic final TokenToken.SKIP_TOKENIn an action, a lexer rule can set token to this SKIP_TOKEN and ANTLR will avoid creating a token for this symbol and try to fetch another.ParserRuleReturnScope.startParserRuleReturnScope.stopRecognitionException.tokenThe current Token when an error occurred.RecognizerSharedState.tokenThe goal of all lexer rules/methods is to create a token object.Fields in org.antlr.runtime with type parameters of type TokenModifier and TypeFieldDescriptionBufferedTokenStream.tokensRecord every single token pulled from the source so we can reproduce chunks of it later.LegacyCommonTokenStream.tokensRecord every single token pulled from the source so we can reproduce chunks of it later.Methods in org.antlr.runtime that return TokenModifier and TypeMethodDescriptionLexer.emit()The standard method called to automatically emit a token at the outermost lexical rule.BufferedTokenStream.get(int i) LegacyCommonTokenStream.get(int i) Return absolute token i; ignore which channel the tokens are on; that is, count all tokens not just on-channel tokens.TokenStream.get(int i) Get a token at an absolute index i; 0..n-1.UnbufferedTokenStream.get(int i) Lexer.getEOFToken()Returns the EOF token (default), if you need to return a custom token instead override this method.UnwantedTokenException.getUnexpectedToken()protected TokenBufferedTokenStream.LB(int k) protected TokenCommonTokenStream.LB(int k) protected TokenLegacyCommonTokenStream.LB(int k) Look backwards k tokens on-channel tokensBufferedTokenStream.LT(int k) CommonTokenStream.LT(int k) LegacyCommonTokenStream.LT(int k) Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.TokenStream.LT(int k) Get Token at current input pointer + i ahead where i=1 is next Token.UnbufferedTokenStream.nextElement()Lexer.nextToken()Return a token from this source; i.e., match a token on the char stream.TokenSource.nextToken()Return a Token object from your input stream (usually a CharStream).Methods in org.antlr.runtime that return types with arguments of type TokenModifier and TypeMethodDescriptionBufferedTokenStream.get(int start, int stop) Get all tokens from start..stop inclusivelyLegacyCommonTokenStream.get(int start, int stop) Get all tokens from start..stop inclusivelyBufferedTokenStream.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.LegacyCommonTokenStream.getTokens()LegacyCommonTokenStream.getTokens(int start, int stop) LegacyCommonTokenStream.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.runtime with parameters of type TokenModifier and TypeMethodDescriptionvoidvoidvoidvoidCurrently does not support multiple emits per nextToken invocation for efficiency reasons.BaseRecognizer.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.voidTokenRewriteStream.insertAfter(String programName, Token t, Object text) voidTokenRewriteStream.insertAfter(Token t, Object text) voidTokenRewriteStream.insertBefore(String programName, Token t, Object text) voidTokenRewriteStream.insertBefore(Token t, Object text) booleanvoidvoidvoidBecause the user is not required to use a token with an index stored in it, we must provide a means for two token objects themselves to indicate the start/end location.Method parameters in org.antlr.runtime with type arguments of type TokenModifier and TypeMethodDescriptionA convenience method for use most often with template rewrites.Constructors in org.antlr.runtime with parameters of type Token -
Uses of Token in org.antlr.runtime.debug
Classes in org.antlr.runtime.debug that implement TokenFields in org.antlr.runtime.debug declared as TokenFields in org.antlr.runtime.debug with type parameters of type TokenMethods in org.antlr.runtime.debug that return TokenMethods in org.antlr.runtime.debug with parameters of type TokenModifier and TypeMethodDescriptionvoidDebugTreeAdaptor.becomeRoot(Token newRoot, Object oldRoot) voidBlankDebugEventListener.consumeHiddenToken(Token token) voidDebugEventHub.consumeHiddenToken(Token token) voidDebugEventListener.consumeHiddenToken(Token t) An off-channel input token was consumed.voidDebugEventRepeater.consumeHiddenToken(Token token) voidDebugEventSocketProxy.consumeHiddenToken(Token t) voidParseTreeBuilder.consumeHiddenToken(Token token) voidProfiler.consumeHiddenToken(Token token) voidBlankDebugEventListener.consumeToken(Token token) voidDebugEventHub.consumeToken(Token token) voidDebugEventListener.consumeToken(Token t) An input token was consumed; matched by any kind of element.voidDebugEventRepeater.consumeToken(Token token) voidDebugEventSocketProxy.consumeToken(Token t) voidParseTreeBuilder.consumeToken(Token token) voidProfiler.consumeToken(Token token) voidBlankDebugEventListener.createNode(Object node, Token token) voidDebugEventHub.createNode(Object node, Token token) voidDebugEventListener.createNode(Object node, Token token) Announce a new node built from an existing token.voidDebugEventRepeater.createNode(Object node, Token token) voidDebugEventSocketProxy.createNode(Object node, Token token) voidTraceDebugEventListener.createNode(Object node, Token token) DebugTreeAdaptor.errorNode(TokenStream input, Token start, Token stop, RecognitionException e) voidvoidvoidSomebody (anybody) looked ahead.voidvoidvoidTrack refs to lookahead if in a fixed/nonfixed decision.protected StringDebugEventSocketProxy.serializeToken(Token t) voidDebugTreeAdaptor.setTokenBoundaries(Object t, Token startToken, Token stopToken) -
Uses of Token in org.antlr.runtime.tree
Fields in org.antlr.runtime.tree declared as TokenModifier and TypeFieldDescriptionCommonErrorNode.startCommonErrorNode.stopCommonTree.tokenA single token is the payloadFields in org.antlr.runtime.tree with type parameters of type TokenMethods in org.antlr.runtime.tree that return TokenModifier and TypeMethodDescriptionabstract TokenBaseTreeAdaptor.createToken(int tokenType, String text) Tell me how to create a token for use with imaginary token nodes.abstract TokenBaseTreeAdaptor.createToken(Token fromToken) Tell me how to create a token for use with imaginary token nodes.CommonTreeAdaptor.createToken(int tokenType, String text) Tell me how to create a token for use with imaginary token nodes.CommonTreeAdaptor.createToken(Token fromToken) Tell me how to create a token for use with imaginary token nodes.CommonTree.getToken()What is the Token associated with this node? If you are not using CommonTree, then you must override this in your own adaptor.Return the token object from which this node was created.RewriteRuleTokenStream.nextToken()Methods in org.antlr.runtime.tree with parameters of type TokenModifier and TypeMethodDescriptionBaseTreeAdaptor.becomeRoot(Token newRoot, Object oldRoot) TreeAdaptor.becomeRoot(Token newRoot, Object oldRoot) Create a node for newRoot make it the root of oldRoot.Create a new node derived from a token, with a new token type.Same as create(tokenType,fromToken) except set the text too.Create a tree node from Token object; for CommonTree type trees, then the token just becomes the payload.abstract TokenBaseTreeAdaptor.createToken(Token fromToken) Tell me how to create a token for use with imaginary token nodes.CommonTreeAdaptor.createToken(Token fromToken) Tell me how to create a token for use with imaginary token nodes.BaseTreeAdaptor.errorNode(TokenStream input, Token start, Token stop, RecognitionException e) create tree node that holds the start and stop tokens associated with an error.TreeAdaptor.errorNode(TokenStream input, Token start, Token stop, RecognitionException e) Return a tree node representing an error.voidCommonTreeAdaptor.setTokenBoundaries(Object t, Token startToken, Token stopToken) Track start/stop token for subtree root created for a rule.voidTreeAdaptor.setTokenBoundaries(Object t, Token startToken, Token stopToken) Where are the bounds in the input token stream for this node and all children? Each rule that creates AST nodes will call this method right before returning.Constructors in org.antlr.runtime.tree with parameters of type TokenModifierConstructorDescriptionCommonErrorNode(TokenStream input, Token start, Token stop, RecognitionException e) CommonTree(Token t) TreePattern(Token payload) WildcardTreePattern(Token payload) -
Uses of Token in org.antlr.tool
Fields in org.antlr.tool declared as TokenModifier and TypeFieldDescriptionAttributeScope.derivedFromTokenThis scope is associated with which input token (for error handling)?Grammar.LabelElementPair.labelGrammarSemanticsMessage.offendingTokenMost of the time, we'll have a token such as an undefined rule ref and so this will be set.GrammarSyntaxMessage.offendingTokenMost of the time, we'll have a token and so this will be set.Fields in org.antlr.tool with type parameters of type TokenModifier and TypeFieldDescriptionGrammarInsufficientPredicatesMessage.altToLocationsGrammar.tokenIDRefsThe unique set of all token ID references in any ruleMethods in org.antlr.tool that return TokenMethods in org.antlr.tool with parameters of type TokenModifier and TypeMethodDescriptionprotected voidNameSpaceChecker.checkForLabelConflict(Rule r, Token label) Make sure a label doesn't conflict with another symbol.booleanNameSpaceChecker.checkForLabelTypeMismatch(Rule r, Token label, int type) If type of previous label differs from new label's type, that's an error.Grammar.createParameterScope(String ruleName, Token argAction) Grammar.createReturnScope(String ruleName, Token retAction) Grammar.createRuleScope(String ruleName, Token scopeAction) Grammar.defineGlobalScope(String name, Token scopeAction) protected voidGrammar.defineLabel(Rule r, Token label, GrammarAST element, int type) Define a label defined in a rule r; check the validity then ask the Rule object to actually define it.voidRule.defineLabel(Token label, GrammarAST elementRef, int type) voidGrammar.defineLexerRuleFoundInParser(Token ruleToken, GrammarAST ruleAST) voidGrammar.defineRule(Token ruleToken, String modifier, Map<String, Object> options, GrammarAST tree, GrammarAST argActionAST, int numAlts) Define a new rule.voidGrammar.defineRuleListLabel(String ruleName, Token label, GrammarAST element) voidGrammar.defineRuleRefLabel(String ruleName, Token label, GrammarAST ruleRef) voidGrammar.defineTokenListLabel(String ruleName, Token label, GrammarAST element) voidGrammar.defineTokenRefLabel(String ruleName, Token label, GrammarAST tokenRef) voidGrammar.defineWildcardTreeLabel(String ruleName, Token label, GrammarAST tokenRef) voidGrammar.defineWildcardTreeListLabel(String ruleName, Token label, GrammarAST tokenRef) LeftRecursiveRuleAnalyzer.getNamesFromArgAction(Token t) static voidErrorManager.grammarError(int msgID, Grammar g, Token token) static voidErrorManager.grammarError(int msgID, Grammar g, Token token, Object arg) static voidErrorManager.grammarError(int msgID, Grammar g, Token token, Object arg, Object arg2) static voidErrorManager.grammarWarning(int msgID, Grammar g, Token token) static voidErrorManager.grammarWarning(int msgID, Grammar g, Token token, Object arg) static voidErrorManager.grammarWarning(int msgID, Grammar g, Token token, Object arg, Object arg2) voidGrammarAST.initialize(Token token) Save the option key/value pair and process it; return the key or null if invalid option.Save the option key/value pair and process it; return the key or null if invalid option.voidGrammar.setOptions(Map<String, Object> options, Token optionsStartToken) voidRule.setOptions(Map<String, Object> options, Token optionsStartToken) voidGrammarAST.setTokenBoundaries(Token startToken, Token stopToken) Track start/stop token for subtree root created for a rule.static voidErrorManager.syntaxError(int msgID, Grammar grammar, Token token, Object arg, RecognitionException re) Method parameters in org.antlr.tool with type arguments of type TokenModifier and TypeMethodDescriptionstatic voidErrorManager.insufficientPredicates(DecisionProbe probe, DFAState d, Map<Integer, Set<Token>> altToUncoveredLocations) Constructors in org.antlr.tool with parameters of type TokenModifierConstructorDescriptionAttributeScope(String name, Token derivedFromToken) AttributeScope(Grammar grammar, String name, Token derivedFromToken) GrammarAST(Token token) GrammarSemanticsMessage(int msgID, Grammar g, Token offendingToken) GrammarSemanticsMessage(int msgID, Grammar g, Token offendingToken, Object arg) GrammarSemanticsMessage(int msgID, Grammar g, Token offendingToken, Object arg, Object arg2) GrammarSyntaxMessage(int msgID, Grammar grammar, Token offendingToken, Object arg, RecognitionException exception) GrammarSyntaxMessage(int msgID, Grammar grammar, Token offendingToken, RecognitionException exception) LabelElementPair(Token label, GrammarAST elementRef) RuleLabelScope(Rule referencedRule, Token actionToken) Constructor parameters in org.antlr.tool with type arguments of type TokenModifierConstructorDescriptionGrammarInsufficientPredicatesMessage(DecisionProbe probe, DFAState problemState, Map<Integer, Set<Token>> altToLocations)