|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--goldengine.java.Rule
-------------------------------------------------------------------------------------------
Source File: Rule.java
Author: Devin Cook, Matthew Hawkins
Description: A representation of a rule associated with this grammar.
-------------------------------------------------------------------------------------------
Revision List
Author Version Description
------ ------- -----------
MPH 1.0 First Issue
MPH 1.1 Added the TrimReductions property and required logic
| Fields inherited from interface goldengine.java.SymbolTypeConstants |
symbolTypeCommentEnd, symbolTypeCommentLine, symbolTypeCommentStart, symbolTypeEnd, symbolTypeError, symbolTypeNonterminal, symbolTypeTerminal, symbolTypeWhitespace |
| Constructor Summary | |
Rule()
Rule Constructor: This constructor initialises this rule and creates a new SymbolList and the table index. |
|
| Method Summary | |
void |
addItem(Symbol item)
addItem This method will add a symbol to the Symbol list. |
boolean |
containsOneNonTerminal()
containsOneNonTerminal #ver1.1# This method will check to see if the rule contains a non terminal. |
java.lang.String |
definition()
definition This method will return the right hand side of the rule, It does this by concatenating all the Symbols in the Symbol list. |
Symbol |
getRuleNonTerminal()
getRuleNonTerminal Will return the Non-Terminal Symbol associated with this Rule. |
int |
getSymbolCount()
getSymbolCount Will return how many symbols are contained in this Rule. |
Symbol |
getSymbols(int index)
getSymbols Will return the Symbol at the index specified. |
int |
getTableIndex()
getTableIndex Will return what index the table index in this Rule is at. |
java.lang.String |
getText()
getText This method uses the method name() and definiton() to create a String representing the entirety of this Rule. |
boolean |
isEqual(Rule secondRule)
isEqual #ver1.1# This method will check equality of two Rules - this and the one passed in. |
java.lang.String |
name()
name Will return a String consisting of the Rules name. |
void |
setRuleNonTerminal(Symbol nonTerminal)
setRuleNonTerminal Will setup the Non-Terminal symbol to that passed in. |
void |
setTableIndex(int index)
setTableIndex Will set the current table index to that passed in. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Rule()
| Method Detail |
public int getTableIndex()
public int getSymbolCount()
public Symbol getRuleNonTerminal()
public void setTableIndex(int index)
index - The table index wanted.public void setRuleNonTerminal(Symbol nonTerminal)
nonTerminal - The Non-Terminal Symbol.public Symbol getSymbols(int index)
index - The index of the symbol wanted.public java.lang.String name()
"<'name of non-terminal'>".public java.lang.String definition()
public void addItem(Symbol item)
item - The Symbol to add.public java.lang.String getText()
public boolean containsOneNonTerminal()
public boolean isEqual(Rule secondRule)
secondRule - The rule to check against this one.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||