Uses of Interface
org.antlr.runtime.Token
-
Packages that use Token Package Description org.antlr.runtime org.antlr.runtime.debug org.antlr.runtime.tree -
-
Uses of Token in org.antlr.runtime
Classes in org.antlr.runtime that implement Token Modifier and Type Class Description classClassicTokenA Token object like we'd use in ANTLR 2.x; has an actual string created and associated with this object.classCommonTokenFields in org.antlr.runtime declared as Token Modifier and Type Field Description static TokenToken. INVALID_TOKENstatic 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.TokenParserRuleReturnScope. startTokenParserRuleReturnScope. stopTokenRecognitionException. tokenThe current Token when an error occurred.TokenRecognizerSharedState. tokenThe goal of all lexer rules/methods is to create a token object.Fields in org.antlr.runtime with type parameters of type Token Modifier and Type Field Description protected List<Token>BufferedTokenStream. tokensRecord every single token pulled from the source so we can reproduce chunks of it later.protected List<Token>LegacyCommonTokenStream. tokensRecord every single token pulled from the source so we can reproduce chunks of it later.Methods in org.antlr.runtime that return Token Modifier and Type Method Description TokenLexer. emit()The standard method called to automatically emit a token at the outermost lexical rule.TokenBufferedTokenStream. get(int i)TokenLegacyCommonTokenStream. get(int i)Return absolute token i; ignore which channel the tokens are on; that is, count all tokens not just on-channel tokens.TokenTokenStream. get(int i)Get a token at an absolute index i; 0..n-1.TokenUnbufferedTokenStream. get(int i)TokenLexer. getEOFToken()Returns the EOF token (default), if you need to return a custom token instead override this method.TokenUnwantedTokenException. getUnexpectedToken()protected TokenBufferedTokenStream. LB(int k)protected TokenCommonTokenStream. LB(int k)protected TokenLegacyCommonTokenStream. LB(int k)Look backwards k tokens on-channel tokensTokenBufferedTokenStream. LT(int k)TokenCommonTokenStream. LT(int k)TokenLegacyCommonTokenStream. LT(int k)Get the ith token from the current position 1..n where k=1 is the first symbol of lookahead.TokenTokenStream. LT(int k)Get Token at current input pointer + i ahead where i=1 is next Token.TokenUnbufferedTokenStream. nextElement()TokenLexer. nextToken()Return a token from this source; i.e., match a token on the char stream.TokenTokenSource. nextToken()Return a Token object from your input stream (usually a CharStream).Methods in org.antlr.runtime that return types with arguments of type Token Modifier and Type Method Description List<? extends Token>BufferedTokenStream. get(int start, int stop)Get all tokens from start..stop inclusivelyList<? extends Token>LegacyCommonTokenStream. get(int start, int stop)Get all tokens from start..stop inclusivelyList<? extends Token>BufferedTokenStream. getTokens()List<? extends Token>BufferedTokenStream. getTokens(int start, int stop)List<? extends Token>BufferedTokenStream. getTokens(int start, int stop, int ttype)List<? extends Token>BufferedTokenStream. getTokens(int start, int stop, List<Integer> types)List<? extends Token>BufferedTokenStream. getTokens(int start, int stop, BitSet types)Given a start and stop index, return a List of all tokens in the token type BitSet.List<? extends Token>LegacyCommonTokenStream. getTokens()List<? extends Token>LegacyCommonTokenStream. getTokens(int start, int stop)List<? extends Token>LegacyCommonTokenStream. getTokens(int start, int stop, int ttype)List<? extends Token>LegacyCommonTokenStream. getTokens(int start, int stop, List<Integer> types)List<? extends Token>LegacyCommonTokenStream. getTokens(int start, int stop, BitSet types)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 Token Modifier and Type Method Description voidTokenRewriteStream. delete(String programName, Token from, Token to)voidTokenRewriteStream. delete(Token indexT)voidTokenRewriteStream. delete(Token from, Token to)voidLexer. emit(Token token)Currently does not support multiple emits per nextToken invocation for efficiency reasons.StringBaseRecognizer. 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)booleanUnbufferedTokenStream. isEOF(Token o)voidTokenRewriteStream. replace(String programName, Token from, Token to, Object text)voidTokenRewriteStream. replace(Token indexT, Object text)voidTokenRewriteStream. replace(Token from, Token to, Object text)StringBufferedTokenStream. toString(Token start, Token stop)StringLegacyCommonTokenStream. toString(Token start, Token stop)StringTokenStream. toString(Token start, Token stop)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.StringUnbufferedTokenStream. toString(Token start, Token stop)Method parameters in org.antlr.runtime with type arguments of type Token Modifier and Type Method Description List<String>BaseRecognizer. toStrings(List<? extends Token> tokens)A convenience method for use most often with template rewrites.Constructors in org.antlr.runtime with parameters of type Token Constructor Description ClassicToken(Token oldToken)CommonToken(Token oldToken) -
Uses of Token in org.antlr.runtime.debug
Classes in org.antlr.runtime.debug that implement Token Modifier and Type Class Description static classRemoteDebugEventSocketListener.ProxyTokenFields in org.antlr.runtime.debug declared as Token Modifier and Type Field Description protected TokenProfiler. lastRealTokenTouchedInDecisionMethods in org.antlr.runtime.debug that return Token Modifier and Type Method Description TokenDebugTokenStream. get(int i)TokenDebugTreeAdaptor. getToken(Object t)TokenDebugTokenStream. LT(int i)Methods in org.antlr.runtime.debug with parameters of type Token Modifier and Type Method Description voidDebugTreeAdaptor. addChild(Object t, Token child)ObjectDebugTreeAdaptor. 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)ObjectDebugTreeAdaptor. create(int tokenType, Token fromToken)ObjectDebugTreeAdaptor. create(int tokenType, Token fromToken, String text)ObjectDebugTreeAdaptor. create(Token payload)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)ObjectDebugTreeAdaptor. errorNode(TokenStream input, Token start, Token stop, RecognitionException e)voidBlankDebugEventListener. LT(int i, Token t)voidDebugEventHub. LT(int index, Token t)voidDebugEventListener. LT(int i, Token t)Somebody (anybody) looked ahead.voidDebugEventRepeater. LT(int i, Token t)voidDebugEventSocketProxy. LT(int i, Token t)voidProfiler. LT(int i, Token t)Track refs to lookahead if in a fixed/nonfixed decision.protected StringDebugEventSocketProxy. serializeToken(Token t)voidDebugTreeAdaptor. setTokenBoundaries(Object t, Token startToken, Token stopToken)StringDebugTokenStream. toString(Token start, Token stop) -
Uses of Token in org.antlr.runtime.tree
Fields in org.antlr.runtime.tree declared as Token Modifier and Type Field Description TokenCommonErrorNode. startTokenCommonErrorNode. stopTokenCommonTree. tokenA single token is the payloadFields in org.antlr.runtime.tree with type parameters of type Token Modifier and Type Field Description List<Token>ParseTree. hiddenTokensMethods in org.antlr.runtime.tree that return Token Modifier and Type Method Description abstract 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.TokenCommonTreeAdaptor. createToken(int tokenType, String text)Tell me how to create a token for use with imaginary token nodes.TokenCommonTreeAdaptor. createToken(Token fromToken)Tell me how to create a token for use with imaginary token nodes.TokenCommonTree. getToken()TokenCommonTreeAdaptor. getToken(Object t)What is the Token associated with this node? If you are not using CommonTree, then you must override this in your own adaptor.TokenTreeAdaptor. getToken(Object t)Return the token object from which this node was created.TokenRewriteRuleTokenStream. nextToken()Methods in org.antlr.runtime.tree with parameters of type Token Modifier and Type Method Description ObjectBaseTreeAdaptor. becomeRoot(Token newRoot, Object oldRoot)ObjectTreeAdaptor. becomeRoot(Token newRoot, Object oldRoot)Create a node for newRoot make it the root of oldRoot.ObjectBaseTreeAdaptor. create(int tokenType, Token fromToken)ObjectBaseTreeAdaptor. create(int tokenType, Token fromToken, String text)ObjectCommonTreeAdaptor. create(Token payload)ObjectTreeAdaptor. create(int tokenType, Token fromToken)Create a new node derived from a token, with a new token type.ObjectTreeAdaptor. create(int tokenType, Token fromToken, String text)Same as create(tokenType,fromToken) except set the text too.ObjectTreeAdaptor. create(Token payload)Create a tree node from Token object; for CommonTree type trees, then the token just becomes the payload.ObjectTreeWizard.TreePatternTreeAdaptor. create(Token payload)abstract TokenBaseTreeAdaptor. createToken(Token fromToken)Tell me how to create a token for use with imaginary token nodes.TokenCommonTreeAdaptor. createToken(Token fromToken)Tell me how to create a token for use with imaginary token nodes.ObjectBaseTreeAdaptor. errorNode(TokenStream input, Token start, Token stop, RecognitionException e)create tree node that holds the start and stop tokens associated with an error.ObjectTreeAdaptor. 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 Token Constructor Description CommonErrorNode(TokenStream input, Token start, Token stop, RecognitionException e)CommonTree(Token t)TreePattern(Token payload)WildcardTreePattern(Token payload)
-