torero.model
Class ProductionMap
java.lang.Object
|
+--torero.model.ProductionMap
- All Implemented Interfaces:
- Serializable
- public class ProductionMap
- extends Object
- implements Serializable
The ProductionMap is a collection of all Productions for a specific grammar.
It has lookup Methods used for validity checks and finding a certain Production easily.
- See Also:
- Serialized Form
Constructor Summary |
ProductionMap(SymbolMap sm)
The Constructor takes the SymbolMap that contains the Symbols that can be used to build Productions for this ProductionMap. |
ProductionMap
public ProductionMap(SymbolMap sm)
- The Constructor takes the SymbolMap that contains the Symbols that can be used to build Productions for this ProductionMap.
- Parameters:
sm
- takes the SymbolMap that is used for this ProductionMap
addProduction
public void addProduction(Production newprod)
- This Method is used to add a new Production to this ProductionMap. The Symbols used in the Production have to be taken from the SymbolMap associated to this ProductionMap.
- Parameters:
newprod
- takes the Production to add to this ProductionMap
getProductions
public Iterator getProductions(Symbol s)
- This Method returns all Productions having the given Symbol at the LHS as Iterator.
- Parameters:
s
- takes the LHS Symbol to look for- Returns:
- returns all Productions having the given Symbol at the LHS as Iterator
getAllProductions
public Iterator getAllProductions()
- This Method returns all Productions this ProductionMap contains as Iterator.
- Returns:
- returns all Productions this ProductionMap contains as Iterator
getSourcesforDest
public Set getSourcesforDest(AttributeAssingnment.AttribKey dest)
- This Method returns all AttribKeys that are sources for the given destination at any AttributeAssingnment at any Production in this ProductionMap as Iterator.
- Parameters:
dest
- takes the AttribKey that is used as criterion.- Returns:
- returns all AttribKeys that are sources for the given destination as Iterator
toString
public String toString()
- Overrides:
toString
in class Object
toOx
public StringBuffer toOx(StringBuffer sb)
- Support for Ox File generation.