public class CostEstimator extends Visitor
Integer.MAX_VALUE. This visitor must be invoked by
visiting a grammar, which clears any previous cost estimates and
annotates each production with its estimated cost.
This visitor assumes that the entire grammar is contained in a
single module.| Modifier and Type | Field and Description |
|---|---|
protected Analyzer |
analyzer
The analyzer utility.
|
| Constructor and Description |
|---|
CostEstimator(Analyzer analyzer)
Create a new cost estimator.
|
| Modifier and Type | Method and Description |
|---|---|
protected static int |
add(int e1,
int e2)
Add the two specified estimates.
|
java.lang.Integer |
visit(Action a)
Visit the specified action.
|
java.lang.Integer |
visit(ActionBaseValue v)
Visit the specified action base value.
|
java.lang.Integer |
visit(Binding b)
Visit the specified binding.
|
java.lang.Integer |
visit(CharCase c)
Visit the specified character case.
|
java.lang.Integer |
visit(CharSwitch sw)
Visit the specified character switch.
|
java.lang.Integer |
visit(GenericActionValue v)
Visit the specified generic action value.
|
java.lang.Integer |
visit(GenericNodeValue v)
Visit the specified generic node value.
|
java.lang.Integer |
visit(GenericRecursionValue v)
Visit the specified generic recursion value.
|
void |
visit(Module m)
Visit the specified grammar.
|
java.lang.Integer |
visit(NodeMarker m)
Visit the specified node marker.
|
java.lang.Integer |
visit(NonTerminal nt)
Visit the specified nonterminal.
|
java.lang.Integer |
visit(NullLiteral l)
Visit the specified null literal.
|
java.lang.Integer |
visit(Option o)
Visit the specified option.
|
java.lang.Integer |
visit(OrderedChoice c)
Visit the specified ordered choice.
|
java.lang.Integer |
visit(ParserAction a)
Visit the specified parser action.
|
java.lang.Integer |
visit(Predicate p)
Visit the specified predicate.
|
java.lang.Integer |
visit(Production p)
Visit the specified production.
|
java.lang.Integer |
visit(ProperListValue v)
Visit the specified proper list value.
|
java.lang.Integer |
visit(Repetition r)
Visit the specified repetition.
|
java.lang.Integer |
visit(Sequence s)
Visit the specified sequence.
|
java.lang.Integer |
visit(StringLiteral l)
Visit the specified string literal.
|
java.lang.Integer |
visit(StringMatch m)
Visit the specified string match.
|
java.lang.Integer |
visit(StringValue v)
Visit the specified string value.
|
java.lang.Integer |
visit(Terminal t)
Visit the specified terminal.
|
java.lang.Integer |
visit(ValueElement v)
Visit the specified value element.
|
java.lang.Integer |
visit(VoidedElement v)
Visit the specified voided element.
|
dispatch, equals, hashCode, iterate, map, mapInPlace, unableToVisit, visitprotected final Analyzer analyzer
public CostEstimator(Analyzer analyzer)
analyzer - The analyzer utility.public void visit(Module m)
public java.lang.Integer visit(Production p)
public java.lang.Integer visit(OrderedChoice c)
public java.lang.Integer visit(Repetition r)
public java.lang.Integer visit(Option o)
public java.lang.Integer visit(Sequence s)
public java.lang.Integer visit(Predicate p)
public java.lang.Integer visit(VoidedElement v)
public java.lang.Integer visit(Binding b)
public java.lang.Integer visit(StringMatch m)
public java.lang.Integer visit(NonTerminal nt)
public java.lang.Integer visit(StringLiteral l)
public java.lang.Integer visit(CharCase c)
public java.lang.Integer visit(CharSwitch sw)
public java.lang.Integer visit(Terminal t)
public java.lang.Integer visit(NodeMarker m)
public java.lang.Integer visit(Action a)
public java.lang.Integer visit(ParserAction a)
public java.lang.Integer visit(NullLiteral l)
public java.lang.Integer visit(StringValue v)
public java.lang.Integer visit(ProperListValue v)
public java.lang.Integer visit(ActionBaseValue v)
public java.lang.Integer visit(GenericNodeValue v)
public java.lang.Integer visit(GenericActionValue v)
public java.lang.Integer visit(GenericRecursionValue v)
public java.lang.Integer visit(ValueElement v)
protected static int add(int e1,
int e2)
e1 - The first estimate.e2 - The second estimate.Copyright © 2014. All Rights Reserved.