Package org.antlr.grammar.v2
Class DefineGrammarItemsWalker
java.lang.Object
antlr.TreeParser
org.antlr.grammar.v2.DefineGrammarItemsWalker
- All Implemented Interfaces:
DefineGrammarItemsWalkerTokenTypes
public class DefineGrammarItemsWalker
extends antlr.TreeParser
implements DefineGrammarItemsWalkerTokenTypes
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]protected intprotected GrammarASTprotected GrammarASTprotected Stringprotected Grammarprotected intprotected GrammarASTFields inherited from class antlr.TreeParser
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepthFields inherited from interface org.antlr.grammar.v2.DefineGrammarItemsWalkerTokenTypes
ACTION, ACTION_CHAR_LITERAL, ACTION_ESC, ACTION_STRING_LITERAL, ALT, AMPERSAND, ARG, ARG_ACTION, ARGLIST, ASSIGN, BACKTRACK_SEMPRED, BANG, BLOCK, CHAR_LITERAL, CHAR_RANGE, CLOSE_ELEMENT_OPTION, CLOSURE, COLON, COMBINED_GRAMMAR, COMMA, COMMENT, DIGIT, DOC_COMMENT, DOLLAR, DOT, DOUBLE_ANGLE_STRING_LITERAL, DOUBLE_QUOTE_STRING_LITERAL, EOA, EOB, EOF, EOR, EPSILON, ESC, ETC, FORCED_ACTION, FRAGMENT, GATED_SEMPRED, ID, IMPLIES, IMPORT, INITACTION, INT, INTERNAL_RULE_REF, LABEL, LEXER, LEXER_GRAMMAR, LITERAL_catch, LITERAL_finally, LITERAL_grammar, LITERAL_lexer, LITERAL_private, LITERAL_protected, LITERAL_public, LITERAL_returns, LITERAL_throws, LITERAL_tree, LPAREN, ML_COMMENT, NESTED_ACTION, NESTED_ARG_ACTION, NOT, NULL_TREE_LOOKAHEAD, OPEN_ELEMENT_OPTION, OPTIONAL, OPTIONS, OR, PARSER, PARSER_GRAMMAR, PLUS, PLUS_ASSIGN, POSITIVE_CLOSURE, QUESTION, RANGE, RCURLY, RET, REWRITE, ROOT, RPAREN, RULE, RULE_REF, SCOPE, SEMI, SEMPRED, SL_COMMENT, SRC, STAR, STRAY_BRACKET, STRING_LITERAL, SYN_SEMPRED, SYNPRED, TEMPLATE, TOKEN_REF, TOKENS, TREE_BEGIN, TREE_GRAMMAR, WILDCARD, WS, WS_LOOP, WS_OPT, XDIGIT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaction(antlr.collections.AST _t) final voidactions(antlr.collections.AST _t) final voidalternative(antlr.collections.AST _t) final voidast_suffix(antlr.collections.AST _t) final voidatom(antlr.collections.AST _t, GrammarAST scope) final voidattrScope(antlr.collections.AST _t) final voidblock(antlr.collections.AST _t) final voidblockAction(antlr.collections.AST _t) final intcountAltsForRule(antlr.collections.AST _t) final voiddelegateGrammars(antlr.collections.AST _t) final voiddotBlock(antlr.collections.AST _t) final voiddotLoop(antlr.collections.AST _t) Track the .* and .+ idioms and make them nongreedy by default.final voidebnf(antlr.collections.AST _t) final voidelement(antlr.collections.AST _t) final voidexceptionGroup(antlr.collections.AST _t) final voidexceptionHandler(antlr.collections.AST _t) final voidfinallyClause(antlr.collections.AST _t) protected voidfinish()final voidfinal voidgrammarSpec(antlr.collections.AST _t) final Stringmodifier(antlr.collections.AST _t) final voidoptionsSpec(antlr.collections.AST _t) voidreportError(antlr.RecognitionException ex) final voidrewrite(antlr.collections.AST _t) final voidrewrite_alternative(antlr.collections.AST _t) final voidrewrite_atom(antlr.collections.AST _t) final voidrewrite_block(antlr.collections.AST _t) final voidrewrite_ebnf(antlr.collections.AST _t) final voidrewrite_element(antlr.collections.AST _t) final voidrewrite_template(antlr.collections.AST _t) final voidrewrite_tree(antlr.collections.AST _t) final voidrule(antlr.collections.AST _t) final voidruleAction(antlr.collections.AST _t, Rule r) final voidrules(antlr.collections.AST _t) final voidruleScopeSpec(antlr.collections.AST _t, Rule r) final voidtokenSpec(antlr.collections.AST _t) final voidtokensSpec(antlr.collections.AST _t) protected voidtrackInlineAction(GrammarAST actionAST) final voidtree(antlr.collections.AST _t) protected voidRemove any lexer rules from a COMBINED; already passed to lexerMethods inherited from class antlr.TreeParser
getAST, getASTFactory, getTokenName, getTokenNames, match, match, matchNot, panic, reportError, reportWarning, setASTFactory, setASTNodeClass, setASTNodeType, traceIn, traceIndent, traceOut
-
Field Details
-
grammar
-
root
-
currentRuleName
-
currentRewriteBlock
-
currentRewriteRule
-
outerAltNum
protected int outerAltNum -
blockLevel
protected int blockLevel -
_tokenNames
-
-
Constructor Details
-
DefineGrammarItemsWalker
public DefineGrammarItemsWalker()
-
-
Method Details
-
reportError
public void reportError(antlr.RecognitionException ex) - Overrides:
reportErrorin classantlr.TreeParser
-
finish
protected void finish() -
trimGrammar
protected void trimGrammar()Remove any lexer rules from a COMBINED; already passed to lexer -
trackInlineAction
-
grammar
- Throws:
antlr.RecognitionException
-
grammarSpec
public final void grammarSpec(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
attrScope
public final void attrScope(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
optionsSpec
public final void optionsSpec(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
delegateGrammars
public final void delegateGrammars(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
tokensSpec
public final void tokensSpec(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
actions
public final void actions(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rules
public final void rules(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
action
public final void action(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
tokenSpec
public final void tokenSpec(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rule
public final void rule(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
modifier
- Throws:
antlr.RecognitionException
-
ruleScopeSpec
- Throws:
antlr.RecognitionException
-
ruleAction
- Throws:
antlr.RecognitionException
-
block
public final void block(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
exceptionGroup
public final void exceptionGroup(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
countAltsForRule
public final int countAltsForRule(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
blockAction
public final void blockAction(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
alternative
public final void alternative(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite
public final void rewrite(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
element
public final void element(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
exceptionHandler
public final void exceptionHandler(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
finallyClause
public final void finallyClause(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
atom
public final void atom(antlr.collections.AST _t, GrammarAST scope) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
ebnf
public final void ebnf(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
tree
public final void tree(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
dotLoop
public final void dotLoop(antlr.collections.AST _t) throws antlr.RecognitionException Track the .* and .+ idioms and make them nongreedy by default.- Throws:
antlr.RecognitionException
-
dotBlock
public final void dotBlock(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
ast_suffix
public final void ast_suffix(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_alternative
public final void rewrite_alternative(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_block
public final void rewrite_block(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_element
public final void rewrite_element(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_template
public final void rewrite_template(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_atom
public final void rewrite_atom(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_ebnf
public final void rewrite_ebnf(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-
rewrite_tree
public final void rewrite_tree(antlr.collections.AST _t) throws antlr.RecognitionException - Throws:
antlr.RecognitionException
-