se.chalmers.cs.gf.gfcutil
Class GFCModule

java.lang.Object
  extended by se.chalmers.cs.gf.gfcutil.GFCModule
All Implemented Interfaces:
java.io.Serializable

public class GFCModule
extends java.lang.Object
implements java.io.Serializable

Wraps a GFC module (concrete, abstract or resource) and provides methods for looking up its contents.

See Also:
Serialized Form

Constructor Summary
GFCModule(se.chalmers.cs.gf.GFC.Absyn.Mod mod, java.util.Map<java.lang.String,GFCModule> allModules)
           
 
Method Summary
 boolean equals(GFCModule mod)
           
 boolean equals(java.lang.Object o)
           
 Function findFunction(java.lang.String f)
          Find a function by name.
 LinRule findLinRule(java.lang.String f)
          Find a linearization rule by function name.
 java.lang.String getAbstract()
          Get the name of the abstract module that this module is for.
 java.lang.String getName()
          Get the name of this module.
 ModuleType getType()
          Checks if this module is concrete.
 int hashCode()
           
 java.util.Set<java.lang.String> listCategories()
          Get all categories used as the result of functions in this module, including inherited ones.
 java.util.Set<Function> listFunctions()
          Get all functions in this module, including inherited ones.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GFCModule

public GFCModule(se.chalmers.cs.gf.GFC.Absyn.Mod mod,
                 java.util.Map<java.lang.String,GFCModule> allModules)
Parameters:
mod - A module parse tree
allModules - A reference to a map of module names to modules. The map need not be populated when passed to the contructor, but it must be before find is called.
Method Detail

getName

public java.lang.String getName()
Get the name of this module.


getType

public ModuleType getType()
Checks if this module is concrete.


getAbstract

public java.lang.String getAbstract()
Get the name of the abstract module that this module is for. If this is not a concrete module, null is returned.


findFunction

public Function findFunction(java.lang.String f)
Find a function by name.


listFunctions

public java.util.Set<Function> listFunctions()
Get all functions in this module, including inherited ones.


findLinRule

public LinRule findLinRule(java.lang.String f)
Find a linearization rule by function name.

Returns:
The linearization rule, or null if there is no rule for the given function.

listCategories

public java.util.Set<java.lang.String> listCategories()
Get all categories used as the result of functions in this module, including inherited ones.


equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

equals

public boolean equals(GFCModule mod)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object