Uses of Interface
org.antlr.runtime.Token
Packages that use Token
Package
Description
-
Uses of Token in org.antlr.grammar.v3
Methods in org.antlr.grammar.v3 that return Token -
Uses of Token in org.antlr.runtime
Classes in org.antlr.runtime that implement TokenModifier and TypeClassDescriptionclass
A Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object.class
Fields in org.antlr.runtime declared as TokenModifier and TypeFieldDescriptionstatic final Token
Token.EOF_TOKEN
static final Token
Token.INVALID_TOKEN
static final Token
Token.SKIP_TOKEN
In 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.start
ParserRuleReturnScope.stop
RecognitionException.token
The current Token when an error occurred.RecognizerSharedState.token
The goal of all lexer rules/methods is to create a token object.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.CommonTokenStream.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.UnwantedTokenException.getUnexpectedToken()
protected Token
CommonTokenStream.LB
(int k) Look backwards k tokens on-channel tokensCommonTokenStream.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.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 with parameters of type TokenModifier and TypeMethodDescriptionvoid
void
void
void
Currently 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.void
TokenRewriteStream.insertAfter
(String programName, Token t, Object text) void
TokenRewriteStream.insertAfter
(Token t, Object text) void
TokenRewriteStream.insertBefore
(String programName, Token t, Object text) void
TokenRewriteStream.insertBefore
(Token t, Object text) void
void
void
Because 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.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 TokenMethods in org.antlr.runtime.debug that return TokenMethods in org.antlr.runtime.debug with parameters of type TokenModifier and TypeMethodDescriptionvoid
DebugTreeAdaptor.becomeRoot
(Token newRoot, Object oldRoot) void
BlankDebugEventListener.consumeHiddenToken
(Token token) void
DebugEventHub.consumeHiddenToken
(Token token) void
DebugEventListener.consumeHiddenToken
(Token t) An off-channel input token was consumed.void
DebugEventRepeater.consumeHiddenToken
(Token token) void
DebugEventSocketProxy.consumeHiddenToken
(Token t) void
ParseTreeBuilder.consumeHiddenToken
(Token token) void
Profiler.consumeHiddenToken
(Token token) void
BlankDebugEventListener.consumeToken
(Token token) void
DebugEventHub.consumeToken
(Token token) void
DebugEventListener.consumeToken
(Token t) An input token was consumed; matched by any kind of element.void
DebugEventRepeater.consumeToken
(Token token) void
DebugEventSocketProxy.consumeToken
(Token t) void
ParseTreeBuilder.consumeToken
(Token token) void
Profiler.consumeToken
(Token token) void
BlankDebugEventListener.createNode
(Object node, Token token) void
DebugEventHub.createNode
(Object node, Token token) void
DebugEventListener.createNode
(Object node, Token token) Announce a new node built from an existing token.void
DebugEventRepeater.createNode
(Object node, Token token) void
DebugEventSocketProxy.createNode
(Object node, Token token) void
TraceDebugEventListener.createNode
(Object node, Token token) DebugTreeAdaptor.errorNode
(TokenStream input, Token start, Token stop, RecognitionException e) void
void
void
Somebody (anybody) looked ahead.void
void
void
Track refs to lookahead if in a fixed/nonfixed decision.protected String
DebugEventSocketProxy.serializeToken
(Token t) void
DebugTreeAdaptor.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.start
CommonErrorNode.stop
CommonTree.token
A single token is the payloadMethods in org.antlr.runtime.tree that return TokenModifier and TypeMethodDescriptionabstract Token
BaseTreeAdaptor.createToken
(int tokenType, String text) Tell me how to create a token for use with imaginary token nodes.abstract Token
BaseTreeAdaptor.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 Token
BaseTreeAdaptor.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.void
CommonTreeAdaptor.setTokenBoundaries
(Object t, Token startToken, Token stopToken) Track start/stop token for subtree root created for a rule.void
TreeAdaptor.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
Methods in org.antlr.tool that return Token