|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmarf.nlp.Parsing.GrammarCompiler.Rule
public class Rule
Language Grammar Rule.
$Id: Rule.java,v 1.11 2006/01/01 01:28:17 mokhov Exp $
| Field Summary | |
|---|---|
protected int |
iID
ID for reference and debugging. |
protected NonTerminal |
oLHS
Left-hand side of this rule. |
protected java.util.Vector |
oRHS
A vector of grammar elements on the right-hand-side of a production. |
private static long |
serialVersionUID
For serialization versioning. |
| Constructor Summary | |
|---|---|
Rule(NonTerminal poLHS)
Constructor with LHS. |
|
| Method Summary | |
|---|---|
void |
addRHSElement(GrammarElement poGrammarElement)
Allows adding grammar elements on the RHS of this rule. |
int |
getID()
Allows getting this rule's ID. |
NonTerminal |
getLHS()
Allows getting current LHS non-terminal of this rule. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
java.util.Vector |
getRHS()
Allows getting the RHS part of this rule. |
java.util.Vector |
getRHSFirstSet(GrammarElement poEpsilon)
Function that computes the first set of the right hand side of the current grammar rule. |
void |
setID(int piID)
Allows setting this rule's ID. |
void |
setLHS(NonTerminal poNewLHS)
Allows setting a new LHS from the outside. |
void |
setRHS(java.util.Vector poNewRHS)
Allows setting a new RHS from the outside. |
java.lang.String |
toAbbrString()
Just returns rule's ID prefixed with "R" as a string. |
java.lang.String |
toString()
Overrides Object's toString() to human-readable production rule. |
java.lang.String |
toStringNumeric()
Returns analogous representation of a rule to that of toString() except
numeric IDs are used on the LHS. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int iID
protected NonTerminal oLHS
protected java.util.Vector oRHS
private static final long serialVersionUID
serialver tool that comes with JDK.
| Constructor Detail |
|---|
public Rule(NonTerminal poLHS)
poLHS - the default LHS non-terminal| Method Detail |
|---|
public void addRHSElement(GrammarElement poGrammarElement)
poGrammarElement - RHS grammar element to addpublic java.util.Vector getRHSFirstSet(GrammarElement poEpsilon)
poEpsilon - what to consider a termination element
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public java.lang.String toStringNumeric()
toString() except
numeric IDs are used on the LHS.
toString()public java.lang.String toAbbrString()
public void setLHS(NonTerminal poNewLHS)
poNewLHS - new LHS non-terminalpublic void setRHS(java.util.Vector poNewRHS)
poNewRHS - new collection of the RHS elementspublic NonTerminal getLHS()
public java.util.Vector getRHS()
public int getID()
public void setID(int piID)
piID - new ID of the rule.public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||