public class CodeGenTreeWalker extends antlr.TreeParser implements CodeGenTreeWalkerTokenTypes
Modifier and Type | Field and Description |
---|---|
static String[] |
_tokenNames |
protected int |
blockNestingLevel |
protected boolean |
currentAltHasASTRewrite |
protected org.antlr.stringtemplate.StringTemplate |
currentBlockST |
protected String |
currentRuleName |
protected CodeGenerator |
generator |
protected Grammar |
grammar |
protected org.antlr.stringtemplate.StringTemplate |
headerFileST |
protected static int |
OUTER_REWRITE_NESTING_LEVEL |
protected int |
outerAltNum |
protected org.antlr.stringtemplate.StringTemplate |
outputFileST |
protected String |
outputOption |
protected org.antlr.stringtemplate.StringTemplate |
recognizerST
The overall lexer/parser template; simulate dynamically scoped
attributes by making this an instance var of the walker.
|
protected int |
rewriteBlockNestingLevel |
protected Set |
rewriteRuleRefs |
protected int |
rewriteTreeNestingLevel |
protected static int |
RULE_BLOCK_NESTING_LEVEL |
protected org.antlr.stringtemplate.StringTemplateGroup |
templates |
_retTree, astFactory, ASTNULL, inputState, returnAST, tokenNames, traceDepth
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 and Description |
---|
CodeGenTreeWalker() |
Modifier and Type | Method and Description |
---|---|
org.antlr.stringtemplate.StringTemplate |
alternative(antlr.collections.AST _t) |
void |
ast_suffix(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
atom(antlr.collections.AST _t,
GrammarAST scope,
GrammarAST label,
GrammarAST astSuffix) |
void |
attrScope(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
block(antlr.collections.AST _t,
String blockTemplateName,
DFA dfa) |
org.antlr.stringtemplate.StringTemplate |
ebnf(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
element_action(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
element(antlr.collections.AST _t,
GrammarAST label,
GrammarAST astSuffix) |
void |
exceptionGroup(antlr.collections.AST _t,
org.antlr.stringtemplate.StringTemplate ruleST) |
void |
exceptionHandler(antlr.collections.AST _t,
org.antlr.stringtemplate.StringTemplate ruleST) |
void |
finallyClause(antlr.collections.AST _t,
org.antlr.stringtemplate.StringTemplate ruleST) |
String |
getCurrentRuleName() |
int |
getOuterAltNum() |
protected org.antlr.stringtemplate.StringTemplate |
getRuleElementST(String name,
String ruleTargetName,
GrammarAST elementAST,
GrammarAST ast_suffix,
String label) |
protected 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 org.antlr.stringtemplate.StringTemplate |
getTokenElementST(String name,
String elementName,
GrammarAST elementAST,
GrammarAST ast_suffix,
String label) |
protected List<String> |
getTokenTypesAsTargetLabels(Set<GrammarAST> refs)
Convert rewrite AST lists to target labels list
|
protected org.antlr.stringtemplate.StringTemplate |
getWildcardST(GrammarAST elementAST,
GrammarAST ast_suffix,
String label) |
void |
grammar(antlr.collections.AST _t,
Grammar g,
org.antlr.stringtemplate.StringTemplate recognizerST,
org.antlr.stringtemplate.StringTemplate outputFileST,
org.antlr.stringtemplate.StringTemplate headerFileST) |
void |
grammarSpec(antlr.collections.AST _t) |
void |
init(Grammar g) |
boolean |
isListLabel(String label) |
void |
modifier(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
notElement(antlr.collections.AST _t,
GrammarAST n,
GrammarAST label,
GrammarAST astSuffix) |
void |
reportError(antlr.RecognitionException ex) |
void |
reportError(String s) |
org.antlr.stringtemplate.StringTemplate |
rewrite_alternative(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rewrite_atom(antlr.collections.AST _t,
boolean isRoot) |
org.antlr.stringtemplate.StringTemplate |
rewrite_block(antlr.collections.AST _t,
String blockTemplateName) |
org.antlr.stringtemplate.StringTemplate |
rewrite_ebnf(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rewrite_element(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rewrite_template(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rewrite_tree(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rewrite(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
rule(antlr.collections.AST _t) |
void |
rules(antlr.collections.AST _t,
org.antlr.stringtemplate.StringTemplate recognizerST) |
void |
ruleScopeSpec(antlr.collections.AST _t) |
org.antlr.stringtemplate.StringTemplate |
set(antlr.collections.AST _t,
GrammarAST label,
GrammarAST astSuffix) |
org.antlr.stringtemplate.StringTemplate |
setBlock(antlr.collections.AST _t) |
void |
setCurrentRuleName(String currentRuleName) |
void |
setElement(antlr.collections.AST _t) |
void |
setOuterAltNum(int outerAltNum) |
org.antlr.stringtemplate.StringTemplate |
tree(antlr.collections.AST _t) |
protected static final int RULE_BLOCK_NESTING_LEVEL
protected static final int OUTER_REWRITE_NESTING_LEVEL
protected String currentRuleName
protected int blockNestingLevel
protected int rewriteBlockNestingLevel
protected int outerAltNum
protected org.antlr.stringtemplate.StringTemplate currentBlockST
protected boolean currentAltHasASTRewrite
protected int rewriteTreeNestingLevel
protected Set rewriteRuleRefs
protected CodeGenerator generator
protected Grammar grammar
protected org.antlr.stringtemplate.StringTemplateGroup templates
protected org.antlr.stringtemplate.StringTemplate recognizerST
protected org.antlr.stringtemplate.StringTemplate outputFileST
protected org.antlr.stringtemplate.StringTemplate headerFileST
protected String outputOption
public static final String[] _tokenNames
public String getCurrentRuleName()
public void setCurrentRuleName(String currentRuleName)
public int getOuterAltNum()
public void setOuterAltNum(int outerAltNum)
public void reportError(antlr.RecognitionException ex)
reportError
in class antlr.TreeParser
public void reportError(String s)
reportError
in class antlr.TreeParser
protected org.antlr.stringtemplate.StringTemplate getWildcardST(GrammarAST elementAST, GrammarAST ast_suffix, String label)
protected org.antlr.stringtemplate.StringTemplate getRuleElementST(String name, String ruleTargetName, GrammarAST elementAST, GrammarAST ast_suffix, String label)
protected org.antlr.stringtemplate.StringTemplate getTokenElementST(String name, String elementName, GrammarAST elementAST, GrammarAST ast_suffix, String label)
public boolean isListLabel(String label)
protected String getSTSuffix(GrammarAST elementAST, GrammarAST ast_suffix, String label)
protected List<String> getTokenTypesAsTargetLabels(Set<GrammarAST> refs)
public void init(Grammar g)
public final void grammar(antlr.collections.AST _t, Grammar g, org.antlr.stringtemplate.StringTemplate recognizerST, org.antlr.stringtemplate.StringTemplate outputFileST, org.antlr.stringtemplate.StringTemplate headerFileST) throws antlr.RecognitionException
antlr.RecognitionException
public final void grammarSpec(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void attrScope(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void rules(antlr.collections.AST _t, org.antlr.stringtemplate.StringTemplate recognizerST) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rule(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void modifier(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void ruleScopeSpec(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate block(antlr.collections.AST _t, String blockTemplateName, DFA dfa) throws antlr.RecognitionException
antlr.RecognitionException
public final void exceptionGroup(antlr.collections.AST _t, org.antlr.stringtemplate.StringTemplate ruleST) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate setBlock(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate alternative(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void exceptionHandler(antlr.collections.AST _t, org.antlr.stringtemplate.StringTemplate ruleST) throws antlr.RecognitionException
antlr.RecognitionException
public final void finallyClause(antlr.collections.AST _t, org.antlr.stringtemplate.StringTemplate ruleST) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate element(antlr.collections.AST _t, GrammarAST label, GrammarAST astSuffix) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate notElement(antlr.collections.AST _t, GrammarAST n, GrammarAST label, GrammarAST astSuffix) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate ebnf(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate atom(antlr.collections.AST _t, GrammarAST scope, GrammarAST label, GrammarAST astSuffix) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate tree(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate element_action(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate set(antlr.collections.AST _t, GrammarAST label, GrammarAST astSuffix) throws antlr.RecognitionException
antlr.RecognitionException
public final void ast_suffix(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final void setElement(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_alternative(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_block(antlr.collections.AST _t, String blockTemplateName) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_element(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_template(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_atom(antlr.collections.AST _t, boolean isRoot) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_ebnf(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
public final org.antlr.stringtemplate.StringTemplate rewrite_tree(antlr.collections.AST _t) throws antlr.RecognitionException
antlr.RecognitionException
Copyright © 2020. All rights reserved.