|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectdk.brics.servletvalidator.grammar.Grammar
public class Grammar
A context free grammar is a quadtuple (V, Σ, S, P), where
| Constructor Summary | |
|---|---|
Grammar(dk.brics.automaton.Automaton a)
|
|
Grammar(dk.brics.automaton.Automaton a,
boolean lenient)
|
|
Grammar(FlowGraph f,
String methodName,
boolean lenient)
|
|
Grammar(NonTerminal n)
|
|
| Method Summary | |
|---|---|
void |
apply(GrammarEntityVisitor v)
Applies the visitor to the grammar. |
Set<Terminal> |
getEpsilon()
Gets the set Ε of all terminals from the grammar. |
Map<NonTerminal,List<Production>> |
getP()
The map from all nonterminals to their productions P. |
Set<NonTerminal> |
getS()
Returns the set of start non terminals S |
Set<AlphabetSymbol> |
getU()
Gets the set of all terminals and non terminal. |
Set<NonTerminal> |
getV()
Gets the set of all nonterminals. |
void |
reduce()
Removes nodes in the graph by removing all nonterminals with only one production using. |
void |
simplify()
Removes epsilon productions from the language using EpsilonRemovalVisitor, then removes unit productions
using UnitProductionRemovalVisitor, finally removes useless productions using UselessProductionRemovalVisitor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Grammar(dk.brics.automaton.Automaton a)
public Grammar(dk.brics.automaton.Automaton a,
boolean lenient)
public Grammar(FlowGraph f,
String methodName,
boolean lenient)
public Grammar(NonTerminal n)
| Method Detail |
|---|
public void apply(GrammarEntityVisitor v)
v - the visitor to applypublic Set<Terminal> getEpsilon()
public Map<NonTerminal,List<Production>> getP()
public Set<NonTerminal> getS()
public Set<AlphabetSymbol> getU()
public Set<NonTerminal> getV()
public void reduce()
SingleProductionNonTerminalRemovalVisitor
public void simplify()
EpsilonRemovalVisitor, then removes unit productions
using UnitProductionRemovalVisitor, finally removes useless productions using UselessProductionRemovalVisitor
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||