| org.antlr.codegen.CodeGenTreeWalker
CodeGenTreeWalker | public class CodeGenTreeWalker extends antlr.TreeParser implements CodeGenTreeWalkerTokenTypes(Code) | | Walk a grammar and generate code by gradually building up
a bigger and bigger StringTemplate.
Terence Parr
University of San Francisco
June 15, 2004
|
Method Summary | |
final public StringTemplate | alternative(AST _t) | final public void | ast_suffix(AST _t) | final public StringTemplate | atom(AST _t, GrammarAST label, GrammarAST astSuffix) | final public void | attrScope(AST _t) | final public StringTemplate | block(AST _t, String blockTemplateName, DFA dfa) | final public StringTemplate | ebnf(AST _t) | final public StringTemplate | element(AST _t, GrammarAST label, GrammarAST astSuffix) | final public StringTemplate | element_action(AST _t) | final public void | exceptionGroup(AST _t, StringTemplate ruleST) | final public void | exceptionHandler(AST _t, StringTemplate ruleST) | final public void | finallyClause(AST _t, StringTemplate ruleST) | protected StringTemplate | getRuleElementST(String name, String elementName, GrammarAST elementAST, GrammarAST ast_suffix, String label) | protected String | getSTSuffix(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 StringTemplate | getTokenElementST(String name, String elementName, GrammarAST elementAST, GrammarAST ast_suffix, String label) | protected List<String> | getTokenTypesAsTargetLabels(Set<GrammarAST> refs) | protected StringTemplate | getWildcardST(GrammarAST elementAST, GrammarAST ast_suffix, String label) | final public void | grammar(AST _t, Grammar g, StringTemplate recognizerST, StringTemplate outputFileST, StringTemplate headerFileST) | final public void | grammarSpec(AST _t) | protected void | init(Grammar g) | public boolean | isListLabel(String label) | final public void | modifier(AST _t) | final public StringTemplate | notElement(AST _t, GrammarAST n, GrammarAST label, GrammarAST astSuffix) | public void | reportError(RecognitionException ex) | public void | reportError(String s) | final public StringTemplate | rewrite(AST _t) | final public StringTemplate | rewrite_alternative(AST _t) | final public StringTemplate | rewrite_atom(AST _t, boolean isRoot) | final public StringTemplate | rewrite_block(AST _t, String blockTemplateName) | final public StringTemplate | rewrite_ebnf(AST _t) | final public StringTemplate | rewrite_element(AST _t) | final public StringTemplate | rewrite_template(AST _t) | final public StringTemplate | rewrite_tree(AST _t) | final public StringTemplate | rule(AST _t) | final public void | ruleScopeSpec(AST _t) | final public void | rules(AST _t, StringTemplate recognizerST) | final public StringTemplate | set(AST _t, GrammarAST label, GrammarAST astSuffix) | final public StringTemplate | setBlock(AST _t) | final public void | setElement(AST _t) | final public StringTemplate | tree(AST _t) |
OUTER_REWRITE_NESTING_LEVEL | final protected static int OUTER_REWRITE_NESTING_LEVEL(Code) | | |
RULE_BLOCK_NESTING_LEVEL | final protected static int RULE_BLOCK_NESTING_LEVEL(Code) | | |
blockNestingLevel | protected int blockNestingLevel(Code) | | |
currentAltHasASTRewrite | protected boolean currentAltHasASTRewrite(Code) | | |
currentBlockST | protected StringTemplate currentBlockST(Code) | | |
headerFileST | protected StringTemplate headerFileST(Code) | | |
outerAltNum | protected int outerAltNum(Code) | | |
outputFileST | protected StringTemplate outputFileST(Code) | | |
recognizerST | protected StringTemplate recognizerST(Code) | | The overall lexer/parser template; simulate dynamically scoped
attributes by making this an instance var of the walker.
|
rewriteBlockNestingLevel | protected int rewriteBlockNestingLevel(Code) | | |
rewriteRuleRefs | protected Set rewriteRuleRefs(Code) | | |
rewriteTreeNestingLevel | protected int rewriteTreeNestingLevel(Code) | | |
templates | protected StringTemplateGroup templates(Code) | | |
CodeGenTreeWalker | public CodeGenTreeWalker()(Code) | | |
alternative | final public StringTemplate alternative(AST _t) throws RecognitionException(Code) | | |
ast_suffix | final public void ast_suffix(AST _t) throws RecognitionException(Code) | | |
attrScope | final public void attrScope(AST _t) throws RecognitionException(Code) | | |
block | final public StringTemplate block(AST _t, String blockTemplateName, DFA dfa) throws RecognitionException(Code) | | |
ebnf | final public StringTemplate ebnf(AST _t) throws RecognitionException(Code) | | |
element_action | final public StringTemplate element_action(AST _t) throws RecognitionException(Code) | | |
exceptionGroup | final public void exceptionGroup(AST _t, StringTemplate ruleST) throws RecognitionException(Code) | | |
exceptionHandler | final public void exceptionHandler(AST _t, StringTemplate ruleST) throws RecognitionException(Code) | | |
finallyClause | final public void finallyClause(AST _t, StringTemplate ruleST) throws RecognitionException(Code) | | |
getSTSuffix | protected String getSTSuffix(GrammarAST ast_suffix, String label)(Code) | | Return a non-empty template name suffix if the token is to be
tracked, added to a tree, or both.
|
getTokenTypesAsTargetLabels | protected List<String> getTokenTypesAsTargetLabels(Set<GrammarAST> refs)(Code) | | Convert rewrite AST lists to target labels list
|
grammar | final public void grammar(AST _t, Grammar g, StringTemplate recognizerST, StringTemplate outputFileST, StringTemplate headerFileST) throws RecognitionException(Code) | | |
grammarSpec | final public void grammarSpec(AST _t) throws RecognitionException(Code) | | |
modifier | final public void modifier(AST _t) throws RecognitionException(Code) | | |
reportError | public void reportError(RecognitionException ex)(Code) | | |
rewrite | final public StringTemplate rewrite(AST _t) throws RecognitionException(Code) | | |
rewrite_alternative | final public StringTemplate rewrite_alternative(AST _t) throws RecognitionException(Code) | | |
rewrite_atom | final public StringTemplate rewrite_atom(AST _t, boolean isRoot) throws RecognitionException(Code) | | |
rewrite_block | final public StringTemplate rewrite_block(AST _t, String blockTemplateName) throws RecognitionException(Code) | | |
rewrite_ebnf | final public StringTemplate rewrite_ebnf(AST _t) throws RecognitionException(Code) | | |
rewrite_element | final public StringTemplate rewrite_element(AST _t) throws RecognitionException(Code) | | |
rewrite_template | final public StringTemplate rewrite_template(AST _t) throws RecognitionException(Code) | | |
rewrite_tree | final public StringTemplate rewrite_tree(AST _t) throws RecognitionException(Code) | | |
rule | final public StringTemplate rule(AST _t) throws RecognitionException(Code) | | |
ruleScopeSpec | final public void ruleScopeSpec(AST _t) throws RecognitionException(Code) | | |
rules | final public void rules(AST _t, StringTemplate recognizerST) throws RecognitionException(Code) | | |
setBlock | final public StringTemplate setBlock(AST _t) throws RecognitionException(Code) | | |
setElement | final public void setElement(AST _t) throws RecognitionException(Code) | | |
tree | final public StringTemplate tree(AST _t) throws RecognitionException(Code) | | |
|
|