Package antlr.preprocessor
Class Preprocessor
- java.lang.Object
-
- antlr.Parser
-
- antlr.LLkParser
-
- antlr.preprocessor.Preprocessor
-
- All Implemented Interfaces:
PreprocessorTokenTypes
public class Preprocessor extends LLkParser implements PreprocessorTokenTypes
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]_tokenNamesstatic BitSet_tokenSet_0static BitSet_tokenSet_1static BitSet_tokenSet_2static BitSet_tokenSet_3static BitSet_tokenSet_4static BitSet_tokenSet_5static BitSet_tokenSet_6static BitSet_tokenSet_7static BitSet_tokenSet_8-
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
Constructors Modifier Constructor Description Preprocessor(ParserSharedInputState state)Preprocessor(TokenBuffer tokenBuf)protectedPreprocessor(TokenBuffer tokenBuf, int k)Preprocessor(TokenStream lexer)protectedPreprocessor(TokenStream lexer, int k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Grammarclass_def(java.lang.String file, Hierarchy hier)java.lang.StringexceptionGroup()java.lang.StringexceptionHandler()java.lang.StringexceptionSpec()protected ToolgetTool()voidgrammarFile(Hierarchy hier, java.lang.String file)IndexedVectoroptionSpec(Grammar gr)voidreportError(RecognitionException e)Delegates the error message to the tool if any was registered via#initTool(antlr.Tool)voidreportError(java.lang.String s)Delegates the error message to the tool if any was registered via#initTool(antlr.Tool)voidreportWarning(java.lang.String s)Delegates the warning message to the tool if any was registered via#initTool(antlr.Tool)voidrule(Grammar gr)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.java.lang.StringsuperClass()java.lang.StringthrowsSpec()-
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
-
-
-
-
Field Detail
-
_tokenNames
public static final java.lang.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 Detail
-
Preprocessor
protected Preprocessor(TokenBuffer tokenBuf, int k)
-
Preprocessor
public Preprocessor(TokenBuffer tokenBuf)
-
Preprocessor
protected Preprocessor(TokenStream lexer, int k)
-
Preprocessor
public Preprocessor(TokenStream lexer)
-
Preprocessor
public Preprocessor(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:
java.lang.IllegalStateException- if a tool has already been registered- Since:
- 2.7.2
-
getTool
protected Tool getTool()
- Since:
- 2.7.2
-
reportError
public void reportError(java.lang.String s)
Delegates the error message to the tool if any was registered via#initTool(antlr.Tool)- Overrides:
reportErrorin classParser- 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:
reportErrorin classParser- Since:
- 2.7.2
-
reportWarning
public void reportWarning(java.lang.String s)
Delegates the warning message to the tool if any was registered via#initTool(antlr.Tool)- Overrides:
reportWarningin classParser- Since:
- 2.7.2
-
grammarFile
public final void grammarFile(Hierarchy hier, java.lang.String file) throws RecognitionException, TokenStreamException
-
optionSpec
public final IndexedVector optionSpec(Grammar gr) throws RecognitionException, TokenStreamException
-
class_def
public final Grammar class_def(java.lang.String file, Hierarchy hier) throws RecognitionException, TokenStreamException
-
superClass
public final java.lang.String superClass() throws RecognitionException, TokenStreamException
-
rule
public final void rule(Grammar gr) throws RecognitionException, TokenStreamException
-
throwsSpec
public final java.lang.String throwsSpec() throws RecognitionException, TokenStreamException
-
exceptionGroup
public final java.lang.String exceptionGroup() throws RecognitionException, TokenStreamException
-
exceptionSpec
public final java.lang.String exceptionSpec() throws RecognitionException, TokenStreamException
-
exceptionHandler
public final java.lang.String exceptionHandler() throws RecognitionException, TokenStreamException
-
-