public class TreeExtractor extends Visitor
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.| Modifier and Type | Field and Description |
|---|---|
protected Analyzer |
analyzer
The analyzer utility.
|
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.
|
protected boolean |
keepLexical
The flag for removing all elements from lexical productions.
|
protected Runtime |
runtime
The runtime.
|
protected boolean |
setsValue
The flag for whether the current production defines the semantic
value in an explicit action.
|
| Constructor and Description |
|---|
TreeExtractor(Runtime runtime,
Analyzer analyzer,
AST ast,
boolean keepLexical)
Create a new tree extractor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
visit(CharCase c)
Visit the specified character case.
|
void |
visit(CharSwitch s)
Visit the specified character switch.
|
void |
visit(Element e)
Visit the specified element.
|
void |
visit(FullProduction p)
Visit the specified full production.
|
void |
visit(Module m)
Visit the specified module.
|
void |
visit(OrderedChoice c)
Visit the specified ordered choice.
|
void |
visit(Sequence s)
Visit the specified sequence.
|
void |
visit(UnaryOperator op)
Visit the specified unary operator.
|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visitprotected final Runtime runtime
protected final Analyzer analyzer
protected final AST ast
protected final boolean keepLexical
protected boolean isGeneric
protected boolean isList
protected boolean isTextOnly
protected boolean isToken
protected boolean setsValue
public TreeExtractor(Runtime runtime, Analyzer analyzer, AST ast, boolean keepLexical)
runtime - The runtime.analyzer - The analyzer utility.ast - The type operations.keepLexical - The flag for keeping elements of text-only
or token-level productions.public void visit(Module m)
public void visit(FullProduction p)
public void visit(OrderedChoice c)
public void visit(Sequence s)
public void visit(CharCase c)
public void visit(CharSwitch s)
public void visit(UnaryOperator op)
public void visit(Element e)
Copyright © 2014. All Rights Reserved.