|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--net.percederberg.grammatica.parser.ProductionPatternElement
A production pattern element. This class represents a reference to either a token or a production. Each element also contains minimum and maximum occurence counters, controlling the number of repetitions allowed. A production pattern element is always contained within a production pattern rule.
| Constructor Summary | |
ProductionPatternElement(boolean isToken,
int id,
int min,
int max)
Creates a new element. |
|
| Method Summary | |
int |
getId()
Returns the node identity. |
int |
getMaxCount()
Returns the maximum occurence count. |
int |
getMinCount()
Returns the minimum occurence count. |
boolean |
isMatch(Token token)
Checks if a specific token matches this element. |
boolean |
isProduction()
Returns true if this element represents a production. |
boolean |
isToken()
Returns true if this element represents a token. |
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 ProductionPatternElement(boolean isToken,
int id,
int min,
int max)
isToken - the token flagid - the node identitymin - the minimum number of occuranciesmax - the maximum number of occurancies, or
negative for infinite| Method Detail |
public boolean isToken()
public boolean isProduction()
public boolean isMatch(Token token)
token - the token to check
public int getId()
public int getMinCount()
public int getMaxCount()
public 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 | ||||||||||