antlr

Class ANTLRTokdefParser

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
Constructor Summary
protected ANTLRTokdefParser(TokenBuffer tokenBuf, int k)
ANTLRTokdefParser(TokenBuffer tokenBuf)
protected ANTLRTokdefParser(TokenStream lexer, int k)
ANTLRTokdefParser(TokenStream lexer)
ANTLRTokdefParser(ParserSharedInputState state)
Method Summary
voidfile(ImportVocabTokenManager tm)
protected ToolgetTool()
voidline(ImportVocabTokenManager tm)
voidreportError(String s)
Delegates the error message to the tool if any was registered via
voidreportError(RecognitionException e)
Delegates the error message to the tool if any was registered via
voidreportWarning(String s)
Delegates the warning message to the tool if any was registered via
voidsetTool(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.

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

file

public final void file(ImportVocabTokenManager tm)

getTool

protected Tool getTool()

Since: 2.7.2

line

public final void line(ImportVocabTokenManager tm)

reportError

public void reportError(String s)
Delegates the error message to the tool if any was registered via ANTLRTokdefParser

Since: 2.7.2

reportError

public void reportError(RecognitionException e)
Delegates the error message to the tool if any was registered via ANTLRTokdefParser

Since: 2.7.2

reportWarning

public void reportWarning(String s)
Delegates the warning message to the tool if any was registered via ANTLRTokdefParser

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 ANTLRTokdefParser

Throws: IllegalStateException if a tool has already been registered

Since: 2.7.2