|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.percederberg.grammatica.parser.ProductionPattern
public class ProductionPattern
A production pattern. This class represents a set of production alternatives that together forms a single production. A production pattern is identified by an integer id and a name, both provided upon creation. The pattern id is used for referencing the production pattern from production pattern elements.
| Constructor Summary | |
|---|---|
ProductionPattern(int id,
java.lang.String name)
Creates a new production pattern. |
|
| Method Summary | |
|---|---|
void |
addAlternative(ProductionPatternAlternative alt)
Adds a production pattern alternative. |
ProductionPatternAlternative |
getAlternative(int pos)
Returns an alternative in this pattern. |
int |
getAlternativeCount()
Returns the number of alternatives in this pattern. |
int |
getId()
Returns the unique production pattern identity value. |
java.lang.String |
getName()
Returns the production pattern name. |
boolean |
isLeftRecursive()
Checks if this pattern is recursive on the left-hand side. |
boolean |
isMatchingEmpty()
Checks if this pattern would match an empty stream of tokens. |
boolean |
isRightRecursive()
Checks if this pattern is recursive on the right-hand side. |
boolean |
isSyntetic()
Deprecated. Use the isSynthetic() method instead. This method name contained a spelling error. |
boolean |
isSynthetic()
Checks if the synthetic production flag is set. |
void |
setSyntetic(boolean synthetic)
Deprecated. Use the setSynthetic() method instead. This method name contained a spelling error. |
void |
setSynthetic(boolean synthetic)
Sets the synthetic production pattern flag. |
java.lang.String |
toString()
Returns a string representation of this object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ProductionPattern(int id,
java.lang.String name)
id - the production pattern idname - the production pattern name| Method Detail |
|---|
public boolean isSynthetic()
public boolean isSyntetic()
public boolean isLeftRecursive()
public boolean isRightRecursive()
public boolean isMatchingEmpty()
public int getId()
public java.lang.String getName()
public void setSynthetic(boolean synthetic)
synthetic - the new value of the synthetic flagpublic void setSyntetic(boolean synthetic)
synthetic - the new value of the synthetic flagpublic int getAlternativeCount()
public ProductionPatternAlternative getAlternative(int pos)
pos - the alternative position, 0 <= pos < count
public void addAlternative(ProductionPatternAlternative alt)
throws ParserCreationException
alt - the production pattern alternative to add
ParserCreationException - if an identical alternative has
already been addedpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||