|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object marf.nlp.Parsing.GrammarCompiler.GrammarElement marf.nlp.Parsing.GrammarCompiler.NonTerminal
public class NonTerminal
Non-terminal grammar element. E.g.: <prog>.
$Id: NonTerminal.java,v 1.11 2007/12/18 21:37:57 mokhov Exp $
Field Summary | |
---|---|
protected boolean |
bDefined
Flag indicating whether this non-terminal is defined or not. |
protected java.util.Vector |
oFollowSet
Follow set of this non-terminal. |
Fields inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarElement |
---|
iID, oFirstSet, oToken, strName |
Constructor Summary | |
---|---|
NonTerminal(java.lang.String pstrName,
int piID)
Creates a non-terminal by a name and ID. |
|
NonTerminal(Token poToken,
int piID)
Creates a non-terminal from a token and the ID. |
Method Summary | |
---|---|
boolean |
addToFollowSet(NonTerminal poNonTerminal)
Adds a single non-terminal to the follow set. |
boolean |
addToFollowSet(Terminal poTerminal)
Adds a single terminal to the follow set if it's not already there. |
boolean |
addToFollowSet(java.util.Vector poSet)
Appends elements from the passed set to its current follow set. |
java.util.Vector |
getFollowSet()
Allows to query for the collection of the follow set elements of this non-terminal. |
static java.lang.String |
getMARFSourceCodeRevision()
Retrieves class' revision. |
boolean |
isDefined()
Tests whether this non-terminal was defined at some point in the grammar. |
boolean |
isNonTerminal()
Allows querying this grammar element for non-terminality. |
boolean |
isTerminal()
Allows querying this grammar element for terminality. |
void |
setDefined()
Marks this non-terminal as defined. |
Methods inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarElement |
---|
addToFirstSet, addToFirstSet, addToFirstSet, getFirstSet, getID, getName, getToken, isEqualByName, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean bDefined
protected java.util.Vector oFollowSet
Constructor Detail |
---|
public NonTerminal(java.lang.String pstrName, int piID)
pstrName
- the namepiID
- the IDpublic NonTerminal(Token poToken, int piID)
poToken
- the tokenpiID
- the ID.Method Detail |
---|
public boolean isDefined()
true
if the non-terminal defined as a rule;
false
otherwisepublic void setDefined()
public java.util.Vector getFollowSet()
public boolean addToFollowSet(java.util.Vector poSet)
poSet
- the collection of elements to append
true
if the current follow set has
changed as a result of addition; false
otherwisepublic boolean addToFollowSet(Terminal poTerminal)
poTerminal
- the terminal to add
true
if the current follow set has
changed as a result of addition; false
otherwisepublic boolean addToFollowSet(NonTerminal poNonTerminal)
poNonTerminal
- the non-terminal to add
true
if the current follow set has
changed as a result of addition; false
otherwisepublic boolean isTerminal()
GrammarElement
isTerminal
in class GrammarElement
false
GrammarElement.isTerminal()
public boolean isNonTerminal()
GrammarElement
isNonTerminal
in class GrammarElement
true
GrammarElement.isNonTerminal()
public static java.lang.String getMARFSourceCodeRevision()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |