com.inxar.syntacs.grammar.context_free
Class CFProduction

java.lang.Object
  |
  +--com.inxar.syntacs.grammar.context_free.CFProduction
All Implemented Interfaces:
Production

public class CFProduction
extends Object
implements Production

Standard Production implementation.


Method Summary
 Production add(GrammarSymbol grammarSymbol)
          Concatenates the given GrammarSymbol to the end of this Production sequence.
 IntArray getGrammarSymbols()
          Returns an IntArray for the right hand side of this Production.
 int getID()
          Gets the globally allocated identifier for this Production.
 Item getInitialItem()
          Returns the first Item in the Production, A := *ab.
 NonTerminal getNonTerminal()
          Returns the NonTerminal defined as the left hand side of this Production.
 int length()
          Returns the number of GrammarSymbols on the right hand side.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getID

public int getID()
Description copied from interface: Production
Gets the globally allocated identifier for this Production.
Specified by:
getID in interface Production

add

public Production add(GrammarSymbol grammarSymbol)
Description copied from interface: Production
Concatenates the given GrammarSymbol to the end of this Production sequence. The Production object is returned simply to support a convenient java.lang.StringBuffer style of coding.
Specified by:
add in interface Production

getGrammarSymbols

public IntArray getGrammarSymbols()
Description copied from interface: Production
Returns an IntArray for the right hand side of this Production. Each member in the array is the ID of a GrammarSymbol.
Specified by:
getGrammarSymbols in interface Production

getInitialItem

public Item getInitialItem()
Description copied from interface: Production
Returns the first Item in the Production, A := *ab.
Specified by:
getInitialItem in interface Production

getNonTerminal

public NonTerminal getNonTerminal()
Description copied from interface: Production
Returns the NonTerminal defined as the left hand side of this Production.
Specified by:
getNonTerminal in interface Production

length

public int length()
Description copied from interface: Production
Returns the number of GrammarSymbols on the right hand side. This has the same effect as getGrammarSymbols().length().
Specified by:
length in interface Production

toString

public String toString()
Overrides:
toString in class Object