antlr

Class ANTLRTokdefParser

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)
ANTLRTokdefParser(TokenBuffer tokenBuf, int k)
ANTLRTokdefParser(TokenStream lexer)
ANTLRTokdefParser(TokenStream lexer, int k)

Method Summary

void
file(ImportVocabTokenManager tm)
protected Tool
getTool()
void
line(ImportVocabTokenManager tm)
void
reportError(String s)
Delegates the error message to the tool if any was registered via initTool(antlr.Tool)
void
reportError(RecognitionException e)
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

LA, LT, consume, traceIn, traceOut

Methods inherited from class antlr.Parser

LA, LT, addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consume, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIn, traceIndent, traceOut

Field Details

_tokenNames

public static final String[] _tokenNames

_tokenSet_0

public static final BitSet _tokenSet_0

_tokenSet_1

public static final BitSet _tokenSet_1

Constructor Details

ANTLRTokdefParser

public ANTLRTokdefParser(ParserSharedInputState state)

ANTLRTokdefParser

public ANTLRTokdefParser(TokenBuffer tokenBuf)

ANTLRTokdefParser

protected ANTLRTokdefParser(TokenBuffer tokenBuf,
                            int k)

ANTLRTokdefParser

public ANTLRTokdefParser(TokenStream lexer)

ANTLRTokdefParser

protected ANTLRTokdefParser(TokenStream lexer,
                            int k)

Method Details

file

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

getTool

protected Tool getTool()
Since:
2.7.2

line

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

reportError

public void reportError(String s)
Delegates the error message to the tool if any was registered via initTool(antlr.Tool)
Overrides:
reportError in interface 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 interface 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 interface Parser
Since:
2.7.2

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)
Since:
2.7.2