marf.nlp.Parsing.GrammarCompiler
Class NonTerminal

java.lang.Object
  |
  +--marf.nlp.Parsing.GrammarCompiler.GrammarElement
        |
        +--marf.nlp.Parsing.GrammarCompiler.NonTerminal
All Implemented Interfaces:
java.io.Serializable

public class NonTerminal
extends GrammarElement

NonTerminal grammar element. E.g.: <prog>. $Id: NonTerminal.java,v 1.9 2005/08/13 23:09:39 susan_fan Exp $

Since:
0.3.0
Version:
$Revision: 1.9 $
Author:
Serguei Mokhov
See Also:
Serialized Form

Field Summary
protected  boolean Defined
          Flag Defined or not.
protected  java.util.Vector FollowSet
          Follow Set.
 
Fields inherited from class marf.nlp.Parsing.GrammarCompiler.GrammarElement
FirstSet, ID, Name, oToken
 
Constructor Summary
NonTerminal(java.lang.String pName, int pID)
           
NonTerminal(marf.nlp.Parsing.Token poToken, int pID)
           
 
Method Summary
 boolean addToFollowSet(marf.nlp.Parsing.GrammarCompiler.NonTerminal poNonTerminal)
          Adds a single non-terminal to the follow set.
 boolean addToFollowSet(marf.nlp.Parsing.GrammarCompiler.Terminal poTerminal)
          Adds a single terminal to the follow set.
 boolean addToFollowSet(java.util.Vector poSet)
          Appends elements from the passed set to its current follow set.
 java.util.Vector getFollowSet()
           
static java.lang.String getMARFSourceCodeRevision()
          Retrieves class' revision.
 boolean isDefined()
           
 boolean isNonTerminal()
           
 boolean isTerminal()
           
 void setDefined()
          Only allow to set it, but not unset.
 
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

Defined

protected boolean Defined
Flag Defined or not.


FollowSet

protected java.util.Vector FollowSet
Follow Set.

Constructor Detail

NonTerminal

public NonTerminal(java.lang.String pName,
                   int pID)

NonTerminal

public NonTerminal(marf.nlp.Parsing.Token poToken,
                   int pID)
Method Detail

isDefined

public boolean isDefined()

setDefined

public void setDefined()
Only allow to set it, but not unset.


getFollowSet

public java.util.Vector getFollowSet()

addToFollowSet

public boolean addToFollowSet(java.util.Vector poSet)
Appends elements from the passed set to its current follow set.


addToFollowSet

public boolean addToFollowSet(marf.nlp.Parsing.GrammarCompiler.Terminal poTerminal)
Adds a single terminal to the follow set.


addToFollowSet

public boolean addToFollowSet(marf.nlp.Parsing.GrammarCompiler.NonTerminal poNonTerminal)
Adds a single non-terminal to the follow set.


isTerminal

public boolean isTerminal()
Specified by:
isTerminal in class GrammarElement

isNonTerminal

public boolean isNonTerminal()
Specified by:
isNonTerminal in class GrammarElement

getMARFSourceCodeRevision

public static java.lang.String getMARFSourceCodeRevision()
Retrieves class' revision.

Returns:
revision string