antlr.preprocessor

Class Preprocessor

Implemented Interfaces:
PreprocessorTokenTypes

public class Preprocessor
extends LLkParser
implements PreprocessorTokenTypes

Field Summary

static String[]
_tokenNames
static BitSet
_tokenSet_0
static BitSet
_tokenSet_1
static BitSet
_tokenSet_2
static BitSet
_tokenSet_3
static BitSet
_tokenSet_4
static BitSet
_tokenSet_5
static BitSet
_tokenSet_6
static BitSet
_tokenSet_7
static BitSet
_tokenSet_8

Fields inherited from class antlr.LLkParser

k

Fields inherited from class antlr.Parser

astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth

Fields inherited from interface antlr.preprocessor.PreprocessorTokenTypes

ACTION, ALT, ARG_ACTION, ASSIGN_RHS, BANG, CHAR_LITERAL, COMMA, COMMENT, CURLY_BLOCK_SCARF, DIGIT, ELEMENT, EOF, ESC, HEADER_ACTION, ID, ID_OR_KEYWORD, LITERAL_catch, LITERAL_class, LITERAL_exception, LITERAL_extends, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_returns, LITERAL_throws, LITERAL_tokens, LPAREN, ML_COMMENT, NEWLINE, NULL_TREE_LOOKAHEAD, OPTIONS_START, RCURLY, RPAREN, RULE_BLOCK, SEMI, SL_COMMENT, STRING_LITERAL, SUBRULE_BLOCK, TOKENS_SPEC, WS, XDIGIT

Constructor Summary

Preprocessor(ParserSharedInputState state)
Preprocessor(TokenBuffer tokenBuf)
Preprocessor(TokenBuffer tokenBuf, int k)
Preprocessor(TokenStream lexer)
Preprocessor(TokenStream lexer, int k)

Method Summary

Grammar
class_def(String file, Hierarchy hier)
String
exceptionGroup()
String
exceptionHandler()
String
exceptionSpec()
protected Tool
getTool()
void
grammarFile(Hierarchy hier, String file)
IndexedVector
optionSpec(Grammar gr)
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
rule(Grammar gr)
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.
String
superClass()
String
throwsSpec()

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, 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

_tokenSet_2

public static final BitSet _tokenSet_2

_tokenSet_3

public static final BitSet _tokenSet_3

_tokenSet_4

public static final BitSet _tokenSet_4

_tokenSet_5

public static final BitSet _tokenSet_5

_tokenSet_6

public static final BitSet _tokenSet_6

_tokenSet_7

public static final BitSet _tokenSet_7

_tokenSet_8

public static final BitSet _tokenSet_8

Constructor Details

Preprocessor

public Preprocessor(ParserSharedInputState state)

Preprocessor

public Preprocessor(TokenBuffer tokenBuf)

Preprocessor

protected Preprocessor(TokenBuffer tokenBuf,
                       int k)

Preprocessor

public Preprocessor(TokenStream lexer)

Preprocessor

protected Preprocessor(TokenStream lexer,
                       int k)

Method Details

class_def

public final Grammar class_def(String file,
                               Hierarchy hier)
            throws RecognitionException,
                   TokenStreamException

exceptionGroup

public final String exceptionGroup()
            throws RecognitionException,
                   TokenStreamException

exceptionHandler

public final String exceptionHandler()
            throws RecognitionException,
                   TokenStreamException

exceptionSpec

public final String exceptionSpec()
            throws RecognitionException,
                   TokenStreamException

getTool

protected Tool getTool()
Since:
2.7.2

grammarFile

public final void grammarFile(Hierarchy hier,
                              String file)
            throws RecognitionException,
                   TokenStreamException

optionSpec

public final IndexedVector optionSpec(Grammar gr)
            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

rule

public final void rule(Grammar gr)
            throws RecognitionException,
                   TokenStreamException

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

superClass

public final String superClass()
            throws RecognitionException,
                   TokenStreamException

throwsSpec

public final String throwsSpec()
            throws RecognitionException,
                   TokenStreamException