antlr
Class ANTLRTokdefParser

java.lang.Object
  extended byantlr.Parser
      extended byantlr.LLkParser
          extended byantlr.ANTLRTokdefParser
All Implemented Interfaces:
ANTLRTokdefParserTokenTypes

public class ANTLRTokdefParser
extends LLkParser
implements ANTLRTokdefParserTokenTypes

Simple lexer/parser for reading token definition files in support of the import/export vocab option for grammars.


Field Summary
static String[] _tokenNames
           
static BitSet _tokenSet_0
           
static BitSet _tokenSet_1
           
 
Fields inherited from class antlr.LLkParser
k
 
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
 
Fields inherited from interface antlr.ANTLRTokdefParserTokenTypes
ASSIGN, DIGIT, EOF, ESC, ID, INT, LPAREN, ML_COMMENT, NULL_TREE_LOOKAHEAD, RPAREN, SL_COMMENT, STRING, WS, XDIGIT
 
Constructor Summary
  ANTLRTokdefParser(ParserSharedInputState state)
           
  ANTLRTokdefParser(TokenBuffer tokenBuf)
           
protected ANTLRTokdefParser(TokenBuffer tokenBuf, int k)
           
  ANTLRTokdefParser(TokenStream lexer)
           
protected ANTLRTokdefParser(TokenStream lexer, int k)
           
 
Method Summary
 void file(ImportVocabTokenManager tm)
           
protected  Tool getTool()
           
 void line(ImportVocabTokenManager tm)
           
 void reportError(RecognitionException e)
          Delegates the error message to the tool if any was registered via #initTool(antlr.Tool)
 void reportError(String s)
          Delegates the error message to the tool if any was registered via #initTool(antlr.Tool)
 void reportWarning(String s)
          Delegates the warning message to the tool if any was registered via #initTool(antlr.Tool)
 void setTool(Tool tool)
          In order to make it so existing subclasses don't break, we won't require that the antlr.Tool instance be passed as a constructor element.
 
Methods inherited from class antlr.LLkParser
consume, LA, LT, traceIn, traceOut
 
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_tokenNames

public static final String[] _tokenNames

_tokenSet_0

public static final BitSet _tokenSet_0

_tokenSet_1

public static final BitSet _tokenSet_1
Constructor Detail

ANTLRTokdefParser

protected ANTLRTokdefParser(TokenBuffer tokenBuf,
                            int k)

ANTLRTokdefParser

public ANTLRTokdefParser(TokenBuffer tokenBuf)

ANTLRTokdefParser

protected ANTLRTokdefParser(TokenStream lexer,
                            int k)

ANTLRTokdefParser

public ANTLRTokdefParser(TokenStream lexer)

ANTLRTokdefParser

public ANTLRTokdefParser(ParserSharedInputState state)
Method Detail

setTool

public void setTool(Tool tool)
In order to make it so existing subclasses don't break, we won't require that the antlr.Tool instance be passed as a constructor element. Instead, the antlr.Tool instance should register itself via #initTool(antlr.Tool)

Throws:
IllegalStateException - if a tool has already been registered
Since:
2.7.2

getTool

protected Tool getTool()
Since:
2.7.2

reportError

public void reportError(String s)
Delegates the error message to the tool if any was registered via #initTool(antlr.Tool)

Overrides:
reportError in class Parser
Since:
2.7.2

reportError

public void reportError(RecognitionException e)
Delegates the error message to the tool if any was registered via #initTool(antlr.Tool)

Overrides:
reportError in class Parser
Since:
2.7.2

reportWarning

public void reportWarning(String s)
Delegates the warning message to the tool if any was registered via #initTool(antlr.Tool)

Overrides:
reportWarning in class Parser
Since:
2.7.2

file

public final void file(ImportVocabTokenManager tm)
                throws RecognitionException,
                       TokenStreamException
Throws:
RecognitionException
TokenStreamException

line

public final void line(ImportVocabTokenManager tm)
                throws RecognitionException,
                       TokenStreamException
Throws:
RecognitionException
TokenStreamException