|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgrammar.Production
public class Production
Production rules of context-free grammars
Constructor Summary | |
---|---|
Production()
Creates an empty instance of production |
|
Production(java.lang.String lhs,
java.lang.String rhs)
Creates an instance of production Tokens on the right hand side are delimited by blanks. |
|
Production(java.lang.String lhs,
java.lang.String[] rhs)
Creates an instance of production |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getLHS()
Returns the left hand side of the production rule. |
java.lang.String |
getRHS()
Returns the right hand side of the production rule. |
java.lang.String[] |
getRHSTerminals()
Returns all terminals at the right hand side of the production. |
int |
getRHSTokenNumber()
Returns the number of tokens at the right hand side |
java.lang.String[] |
getRHSTokens()
Returns all tokens at the right hand side of the production. |
java.lang.String[] |
getRHSVariables()
Returns all variables at the right hand side of the production. |
java.lang.String[] |
getTerminals()
Returns all terminals at the production. |
java.lang.String[] |
getVariables()
Returns all variables at the production. |
int |
hashCode()
|
void |
setLHS(java.lang.String lhs)
Sets the left hand side |
void |
setRHS(java.lang.String rhs)
Sets the right hand side (in string format) |
void |
setRHSTokens(java.lang.String[] rhs)
Sets the right hand tokens of a production. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Production()
public Production(java.lang.String lhs, java.lang.String[] rhs)
lhs
- the left hand side of the production rule, in string format.rhs
- the right hand side of the production rule, in tokens(string[]) format.public Production(java.lang.String lhs, java.lang.String rhs)
lhs
- the left hand side of the production rule, in string format.rhs
- the right hand side of the production rule, in string format.Method Detail |
---|
public java.lang.String getLHS()
public void setLHS(java.lang.String lhs)
lhs
- the left hand side to set
java.lang.IllegalArgumentException
- if lhs is not variablepublic java.lang.String getRHS()
public void setRHS(java.lang.String rhs)
rhs
- the right hand side to setpublic int getRHSTokenNumber()
public java.lang.String[] getRHSTokens()
public void setRHSTokens(java.lang.String[] rhs)
rhs
- the right hand tokens to setpublic java.lang.String[] getRHSVariables()
public java.lang.String[] getRHSTerminals()
public java.lang.String[] getVariables()
public java.lang.String[] getTerminals()
public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |