|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectxtc.tree.Visitor
xtc.parser.TextTester
public class TextTester
Visitor to identify text-only productions. A production is
text-only if it does not define a semantic value beyond declaring a
string value and references only other text-only productions (if
any). Notably, a text-only production may not contain parser
actions, semantic actions that reference CodeGenerator.VALUE, or bindings to CodeGenerator.VALUE.
Note that this visitor only detects such productions but does not
add appropriate value elements.
Transformer| Field Summary | |
|---|---|
protected Analyzer |
analyzer
The analyzer utility. |
protected boolean |
isTextOnly
Flag for whether the current production is text-only. |
protected Runtime |
runtime
The runtime. |
| Constructor Summary | |
|---|---|
TextTester(Runtime runtime,
Analyzer analyzer)
Create a new text tester. |
|
| Method Summary | |
|---|---|
static void |
markTextOnly(Production p,
boolean verbose)
Mark the specified production as text-only. |
void |
visit(Action a)
Visit the specified action. |
void |
visit(Binding b)
Visit the specified binding. |
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(Grammar g)
Visit the specified grammar. |
void |
visit(Module m)
Visit the specified grammar. |
void |
visit(NodeMarker m)
Visit the specified node marker. |
void |
visit(NonTerminal nt)
Visit the specified nonterminal. |
void |
visit(NullLiteral l)
Visit the specified null literal. |
void |
visit(OrderedChoice c)
Visit the specified ordered choice. |
void |
visit(ParserAction pa)
Visit the specified parser action. |
void |
visit(Predicate p)
Visit the specified predicate. |
void |
visit(Production p)
Visit the specified production. |
void |
visit(Sequence s)
Visit the specified sequence. |
void |
visit(Terminal t)
Visit the specified terminal. |
void |
visit(UnaryOperator op)
Visit the specified unary operator. |
| Methods inherited from class xtc.tree.Visitor |
|---|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visit |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Runtime runtime
protected final Analyzer analyzer
protected boolean isTextOnly
| Constructor Detail |
|---|
public TextTester(Runtime runtime,
Analyzer analyzer)
runtime - The runtime.analyzer - The analyzer utility.| Method Detail |
|---|
public void visit(Grammar g)
public void visit(Module m)
public void visit(Production p)
public void visit(OrderedChoice c)
public void visit(Sequence s)
public void visit(Predicate p)
public void visit(Binding b)
public void visit(NonTerminal nt)
public void visit(CharCase c)
public void visit(CharSwitch s)
public void visit(Terminal t)
public void visit(UnaryOperator op)
public void visit(NullLiteral l)
public void visit(NodeMarker m)
public void visit(Action a)
public void visit(ParserAction pa)
public void visit(Element e)
public static void markTextOnly(Production p,
boolean verbose)
p - The production.verbose - The flag for whether to be verbose.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||