public class ProductionPatternAlternative
extends java.lang.Object
Constructor and Description |
---|
ProductionPatternAlternative() |
Modifier and Type | Method and Description |
---|---|
void |
addElement(ProductionPatternElement elem)
Adds a production pattern element to this alternative.
|
void |
addElement(ProductionPatternElement elem,
int min,
int max)
Adds a production pattern element to this alternative.
|
void |
addProduction(int id,
int min,
int max)
Adds a production to this alternative.
|
void |
addToken(int id,
int min,
int max)
Adds a token to this alternative.
|
boolean |
equals(java.lang.Object obj)
Checks if this object is equal to another.
|
ProductionPatternElement |
getElement(int pos)
Returns an element in this alternative.
|
int |
getElementCount()
Returns the number of elements in this alternative.
|
int |
getMaxElementCount()
Returns the maximum number of elements needed to satisfy this
alternative.
|
int |
getMinElementCount()
Returns the minimum number of elements needed to satisfy this
alternative.
|
ProductionPattern |
getPattern()
Returns the production pattern containing this alternative.
|
int |
hashCode()
Returns a hash code for this object.
|
boolean |
isLeftRecursive()
Checks if this alternative is recursive on the left-hand side.
|
boolean |
isMatchingEmpty()
Checks if this alternative would match an empty stream of
tokens.
|
boolean |
isRightRecursive()
Checks if this alternative is recursive on the right-hand side.
|
java.lang.String |
toString()
Returns a string representation of this object.
|
public boolean isLeftRecursive()
public boolean isRightRecursive()
public boolean isMatchingEmpty()
public ProductionPattern getPattern()
public int getElementCount()
public int getMinElementCount()
public int getMaxElementCount()
public ProductionPatternElement getElement(int pos)
pos
- the element position, starting at 0public void addToken(int id, int min, int max)
id
- the token (pattern) idmin
- the minimum number of occuranciesmax
- the maximum number of occurancies, or
-1 for infinitepublic void addProduction(int id, int min, int max)
id
- the production (pattern) idmin
- the minimum number of occuranciesmax
- the maximum number of occurancies, or
-1 for infinitepublic void addElement(ProductionPatternElement elem)
elem
- the production pattern elementpublic void addElement(ProductionPatternElement elem, int min, int max)
elem
- the production pattern elementmin
- the minimum number of occuranciesmax
- the maximum number of occurancies, or
-1 for infinitepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to compare withpublic int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object