public class ProductionPattern
extends java.lang.Object
Constructor and Description |
---|
ProductionPattern(int id,
java.lang.String name)
Creates a new production pattern.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public ProductionPattern(int id, java.lang.String name)
id
- the production pattern idname
- the production pattern namepublic 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, starting at 0public void addAlternative(ProductionPatternAlternative alt) throws ParserCreationException
alt
- the production pattern alternative to addParserCreationException
- if an identical alternative has
already been addedpublic java.lang.String toString()
toString
in class java.lang.Object