|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdk.brics.string.grammar.Grammar
public class Grammar
Context-free grammar with regular operations.
Constructor Summary | |
---|---|
Grammar()
Constructs new empty grammar. |
Method Summary | |
---|---|
void |
addAutomatonProduction(Nonterminal a,
Automaton reg)
Adds new automaton production [a -> reg]. |
void |
addBinaryProduction(Nonterminal a,
BinaryOperation op,
Nonterminal b,
Nonterminal c)
Adds new binary operation production [a -> op2(b,c)]. |
void |
addEpsilonProduction(Nonterminal a)
Adds new epsilon production [a -> ""]. |
Nonterminal |
addNonterminal()
Adds new nonterminal. |
void |
addPairProduction(Nonterminal a,
Nonterminal b,
Nonterminal c)
Adds new pair production [a -> b c]. |
void |
addUnaryProduction(Nonterminal a,
UnaryOperation op,
Nonterminal b)
Adds new unary operation production [a -> op1(b)]. |
void |
addUnitProduction(Nonterminal a,
Nonterminal b)
Adds new unit production [a -> b]. |
void |
approximateNonLinear(Collection<Nonterminal> hotspots)
See RegularApproximation . |
void |
approximateOperationCycles()
Breaks operation cycles using AssertionCycleApproximation and then
approximates the remaining operation cycles with OperationCycleApproximation . |
String |
getCharsets()
See OperationCycleApproximation.getCharsets() . |
StronglyConnectedComponents<Nonterminal,Component> |
getComponents(boolean find_recursion_kinds)
Finds the strongly connected components and their recursion kinds. |
List<Nonterminal> |
getNonterminals()
Returns the (unmodifiable) list of nonterminals in this grammar. |
int |
getNumberOfComponents()
Returns number of components. |
int |
getNumberOfNonLinearComponents()
Returns number of non-linear components. |
int |
getNumberOfNonterminals()
Returns number of nonterminals in this grammar. |
int |
getNumberOfOperationCycles()
See OperationCycleApproximation.countCycles() . |
int |
getNumberOfProductions()
Returns number of productions in this grammar. |
String |
toString()
Returns string representation of this grammar. |
void |
visitProductions(ProductionVisitor v)
Visits all productions with the given visitor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Grammar()
Method Detail |
---|
public void addAutomatonProduction(Nonterminal a, Automaton reg)
public void addBinaryProduction(Nonterminal a, BinaryOperation op, Nonterminal b, Nonterminal c)
public void addEpsilonProduction(Nonterminal a)
public Nonterminal addNonterminal()
public void addPairProduction(Nonterminal a, Nonterminal b, Nonterminal c)
public void addUnaryProduction(Nonterminal a, UnaryOperation op, Nonterminal b)
public void addUnitProduction(Nonterminal a, Nonterminal b)
public void approximateNonLinear(Collection<Nonterminal> hotspots)
RegularApproximation
.
public void approximateOperationCycles()
AssertionCycleApproximation
and then
approximates the remaining operation cycles with OperationCycleApproximation
.
public String getCharsets()
OperationCycleApproximation.getCharsets()
.
public StronglyConnectedComponents<Nonterminal,Component> getComponents(boolean find_recursion_kinds)
public List<Nonterminal> getNonterminals()
public int getNumberOfComponents()
public int getNumberOfNonLinearComponents()
public int getNumberOfNonterminals()
public int getNumberOfOperationCycles()
OperationCycleApproximation.countCycles()
.
public int getNumberOfProductions()
public String toString()
toString
in class Object
public void visitProductions(ProductionVisitor v)
|
||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |