|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.chaperon.model.extended.ExtendedGrammar
This class represents a model for a grammar. The content of the grammar includes the definitions, start symbol, associativities and priorities.
Constructor Summary | |
ExtendedGrammar()
Creates an empty grammar. |
Method Summary | |
void |
addDefinition(Definition definition)
Add a definition to this grammar. |
java.lang.Object |
clone()
Creates a clone of this grammar. |
PatternSet |
getAllPattern()
|
Definition |
getDefinition(int index)
Return a definition giving by an index. |
Definition |
getDefinition(java.lang.String symbol)
Returns all definition for given nonterminal symbol as a list of indices. |
int |
getDefinitionCount()
Returns the count of definitions in this grammar. |
Definition[] |
getDefinitions()
|
Pattern |
getEndPattern()
|
PatternSet |
getFirstSet()
|
PatternSet |
getFirstSet(java.lang.String symbol)
|
PatternSet |
getLastSet()
|
PatternSet |
getLastSet(java.lang.String symbol)
|
java.lang.String |
getLocation()
Returns the location from the input source. |
Pattern |
getStartPattern()
|
java.lang.String |
getStartSymbol()
Return the start symbol. |
boolean |
isNullable(java.lang.String symbol)
|
void |
setLocation(java.lang.String location)
Set the location from the input source. |
void |
setStartSymbol(java.lang.String symbol)
Set the start symbol for this grammar. |
java.lang.String |
toString()
Return a string representation of the grammar. |
java.lang.String |
toString(PatternSet previous,
PatternSet next)
|
void |
update()
|
void |
updateAscendingSuccessors()
|
void |
updateDescendingSuccessors()
|
Violations |
validate()
Validated the grammar. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ExtendedGrammar()
Method Detail |
public void addDefinition(Definition definition)
definition
- Definition, which should be added.
public Definition getDefinition(int index)
index
- Index of the Definition.
public Definition getDefinition(java.lang.String symbol)
public Definition[] getDefinitions()
public int getDefinitionCount()
public PatternSet getAllPattern()
public void update()
public void updateAscendingSuccessors()
public boolean isNullable(java.lang.String symbol)
public PatternSet getFirstSet(java.lang.String symbol)
public PatternSet getFirstSet()
public PatternSet getLastSet(java.lang.String symbol)
public PatternSet getLastSet()
public void updateDescendingSuccessors()
public void setStartSymbol(java.lang.String symbol)
public java.lang.String getStartSymbol()
public Pattern getStartPattern()
public Pattern getEndPattern()
public void setLocation(java.lang.String location)
location
- Location in the input source.public java.lang.String getLocation()
public Violations validate()
public java.lang.String toString()
public java.lang.String toString(PatternSet previous, PatternSet next)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
java.lang.CloneNotSupportedException
- If an exception occurs during the cloning.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |