|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcode.table.ModuleTable
public class ModuleTable
This is the main class for managing the symbols of a program. This class is a singleton.
This class holds a table that maps module names to a pair consisting of a module and a table of all the symbols of the module. See the package description for other tables in this package.
Since symbol definitions may be mutually recursive, symbols may be referenced before they are defined. When a symbol is referenced, it is announced. Announcing a symbol assigns a unique numeric id to it that is used to identify the symbol throughout the virtual machine and to enable fast access to the symbol information. It is expected that all referenced symbols will be defined. When a symbol is defined, it is installed in its module symbol table
A module or a symbol can be announced repeatedly before and/or after being installed, but it can be installed only once.
Class main responsibilities :
| Nested Class Summary | |
|---|---|
private static class |
ModuleTable.Pair
Objects of this class represent an entry of the module table. |
| Field Summary | |
|---|---|
private static CurryModule[] |
builtins
The builtin modules in some arbitrary order. |
private static java.util.Hashtable |
moduleTable
A table holding all the loaded modules A module is accessed by its name, a string. |
private static java.lang.String[] |
standards
The standard module names in some arbitrary order. |
| Constructor Summary | |
|---|---|
private |
ModuleTable()
Singleton class, all members are static. |
| Method Summary | |
|---|---|
private static void |
announceModule(java.lang.String moduleName)
|
private static void |
announceSymbol(java.lang.String moduleName,
java.lang.String symbolName)
|
static void |
clear()
Reset the entire table leaving only the builtin modules. |
static java.util.Enumeration |
getAllModules()
|
static java.util.Enumeration |
getAllSymbols(CurryModule module)
|
static java.util.Enumeration |
getAllSymbols(java.lang.String moduleName)
|
static int |
getId(java.lang.String maybeQualifiedName)
The symbol should already be installed |
static int |
getId(java.lang.String moduleName,
java.lang.String symbolName)
|
static CurryModule |
getModule(java.lang.String moduleName)
|
static Symbol |
getSymbol(java.lang.String symbolName)
|
static Symbol |
getSymbol(java.lang.String moduleName,
java.lang.String symbolName)
|
(package private) static SymbolTable |
getTable(java.lang.String moduleName)
|
static java.util.Enumeration |
getUndefinedModules()
|
static java.lang.String |
getUndefinedSymbol(int id)
|
static java.util.Enumeration |
getUndefinedSymbols()
|
static void |
installModule(CurryModule module)
|
private static void |
installSymbol(CurryModule module,
Symbol symbol)
|
static void |
installSymbol(java.lang.String moduleName,
Symbol symbol)
|
static void |
loadBuiltinModules()
Install the builtin/standard modules. |
(package private) static java.util.Vector |
moduleVector()
|
static void |
removeModule(java.lang.String moduleName)
|
static int |
sureGetId(java.lang.String moduleName,
java.lang.String symbolName)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.Hashtable moduleTable
private static CurryModule[] builtins
private static java.lang.String[] standards
| Constructor Detail |
|---|
private ModuleTable()
| Method Detail |
|---|
public static void loadBuiltinModules()
public static void clear()
public static void installModule(CurryModule module)
public static CurryModule getModule(java.lang.String moduleName)
static SymbolTable getTable(java.lang.String moduleName)
private static void announceModule(java.lang.String moduleName)
public static void removeModule(java.lang.String moduleName)
private static void installSymbol(CurryModule module,
Symbol symbol)
public static void installSymbol(java.lang.String moduleName,
Symbol symbol)
public static Symbol getSymbol(java.lang.String moduleName,
java.lang.String symbolName)
public static Symbol getSymbol(java.lang.String symbolName)
throws AmbiguousSymbolException
AmbiguousSymbolException
private static void announceSymbol(java.lang.String moduleName,
java.lang.String symbolName)
public static int getId(java.lang.String moduleName,
java.lang.String symbolName)
public static int sureGetId(java.lang.String moduleName,
java.lang.String symbolName)
public static int getId(java.lang.String maybeQualifiedName)
throws AmbiguousSymbolException
AmbiguousSymbolExceptionstatic java.util.Vector moduleVector()
public static java.util.Enumeration getAllModules()
public static java.util.Enumeration getAllSymbols(CurryModule module)
public static java.util.Enumeration getAllSymbols(java.lang.String moduleName)
public static java.util.Enumeration getUndefinedModules()
public static java.util.Enumeration getUndefinedSymbols()
public static java.lang.String getUndefinedSymbol(int id)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||