| |
|
| java.lang.Object xtc.tree.Visitor xtc.parser.TreeExtractor
TreeExtractor | public class TreeExtractor extends Visitor (Code) | | Visitor to pear down a grammar to the structure of its abstract
syntax tree. This visitor assumes that the entire grammar is
contained in a single module. It also assumes that directly
left-recursive generic productions have not been
transformed by
DirectLeftRecurser . Note that, after this
visitor has processed the grammar, the grammar violates the code
generator's requirements. Also note that this visitor internally
uses
Simplifier and
DeadProductionEliminator .
author: Robert Grimm version: $Revision: 1.11 $ |
Field Summary | |
final protected Analyzer | analyzer The analyzer utility. | final protected AST | ast The common type operations. | protected boolean | isGeneric The flag for whether the current production is generic. | protected boolean | isList The flag for whether the current production is list-valued. | protected boolean | isTextOnly The flag for whether the current production is text-only. | protected boolean | isToken The flag for whether the current production is token-level. | final protected boolean | keepLexical The flag for removing all elements from lexical productions. | final protected Runtime | runtime The runtime. | protected boolean | setsValue The flag for whether the current production defines the semantic
value in an explicit action. |
ast | final protected AST ast(Code) | | The common type operations.
|
isGeneric | protected boolean isGeneric(Code) | | The flag for whether the current production is generic.
|
isList | protected boolean isList(Code) | | The flag for whether the current production is list-valued.
|
isTextOnly | protected boolean isTextOnly(Code) | | The flag for whether the current production is text-only.
|
isToken | protected boolean isToken(Code) | | The flag for whether the current production is token-level.
|
keepLexical | final protected boolean keepLexical(Code) | | The flag for removing all elements from lexical productions.
|
setsValue | protected boolean setsValue(Code) | | The flag for whether the current production defines the semantic
value in an explicit action.
|
TreeExtractor | public TreeExtractor(Runtime runtime, Analyzer analyzer, AST ast, boolean keepLexical)(Code) | | Create a new tree extractor.
Parameters: runtime - The runtime. Parameters: analyzer - The analyzer utility. Parameters: ast - The type operations. Parameters: keepLexical - The flag for keeping elements of text-onlyor token-level productions. |
visit | public void visit(Module m)(Code) | | Visit the specified module.
|
visit | public void visit(Sequence s)(Code) | | Visit the specified sequence.
|
visit | public void visit(CharCase c)(Code) | | Visit the specified character case.
|
visit | public void visit(CharSwitch s)(Code) | | Visit the specified character switch.
|
visit | public void visit(Element e)(Code) | | Visit the specified element.
|
|
|
|