|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectdk.brics.servletvalidator.grammar.NonTerminal
public class NonTerminal
A Nonterminal in the grammar. It captures the type of the contents of the set V in the Grammar. Nonterminals are
mutable but the set of productions can be iterated safely while adding and removing using the methods in this class. The list
being iterated remains the same while the productions are updated. The set of productions is a set in the sense that
the same production can only be in this set once. The productions are however note required immutable or to have a fixed
hash code or equals result.
| Constructor Summary | |
|---|---|
NonTerminal()
Constructs a fresh non terminal |
|
NonTerminal(NonTerminal n)
Constructs a new nonterminal that will play the same role as n in the grammar, thus inheriting code locations and other meta information |
|
| Method Summary | |
|---|---|
void |
accept(GrammarEntityVisitor visitor)
Accepts the given grammar entity visitor in a visitor pattern |
void |
addAll(Collection<Production> productions)
Adds all productions in the list to the set of productions in |
void |
addProduction(Production production)
Adds a production to the set of productions. |
void |
ensureSet()
Ensure that there are no duplicate productions in the set of productions. |
CodeLocation |
getLocation()
|
List<Production> |
getProductions()
Returns a list of all productions from this nonterminal. |
boolean |
isTaint()
|
void |
removeProduction(Production production)
Removes a production from the set of productions |
void |
setLocation(CodeLocation location)
|
void |
setProductions(Collection<Production> productions)
Sets the set of productions the the contents of the given collection |
void |
setTaint(boolean taint)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NonTerminal()
public NonTerminal(NonTerminal n)
n - | Method Detail |
|---|
public void accept(GrammarEntityVisitor visitor)
GrammarEntity
accept in interface GrammarEntitypublic void addAll(Collection<Production> productions)
productions - public void addProduction(Production production)
production - public void ensureSet()
public CodeLocation getLocation()
public List<Production> getProductions()
unmodifiable.
Use the methods on NonTerminal to change the set of productions.
public boolean isTaint()
public void removeProduction(Production production)
production - public void setLocation(CodeLocation location)
public void setProductions(Collection<Production> productions)
productions - public void setTaint(boolean taint)
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||