Package org.antlr.grammar.v3
Class CodeGenTreeWalker
java.lang.Object
org.antlr.runtime.BaseRecognizer
org.antlr.runtime.tree.TreeParser
org.antlr.grammar.v3.CodeGenTreeWalker
Walk a grammar and generate code by gradually building up
a bigger and bigger ST.
Terence Parr
University of San Francisco
June 15, 2004
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected boolean
protected org.stringtemplate.v4.ST
private String
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final BitSet
static final int
static final int
static final int
protected CodeGenerator
protected Grammar
static final int
protected org.stringtemplate.v4.ST
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected static final int
private int
protected org.stringtemplate.v4.ST
protected String
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected org.stringtemplate.v4.ST
The overall lexer/parser template; simulate dynamically scoped attributes by making this an instance var of the walker.static final int
static final int
static final int
static final int
protected int
static final int
protected int
static final int
static final int
static final int
protected static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected org.stringtemplate.v4.STGroup
static final int
static final int
static final String[]
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class org.antlr.runtime.tree.TreeParser
DOWN, input, UP
Fields inherited from class org.antlr.runtime.BaseRecognizer
DEFAULT_TOKEN_CHANNEL, HIDDEN, INITIAL_FOLLOW_STACK_SIZE, MEMO_RULE_FAILED, MEMO_RULE_UNKNOWN, NEXT_TOKEN_RULE_NAME, state
-
Constructor Summary
ConstructorsConstructorDescriptionCodeGenTreeWalker
(TreeNodeStream input) CodeGenTreeWalker
(TreeNodeStream input, RecognizerSharedState state) -
Method Summary
Modifier and TypeMethodDescriptionalternative
(GrammarAST label) final void
atom
(GrammarAST scope, GrammarAST label, GrammarAST astSuffix) final void
block
(String blockTemplateName, DFA dfa, GrammarAST label) ebnf
(GrammarAST label) element
(GrammarAST label, GrammarAST astSuffix) final void
exceptionGroup
(org.stringtemplate.v4.ST ruleST) final void
exceptionHandler
(org.stringtemplate.v4.ST ruleST) final void
finallyClause
(org.stringtemplate.v4.ST ruleST) For debugging and other purposes, might want the grammar name.int
protected final org.stringtemplate.v4.ST
getRuleElementST
(String name, String ruleTargetName, GrammarAST elementAST, GrammarAST ast_suffix, String label) protected final String
getSTSuffix
(GrammarAST elementAST, GrammarAST ast_suffix, String label) Return a non-empty template name suffix if the token is to be tracked, added to a tree, or both.protected final org.stringtemplate.v4.ST
getTokenElementST
(String name, String elementName, GrammarAST elementAST, GrammarAST ast_suffix, String label) String[]
Used to print out token names like ID during debugging and error reporting.Convert rewrite AST lists to target labels listprotected final org.stringtemplate.v4.ST
getWildcardST
(GrammarAST elementAST, GrammarAST ast_suffix, String label) final void
grammar_
(Grammar g, org.stringtemplate.v4.ST recognizerST, org.stringtemplate.v4.ST outputFileST, org.stringtemplate.v4.ST headerFileST) final void
final void
final boolean
isListLabel
(String label) modifier()
final org.stringtemplate.v4.ST
notElement
(GrammarAST n, GrammarAST label, GrammarAST astSuffix) final void
void
Report a recognition problem.rewrite()
final org.stringtemplate.v4.ST
rewrite_atom
(boolean isRoot) final org.stringtemplate.v4.ST
rewrite_block
(String blockTemplateName) final org.stringtemplate.v4.ST
rule()
final void
rules
(org.stringtemplate.v4.ST recognizerST) final void
final org.stringtemplate.v4.ST
set
(GrammarAST label, GrammarAST astSuffix) final void
setBlock()
void
setCurrentRuleName
(String value) final void
void
setOuterAltNum
(int value) final boolean
final void
final boolean
final void
final void
tree_()
Methods inherited from class org.antlr.runtime.tree.TreeParser
getAncestor, getCurrentInputSymbol, getErrorHeader, getErrorMessage, getMissingSymbol, getSourceName, getTreeNodeStream, inContext, inContext, matchAny, recoverFromMismatchedToken, reset, setTreeNodeStream, traceIn, traceOut
Methods inherited from class org.antlr.runtime.BaseRecognizer
alreadyParsedRule, beginResync, combineFollows, computeContextSensitiveRuleFOLLOW, computeErrorRecoverySet, consumeUntil, consumeUntil, displayRecognitionError, emitErrorMessage, endResync, failed, getBacktrackingLevel, getNumberOfSyntaxErrors, getRuleInvocationStack, getRuleInvocationStack, getRuleMemoization, getRuleMemoizationCacheSize, getTokenErrorDisplay, match, memoize, mismatchIsMissingToken, mismatchIsUnwantedToken, pushFollow, recover, recoverFromMismatchedSet, setBacktrackingLevel, toStrings, traceIn, traceOut
-
Field Details
-
tokenNames
-
EOF
public static final int EOF- See Also:
-
ACTION
public static final int ACTION- See Also:
-
ACTION_CHAR_LITERAL
public static final int ACTION_CHAR_LITERAL- See Also:
-
ACTION_ESC
public static final int ACTION_ESC- See Also:
-
ACTION_STRING_LITERAL
public static final int ACTION_STRING_LITERAL- See Also:
-
ALT
public static final int ALT- See Also:
-
AMPERSAND
public static final int AMPERSAND- See Also:
-
ARG
public static final int ARG- See Also:
-
ARGLIST
public static final int ARGLIST- See Also:
-
ARG_ACTION
public static final int ARG_ACTION- See Also:
-
ASSIGN
public static final int ASSIGN- See Also:
-
BACKTRACK_SEMPRED
public static final int BACKTRACK_SEMPRED- See Also:
-
BANG
public static final int BANG- See Also:
-
BLOCK
public static final int BLOCK- See Also:
-
CATCH
public static final int CATCH- See Also:
-
CHAR_LITERAL
public static final int CHAR_LITERAL- See Also:
-
CHAR_RANGE
public static final int CHAR_RANGE- See Also:
-
CLOSE_ELEMENT_OPTION
public static final int CLOSE_ELEMENT_OPTION- See Also:
-
CLOSURE
public static final int CLOSURE- See Also:
-
COLON
public static final int COLON- See Also:
-
COMBINED_GRAMMAR
public static final int COMBINED_GRAMMAR- See Also:
-
COMMA
public static final int COMMA- See Also:
-
COMMENT
public static final int COMMENT- See Also:
-
DIGIT
public static final int DIGIT- See Also:
-
DOC_COMMENT
public static final int DOC_COMMENT- See Also:
-
DOLLAR
public static final int DOLLAR- See Also:
-
DOT
public static final int DOT- See Also:
-
DOUBLE_ANGLE_STRING_LITERAL
public static final int DOUBLE_ANGLE_STRING_LITERAL- See Also:
-
DOUBLE_QUOTE_STRING_LITERAL
public static final int DOUBLE_QUOTE_STRING_LITERAL- See Also:
-
EOA
public static final int EOA- See Also:
-
EOB
public static final int EOB- See Also:
-
EOR
public static final int EOR- See Also:
-
EPSILON
public static final int EPSILON- See Also:
-
ESC
public static final int ESC- See Also:
-
ETC
public static final int ETC- See Also:
-
FINALLY
public static final int FINALLY- See Also:
-
FORCED_ACTION
public static final int FORCED_ACTION- See Also:
-
FRAGMENT
public static final int FRAGMENT- See Also:
-
GATED_SEMPRED
public static final int GATED_SEMPRED- See Also:
-
GRAMMAR
public static final int GRAMMAR- See Also:
-
ID
public static final int ID- See Also:
-
IMPLIES
public static final int IMPLIES- See Also:
-
IMPORT
public static final int IMPORT- See Also:
-
INITACTION
public static final int INITACTION- See Also:
-
INT
public static final int INT- See Also:
-
LABEL
public static final int LABEL- See Also:
-
LEXER
public static final int LEXER- See Also:
-
LEXER_GRAMMAR
public static final int LEXER_GRAMMAR- See Also:
-
LPAREN
public static final int LPAREN- See Also:
-
ML_COMMENT
public static final int ML_COMMENT- See Also:
-
NESTED_ACTION
public static final int NESTED_ACTION- See Also:
-
NESTED_ARG_ACTION
public static final int NESTED_ARG_ACTION- See Also:
-
NOT
public static final int NOT- See Also:
-
OPEN_ELEMENT_OPTION
public static final int OPEN_ELEMENT_OPTION- See Also:
-
OPTIONAL
public static final int OPTIONAL- See Also:
-
OPTIONS
public static final int OPTIONS- See Also:
-
OR
public static final int OR- See Also:
-
PARSER
public static final int PARSER- See Also:
-
PARSER_GRAMMAR
public static final int PARSER_GRAMMAR- See Also:
-
PLUS
public static final int PLUS- See Also:
-
PLUS_ASSIGN
public static final int PLUS_ASSIGN- See Also:
-
POSITIVE_CLOSURE
public static final int POSITIVE_CLOSURE- See Also:
-
PREC_RULE
public static final int PREC_RULE- See Also:
-
PRIVATE
public static final int PRIVATE- See Also:
-
PROTECTED
public static final int PROTECTED- See Also:
-
PUBLIC
public static final int PUBLIC- See Also:
-
QUESTION
public static final int QUESTION- See Also:
-
RANGE
public static final int RANGE- See Also:
-
RCURLY
public static final int RCURLY- See Also:
-
RECURSIVE_RULE_REF
public static final int RECURSIVE_RULE_REF- See Also:
-
RET
public static final int RET- See Also:
-
RETURNS
public static final int RETURNS- See Also:
-
REWRITE
public static final int REWRITE- See Also:
-
REWRITES
public static final int REWRITES- See Also:
-
ROOT
public static final int ROOT- See Also:
-
RPAREN
public static final int RPAREN- See Also:
-
RULE
public static final int RULE- See Also:
-
RULE_REF
public static final int RULE_REF- See Also:
-
SCOPE
public static final int SCOPE- See Also:
-
SEMI
public static final int SEMI- See Also:
-
SEMPRED
public static final int SEMPRED- See Also:
-
SL_COMMENT
public static final int SL_COMMENT- See Also:
-
SRC
public static final int SRC- See Also:
-
STAR
public static final int STAR- See Also:
-
STRAY_BRACKET
public static final int STRAY_BRACKET- See Also:
-
STRING_LITERAL
public static final int STRING_LITERAL- See Also:
-
SYNPRED
public static final int SYNPRED- See Also:
-
SYN_SEMPRED
public static final int SYN_SEMPRED- See Also:
-
TEMPLATE
public static final int TEMPLATE- See Also:
-
THROWS
public static final int THROWS- See Also:
-
TOKENS
public static final int TOKENS- See Also:
-
TOKEN_REF
public static final int TOKEN_REF- See Also:
-
TREE
public static final int TREE- See Also:
-
TREE_BEGIN
public static final int TREE_BEGIN- See Also:
-
TREE_GRAMMAR
public static final int TREE_GRAMMAR- See Also:
-
WILDCARD
public static final int WILDCARD- See Also:
-
WS
public static final int WS- See Also:
-
WS_LOOP
public static final int WS_LOOP- See Also:
-
WS_OPT
public static final int WS_OPT- See Also:
-
XDIGIT
public static final int XDIGIT- See Also:
-
RULE_BLOCK_NESTING_LEVEL
protected static final int RULE_BLOCK_NESTING_LEVEL- See Also:
-
OUTER_REWRITE_NESTING_LEVEL
protected static final int OUTER_REWRITE_NESTING_LEVEL- See Also:
-
currentRuleName
-
blockNestingLevel
protected int blockNestingLevel -
rewriteBlockNestingLevel
protected int rewriteBlockNestingLevel -
outerAltNum
private int outerAltNum -
currentBlockST
protected org.stringtemplate.v4.ST currentBlockST -
currentAltHasASTRewrite
protected boolean currentAltHasASTRewrite -
rewriteTreeNestingLevel
protected int rewriteTreeNestingLevel -
rewriteRuleRefs
-
generator
-
grammar
-
templates
protected org.stringtemplate.v4.STGroup templates -
recognizerST
protected org.stringtemplate.v4.ST recognizerSTThe overall lexer/parser template; simulate dynamically scoped attributes by making this an instance var of the walker. -
outputFileST
protected org.stringtemplate.v4.ST outputFileST -
headerFileST
protected org.stringtemplate.v4.ST headerFileST -
outputOption
-
FOLLOW_LEXER_GRAMMAR_in_grammar_67
-
FOLLOW_grammarSpec_in_grammar_69
-
FOLLOW_PARSER_GRAMMAR_in_grammar_79
-
FOLLOW_grammarSpec_in_grammar_81
-
FOLLOW_TREE_GRAMMAR_in_grammar_91
-
FOLLOW_grammarSpec_in_grammar_93
-
FOLLOW_COMBINED_GRAMMAR_in_grammar_103
-
FOLLOW_grammarSpec_in_grammar_105
-
FOLLOW_SCOPE_in_attrScope124
-
FOLLOW_ID_in_attrScope126
-
FOLLOW_AMPERSAND_in_attrScope131
-
FOLLOW_ACTION_in_attrScope140
-
FOLLOW_ID_in_grammarSpec157
-
FOLLOW_DOC_COMMENT_in_grammarSpec165
-
FOLLOW_OPTIONS_in_grammarSpec186
-
FOLLOW_IMPORT_in_grammarSpec200
-
FOLLOW_TOKENS_in_grammarSpec214
-
FOLLOW_attrScope_in_grammarSpec226
-
FOLLOW_AMPERSAND_in_grammarSpec235
-
FOLLOW_rules_in_grammarSpec246
-
FOLLOW_rule_in_rules291
-
FOLLOW_RULE_in_rules305
-
FOLLOW_PREC_RULE_in_rules317
-
FOLLOW_RULE_in_rule359
-
FOLLOW_ID_in_rule363
-
FOLLOW_modifier_in_rule376
-
FOLLOW_ARG_in_rule384
-
FOLLOW_ARG_ACTION_in_rule387
-
FOLLOW_RET_in_rule396
-
FOLLOW_ARG_ACTION_in_rule399
-
FOLLOW_throwsSpec_in_rule408
-
FOLLOW_OPTIONS_in_rule418
-
FOLLOW_ruleScopeSpec_in_rule431
-
FOLLOW_AMPERSAND_in_rule441
-
FOLLOW_block_in_rule455
-
FOLLOW_exceptionGroup_in_rule468
-
FOLLOW_EOR_in_rule476
-
FOLLOW_THROWS_in_throwsSpec526
-
FOLLOW_ID_in_throwsSpec528
-
FOLLOW_SCOPE_in_ruleScopeSpec543
-
FOLLOW_AMPERSAND_in_ruleScopeSpec548
-
FOLLOW_ACTION_in_ruleScopeSpec558
-
FOLLOW_ID_in_ruleScopeSpec564
-
FOLLOW_setBlock_in_block605
-
FOLLOW_BLOCK_in_block618
-
FOLLOW_OPTIONS_in_block626
-
FOLLOW_alternative_in_block643
-
FOLLOW_rewrite_in_block648
-
FOLLOW_EOB_in_block665
-
FOLLOW_BLOCK_in_setBlock697
-
FOLLOW_ALT_in_setAlternative717
-
FOLLOW_setElement_in_setAlternative719
-
FOLLOW_EOA_in_setAlternative722
-
FOLLOW_exceptionHandler_in_exceptionGroup737
-
FOLLOW_finallyClause_in_exceptionGroup744
-
FOLLOW_finallyClause_in_exceptionGroup752
-
FOLLOW_CATCH_in_exceptionHandler766
-
FOLLOW_ARG_ACTION_in_exceptionHandler768
-
FOLLOW_ACTION_in_exceptionHandler770
-
FOLLOW_FINALLY_in_finallyClause788
-
FOLLOW_ACTION_in_finallyClause790
-
FOLLOW_ALT_in_alternative820
-
FOLLOW_element_in_alternative833
-
FOLLOW_EOA_in_alternative851
-
FOLLOW_ROOT_in_element886
-
FOLLOW_element_in_element890
-
FOLLOW_BANG_in_element903
-
FOLLOW_element_in_element907
-
FOLLOW_NOT_in_element923
-
FOLLOW_notElement_in_element927
-
FOLLOW_ASSIGN_in_element942
-
FOLLOW_ID_in_element946
-
FOLLOW_element_in_element950
-
FOLLOW_PLUS_ASSIGN_in_element965
-
FOLLOW_ID_in_element969
-
FOLLOW_element_in_element973
-
FOLLOW_CHAR_RANGE_in_element987
-
FOLLOW_CHAR_LITERAL_in_element991
-
FOLLOW_CHAR_LITERAL_in_element995
-
FOLLOW_ebnf_in_element1024
-
FOLLOW_atom_in_element1035
-
FOLLOW_tree__in_element1046
-
FOLLOW_element_action_in_element1056
-
FOLLOW_SEMPRED_in_element1071
-
FOLLOW_GATED_SEMPRED_in_element1075
-
FOLLOW_SYN_SEMPRED_in_element1086
-
FOLLOW_SYNPRED_in_element1094
-
FOLLOW_BACKTRACK_SEMPRED_in_element1105
-
FOLLOW_EPSILON_in_element1117
-
FOLLOW_ACTION_in_element_action1134
-
FOLLOW_FORCED_ACTION_in_element_action1145
-
FOLLOW_CHAR_LITERAL_in_notElement1174
-
FOLLOW_STRING_LITERAL_in_notElement1187
-
FOLLOW_TOKEN_REF_in_notElement1200
-
FOLLOW_BLOCK_in_notElement1214
-
FOLLOW_block_in_ebnf1261
-
FOLLOW_OPTIONAL_in_ebnf1280
-
FOLLOW_block_in_ebnf1284
-
FOLLOW_CLOSURE_in_ebnf1305
-
FOLLOW_block_in_ebnf1309
-
FOLLOW_POSITIVE_CLOSURE_in_ebnf1330
-
FOLLOW_block_in_ebnf1334
-
FOLLOW_TREE_BEGIN_in_tree_1372
-
FOLLOW_element_in_tree_1379
-
FOLLOW_element_action_in_tree_1416
-
FOLLOW_element_in_tree_1438
-
FOLLOW_RULE_REF_in_atom1488
-
FOLLOW_ARG_ACTION_in_atom1493
-
FOLLOW_TOKEN_REF_in_atom1511
-
FOLLOW_ARG_ACTION_in_atom1516
-
FOLLOW_CHAR_LITERAL_in_atom1532
-
FOLLOW_STRING_LITERAL_in_atom1544
-
FOLLOW_WILDCARD_in_atom1556
-
FOLLOW_DOT_in_atom1567
-
FOLLOW_ID_in_atom1569
-
FOLLOW_atom_in_atom1573
-
FOLLOW_set_in_atom1586
-
FOLLOW_BLOCK_in_set1631
-
FOLLOW_CHAR_LITERAL_in_setElement1651
-
FOLLOW_TOKEN_REF_in_setElement1656
-
FOLLOW_STRING_LITERAL_in_setElement1661
-
FOLLOW_CHAR_RANGE_in_setElement1667
-
FOLLOW_CHAR_LITERAL_in_setElement1669
-
FOLLOW_CHAR_LITERAL_in_setElement1671
-
FOLLOW_REWRITES_in_rewrite1696
-
FOLLOW_REWRITE_in_rewrite1717
-
FOLLOW_SEMPRED_in_rewrite1722
-
FOLLOW_rewrite_alternative_in_rewrite1728
-
FOLLOW_BLOCK_in_rewrite_block1771
-
FOLLOW_rewrite_alternative_in_rewrite_block1783
-
FOLLOW_EOB_in_rewrite_block1788
-
FOLLOW_ALT_in_rewrite_alternative1823
-
FOLLOW_rewrite_element_in_rewrite_alternative1841
-
FOLLOW_EPSILON_in_rewrite_alternative1862
-
FOLLOW_EOA_in_rewrite_alternative1878
-
FOLLOW_rewrite_template_in_rewrite_alternative1891
-
FOLLOW_ETC_in_rewrite_alternative1904
-
FOLLOW_rewrite_atom_in_rewrite_element1924
-
FOLLOW_rewrite_ebnf_in_rewrite_element1934
-
FOLLOW_rewrite_tree_in_rewrite_element1943
-
FOLLOW_OPTIONAL_in_rewrite_ebnf1964
-
FOLLOW_rewrite_block_in_rewrite_ebnf1966
-
FOLLOW_CLOSURE_in_rewrite_ebnf1984
-
FOLLOW_rewrite_block_in_rewrite_ebnf1986
-
FOLLOW_POSITIVE_CLOSURE_in_rewrite_ebnf2004
-
FOLLOW_rewrite_block_in_rewrite_ebnf2006
-
FOLLOW_TREE_BEGIN_in_rewrite_tree2039
-
FOLLOW_rewrite_atom_in_rewrite_tree2046
-
FOLLOW_rewrite_element_in_rewrite_tree2066
-
FOLLOW_RULE_REF_in_rewrite_atom2111
-
FOLLOW_TOKEN_REF_in_rewrite_atom2128
-
FOLLOW_ARG_ACTION_in_rewrite_atom2133
-
FOLLOW_CHAR_LITERAL_in_rewrite_atom2144
-
FOLLOW_STRING_LITERAL_in_rewrite_atom2152
-
FOLLOW_LABEL_in_rewrite_atom2166
-
FOLLOW_ACTION_in_rewrite_atom2176
-
FOLLOW_ALT_in_rewrite_template2199
-
FOLLOW_EPSILON_in_rewrite_template2201
-
FOLLOW_EOA_in_rewrite_template2203
-
FOLLOW_TEMPLATE_in_rewrite_template2214
-
FOLLOW_ID_in_rewrite_template2219
-
FOLLOW_ACTION_in_rewrite_template2223
-
FOLLOW_ARGLIST_in_rewrite_template2236
-
FOLLOW_ARG_in_rewrite_template2246
-
FOLLOW_ID_in_rewrite_template2250
-
FOLLOW_ACTION_in_rewrite_template2254
-
FOLLOW_DOUBLE_QUOTE_STRING_LITERAL_in_rewrite_template2287
-
FOLLOW_DOUBLE_ANGLE_STRING_LITERAL_in_rewrite_template2300
-
FOLLOW_ACTION_in_rewrite_template2324
-
FOLLOW_set_in_synpred1_CodeGenTreeWalker1009
-
FOLLOW_element_action_in_synpred2_CodeGenTreeWalker1405
-
-
Constructor Details
-
CodeGenTreeWalker
-
-
Method Details
-
getDelegates
-
getTokenNames
Description copied from class:BaseRecognizer
Used to print out token names like ID during debugging and error reporting. The generated parsers implement a method that overrides this to point to their String[] tokenNames.- Overrides:
getTokenNames
in classBaseRecognizer
-
getGrammarFileName
Description copied from class:BaseRecognizer
For debugging and other purposes, might want the grammar name. Have ANTLR generate an implementation for this method.- Overrides:
getGrammarFileName
in classBaseRecognizer
-
getCurrentRuleName
-
setCurrentRuleName
-
getOuterAltNum
public int getOuterAltNum() -
setOuterAltNum
public void setOuterAltNum(int value) -
reportError
Description copied from class:BaseRecognizer
Report a recognition problem. This method sets errorRecovery to indicate the parser is recovering not parsing. Once in recovery mode, no errors are generated. To get out of recovery mode, the parser must successfully match a token (after a resync). So it will go: 1. error occurs 2. enter recovery mode, report error 3. consume until token found in resynch set 4. try to resume parsing 5. next match() will reset errorRecovery mode If you override, make sure to update syntaxErrors if you care about that.- Overrides:
reportError
in classBaseRecognizer
-
reportError
-
getWildcardST
protected final org.stringtemplate.v4.ST getWildcardST(GrammarAST elementAST, GrammarAST ast_suffix, String label) -
getRuleElementST
protected final org.stringtemplate.v4.ST getRuleElementST(String name, String ruleTargetName, GrammarAST elementAST, GrammarAST ast_suffix, String label) -
getTokenElementST
protected final org.stringtemplate.v4.ST getTokenElementST(String name, String elementName, GrammarAST elementAST, GrammarAST ast_suffix, String label) -
isListLabel
-
getSTSuffix
Return a non-empty template name suffix if the token is to be tracked, added to a tree, or both. -
getTokenTypesAsTargetLabels
Convert rewrite AST lists to target labels list -
init
-
grammar_
public final void grammar_(Grammar g, org.stringtemplate.v4.ST recognizerST, org.stringtemplate.v4.ST outputFileST, org.stringtemplate.v4.ST headerFileST) throws RecognitionException - Throws:
RecognitionException
-
attrScope
- Throws:
RecognitionException
-
grammarSpec
- Throws:
RecognitionException
-
rules
- Throws:
RecognitionException
-
rule
- Throws:
RecognitionException
-
modifier
- Throws:
RecognitionException
-
throwsSpec
- Throws:
RecognitionException
-
ruleScopeSpec
- Throws:
RecognitionException
-
block
public final CodeGenTreeWalker.block_return block(String blockTemplateName, DFA dfa, GrammarAST label) throws RecognitionException - Throws:
RecognitionException
-
setBlock
- Throws:
RecognitionException
-
setAlternative
- Throws:
RecognitionException
-
exceptionGroup
- Throws:
RecognitionException
-
exceptionHandler
- Throws:
RecognitionException
-
finallyClause
- Throws:
RecognitionException
-
alternative
public final CodeGenTreeWalker.alternative_return alternative(GrammarAST label) throws RecognitionException - Throws:
RecognitionException
-
element
public final CodeGenTreeWalker.element_return element(GrammarAST label, GrammarAST astSuffix) throws RecognitionException - Throws:
RecognitionException
-
element_action
- Throws:
RecognitionException
-
notElement
public final org.stringtemplate.v4.ST notElement(GrammarAST n, GrammarAST label, GrammarAST astSuffix) throws RecognitionException - Throws:
RecognitionException
-
ebnf
- Throws:
RecognitionException
-
tree_
- Throws:
RecognitionException
-
atom
public final CodeGenTreeWalker.atom_return atom(GrammarAST scope, GrammarAST label, GrammarAST astSuffix) throws RecognitionException - Throws:
RecognitionException
-
ast_suffix
- Throws:
RecognitionException
-
set
public final org.stringtemplate.v4.ST set(GrammarAST label, GrammarAST astSuffix) throws RecognitionException - Throws:
RecognitionException
-
setElement
- Throws:
RecognitionException
-
rewrite
- Throws:
RecognitionException
-
rewrite_block
public final org.stringtemplate.v4.ST rewrite_block(String blockTemplateName) throws RecognitionException - Throws:
RecognitionException
-
rewrite_alternative
- Throws:
RecognitionException
-
rewrite_element
- Throws:
RecognitionException
-
rewrite_ebnf
- Throws:
RecognitionException
-
rewrite_tree
- Throws:
RecognitionException
-
rewrite_atom
public final CodeGenTreeWalker.rewrite_atom_return rewrite_atom(boolean isRoot) throws RecognitionException - Throws:
RecognitionException
-
rewrite_template
- Throws:
RecognitionException
-
synpred1_CodeGenTreeWalker_fragment
- Throws:
RecognitionException
-
synpred2_CodeGenTreeWalker_fragment
- Throws:
RecognitionException
-
synpred2_CodeGenTreeWalker
public final boolean synpred2_CodeGenTreeWalker() -
synpred1_CodeGenTreeWalker
public final boolean synpred1_CodeGenTreeWalker()
-