- All Superinterfaces:
org.antlr.runtime.TokenSource
public interface CivlcTokenSource
extends org.antlr.runtime.TokenSource
Extends ANTLR's TokenSource interface by adding some additional
functionality: getting the macro information, and methods to get the number
of tokens produced so far and to retrieve any token produced so far by index.
Here are the methods specified in ANTLR's TokenSource interface:
* Return a Token object from your input stream (usually a CharStream).
* Do not fail/return upon lexing error; keep chewing on the characters
* until you get a good one; errors are not passed through to the parser.
public Token nextToken();
* Where are you getting tokens from? normally the implication will simply
* ask lexers input stream.
public String getSourceName();
-
Method Summary
Modifier and TypeMethodDescriptionintThe number of tokens produced by this token source so far.Returns the set of source files that were used to create this token source.getToken(int index) Returns the index-th token produced (indexed from 0).Returns the token factory used by this token source object.Methods inherited from interface org.antlr.runtime.TokenSource
getSourceName, nextToken
-
Method Details
-
getNumTokens
int getNumTokens()The number of tokens produced by this token source so far.- Returns:
- number of tokens produced at this time
-
getToken
Returns the index-th token produced (indexed from 0).- Parameters:
index- an integer in the range [0,numTokens-1]- Returns:
- the index-th token produced
-
getTokenFactory
TokenFactory getTokenFactory()Returns the token factory used by this token source object.- Returns:
- the token factory used by this token source object
-
getIndexer
FileIndexer getIndexer() -
getSourceFiles
Collection<SourceFile> getSourceFiles()Returns the set of source files that were used to create this token source.- Returns:
- the set of source files
-