|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.ksu.cis.projects.bogor.symboltable.SymbolTable
public final class SymbolTable
This class is used as a symbol table for a system.
Constructor Summary | |
---|---|
SymbolTable(String filename,
System system)
Default constructor |
Method Summary | |
---|---|
void |
addArrayField(String name,
Type type)
Adds an array field. |
void |
dispose()
Removes references to filename, mainThreadName, topRecordName, and clears all tables. |
void |
finishTypeCheckingDefinitions()
Sets the symbol table for finishing type checking definitions. |
void |
finishTypeCheckingFSMHeaders()
Sets the symbol table for finishing type checking globals. |
void |
finishTypeCheckingFSMs()
Sets the symbol table for finishing type checking FSMs. |
void |
finishTypeCheckingGlobals()
Sets the symbol table for finishing type checking globals. |
int |
genLocationDesc()
Generate a new location descriptor. |
Collection<FileMessage> |
getAllErrors()
Gets all the error messages (including FSM errors). |
int |
getArrayFieldCount()
Gets the number of array fields. |
int |
getArrayFieldIndex(String fieldName)
Gets the index of an array field. |
String |
getArrayFieldName(int fieldIndex)
Gets the name of an array field. |
Iterator<String> |
getArrayFieldNameIterator()
Gets array field name iterator. |
Type |
getArrayFieldType(int fieldIndex)
Gets the type of an array field. |
Type |
getArrayFieldType(String fieldName)
Gets the type of an array field. |
Map<ASTType,Type> |
getASTTypeTypeTable()
Gets the ast.ASTType to type.Type mapping. |
Map<String,Map<String,Object>> |
getConstantTable()
Gets the constant identifier (String) to its constant mapping (Map<String, Integer/Boolean>). |
Map<String,Map<String,Type>> |
getConstantTypeTable()
Gets the mapping of a constant set definition's identifier to a table relating each entry in the set to its declared type. |
SystemMember |
getDeclarationForIdentifier(String id)
|
Map<String,EnumType> |
getEnumTable()
Gets the enum identifier (String) to its type (EnumType). |
boolean |
getError()
Gets the error flag. |
List<FileMessage> |
getErrors()
Gets the error messages (excluding FSM errors). |
Map<String,Extension> |
getExpActionExtDefTable()
Gets the exp or action extension qualified identifier (String) to its declaration (ExpExtension/ActionExtension). |
Map<String,ExtSymbolTable> |
getExpActionExtTable()
Gets the exp or action extension qualified identifier (String) to its symbol table (ExtSymbolTable). |
Map<String,ExtensionDefinition> |
getExtensionDefTable()
Gets the extension id (String) to its declaration (ExtensionDefinition) mapping. |
Map<String,Field> |
getFieldDefTable()
Gets the field qualified name (String) to its definition (Field) mapping. |
String |
getFilename()
Gets the filename of the system. |
Map<String,ArrayList<Node>> |
getForwardRecordTable()
Gets the record name (String) to its forward references (ArrayList<Node>) mapping. |
FSMSymbolTable |
getFSMSymbolTable(int locDesc)
Finds the symbol table of the FSM which owns the specified thread control point. |
Map<String,FSM> |
getFunctionDefTable()
Gets the function identifier (String) to its definition (FSM) mapping. |
Map<String,FSMSymbolTable> |
getFunctionTable()
Gets the function identifier (String) to its symbol table (FSMSymbolTable) mapping. |
Map<String,Type> |
getGlobalFunTable()
Gets the global/fun identifier (String) to its type (Type) mapping. |
ObjectIntTable<String> |
getGlobalIndexTable()
Gets the global identifier (String) to its index (int) mapping. |
BitSet |
getGlobalTransientFlags()
Gets the mapping from global index (int) to a flag (boolean) indicating whether the variable is declared transient. |
ArrayList<Type> |
getGlobalTypes()
Gets the global types (ArrayList<Type>). |
Map<String,SystemMember> |
getIdentifierDefTable()
Gets the constant/enum/global identifier (String) to its declaration (ConstantDefinition/EnumDefinition/Global/Fun) mapping. |
static String |
getIdentifierDefTableNamespaces()
Gets a textual names of all the constructs whose namespaces are managed by the table retrievable from getIdentifierDefTable() . |
Location |
getLocation(int locDesc)
|
String[] |
getLocDescFSMIdTable()
Gets the location desc (int) to its FSM id (String) mapping. |
String[] |
getLocDescLocIdTable()
Gets the location desc (int) to its loc id (String) mapping. |
String |
getMainThreadName()
Gets the main thread name. |
Map<String,Map<String,String>> |
getNonEnumVirtualTable()
Gets the virtual table identifier (String) to function mapping (Map<String, String>) mapping. |
ObjectIntTable<String> |
getQLocIdLocDescTable()
Gets the qualified loc id (String) to its location desc (int) mapping. |
Map<String,RecordDefinition> |
getRecordDefTable()
Gets the record identifier (String) to its definition (RecordDefinition) mapping. |
Map<String,RecordType> |
getRecordTable()
Gets the record identifier (String) to its type (RecordType) mapping. |
Map<String,Set<String>> |
getSubRecordClosureTable()
Gets the record (String) to sub-records (Set<String>) mapping. |
Map<String,Set<String>> |
getSubRecordTable()
Gets the record (String) to sub-record (Set<String>) mapping. |
Map<String,Set<String>> |
getSuperRecordClosureTable()
Gets the record (String) to super-records (Set<String>) mapping. |
Map<String,Set<String>> |
getSuperRecordTable()
Gets the record (String) to super-record (String) mapping. |
System |
getSystem()
Gets the AST of the system. |
String |
getSystemMemberType(SystemMember mem)
|
String |
getTopRecordName()
Gets the name of the top record. |
Transformation |
getTransformation(int locDesc,
int transformationIndex)
|
Map<String,Type> |
getTypealiasTable()
Gets the typealias identifier (String) to its type (Type). |
Map<String,TypeExtension> |
getTypeExtensionDefTable()
Gets the type extension qualified id (String) to its declaration (TypeExtension) mapping. |
Map<String,Type> |
getTypeExtensionTable()
Gets the type extension qualified id (String) to its declaration (TypeExtensionType or PrimitiveTypeExtensionType) mapping. |
TypeFactory |
getTypeFactory()
Gets the type factory. |
IntIntTable |
getTypeIdCreatedTypeIdTable()
Gets the type id (int) to its created type id (int) mapping. |
IntObjectTable<Type> |
getTypeIdTypeTable()
Gets the type id (int) to its type (Type) mapping. |
Map<String,VirtualTableDefinition> |
getVirtualDefTable()
Gets the virtual table identifier (String) to its definition (VirtualTableDefinition). |
Map<String,ArrayList<Type>> |
getVirtualParamTable()
Gets the virtual table identifier (String) to its parameter types (ArrayList<Type>), excluding the receiver type. |
Map<String,Type> |
getVirtualReturnTable()
Gets the virtual table identifier (String) to its return type (Type). |
Map<String,IntObjectTable<String>> |
getVirtualTable()
Gets the virtual table identifier (String) to function mapping (Map<Integer, String>) mapping. |
List<FileMessage> |
getWarnings()
Gets the warning messages. |
boolean |
hasArrayField(String fieldName)
Determines whether a field name is declared in the array. |
void |
initTypeCheckingDefinitions()
Sets the symbol table for type checking definitions. |
void |
initTypeCheckingFSMHeaders()
Sets the symbol table for type checking FSM headers. |
void |
initTypeCheckingFSMs()
Sets the symbol table for type checking FSMs. |
void |
initTypeCheckingGlobals()
Sets the symbol table for type checking globals. |
boolean |
isIdentifierDeclared(String id)
|
boolean |
isSubRecord(String recordName1,
String recordName2)
Determines if a record is a sub-record of another record. |
void |
setASTTypeTypeTable(Map<ASTType,Type> newTypeTypeTable)
Sets the ast.ASTType to type.Type mapping. |
void |
setError(boolean newError)
Sets the error flag |
void |
setMainThreadName(String newMainThreadName)
Sets the main thread name. |
void |
setTopRecordName(String newTopRecordName)
Sets the top record name. |
String |
toString()
Returns the string representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SymbolTable(String filename, System system)
filename
- The filename of the BIR system.system
- The AST of the BIR system. Must be non-null.Method Detail |
---|
public void setASTTypeTypeTable(Map<ASTType,Type> newTypeTypeTable)
newTypeTypeTable
- The new ast.ASTType to type.Type mapping. Must be non-null.
This map is treated as read-only; a snapshot is taken to
populate an encapsulated mapping inside this
SymbolTable
>public Map<ASTType,Type> getASTTypeTypeTable()
public Collection<FileMessage> getAllErrors()
public int getArrayFieldCount()
public int getArrayFieldIndex(String fieldName)
fieldName
- The field name. Must be non-null. Must be a field of this
array.
public String getArrayFieldName(int fieldIndex)
fieldIndex
- The field index. Must be non-null. Must be a field of this
array.
public Iterator<String> getArrayFieldNameIterator()
public Type getArrayFieldType(String fieldName)
fieldName
- The field name. Must be non-null. Must be a field of this
array.
public Type getArrayFieldType(int fieldIndex)
fieldIndex
- The field name. Must be non-null. Must be a field of this
array.
public Map<String,Map<String,Object>> getConstantTable()
public Map<String,Map<String,Type>> getConstantTypeTable()
public Map<String,EnumType> getEnumTable()
public void setError(boolean newError)
newError
- The new error flag.public boolean getError()
public List<FileMessage> getErrors()
public Map<String,Extension> getExpActionExtDefTable()
public Map<String,ExtSymbolTable> getExpActionExtTable()
public Map<String,ExtensionDefinition> getExtensionDefTable()
public FSMSymbolTable getFSMSymbolTable(int locDesc)
locDesc
- Globally unique descriptor of a thread control point.
null
if no such
control point exists.public Map<String,Field> getFieldDefTable()
public String getFilename()
public Map<String,ArrayList<Node>> getForwardRecordTable()
public Map<String,FSM> getFunctionDefTable()
public Map<String,FSMSymbolTable> getFunctionTable()
public Map<String,Type> getGlobalFunTable()
public ObjectIntTable<String> getGlobalIndexTable()
public BitSet getGlobalTransientFlags()
public ArrayList<Type> getGlobalTypes()
public Map<String,SystemMember> getIdentifierDefTable()
public static String getIdentifierDefTableNamespaces()
getIdentifierDefTable()
.
public String[] getLocDescFSMIdTable()
public String[] getLocDescLocIdTable()
public Location getLocation(int locDesc)
public void setMainThreadName(String newMainThreadName)
newMainThreadName
- Must be non-null.public String getMainThreadName()
public ObjectIntTable<String> getQLocIdLocDescTable()
public Map<String,RecordDefinition> getRecordDefTable()
public Map<String,RecordType> getRecordTable()
public boolean isSubRecord(String recordName1, String recordName2)
recordName1
- The name of the first record. Non-null.recordName2
- The name of the second record. Non-null.
public Map<String,Set<String>> getSubRecordClosureTable()
public Map<String,Set<String>> getSubRecordTable()
public Map<String,Set<String>> getSuperRecordClosureTable()
public Map<String,Set<String>> getSuperRecordTable()
public System getSystem()
public void setTopRecordName(String newTopRecordName)
newTopRecordName
- Must be non-null.public String getTopRecordName()
public Transformation getTransformation(int locDesc, int transformationIndex)
public Map<String,TypeExtension> getTypeExtensionDefTable()
public Map<String,Type> getTypeExtensionTable()
public TypeFactory getTypeFactory()
public IntIntTable getTypeIdCreatedTypeIdTable()
public IntObjectTable<Type> getTypeIdTypeTable()
public Map<String,Type> getTypealiasTable()
public Map<String,VirtualTableDefinition> getVirtualDefTable()
public Map<String,ArrayList<Type>> getVirtualParamTable()
public Map<String,Type> getVirtualReturnTable()
public Map<String,IntObjectTable<String>> getVirtualTable()
public Map<String,Map<String,String>> getNonEnumVirtualTable()
public List<FileMessage> getWarnings()
public void addArrayField(String name, Type type)
name
- The name of the field. Must be non-null. The record must not
already contain a field named name.type
- The type of the field. Must be non-null. Must not be instance
of VoidType or UnknownType.public void dispose()
dispose
in interface Disposable
public void finishTypeCheckingDefinitions()
Generates an error if:
public void finishTypeCheckingFSMHeaders()
Generates an error if:
public void finishTypeCheckingFSMs()
public void finishTypeCheckingGlobals()
public int genLocationDesc()
public boolean hasArrayField(String fieldName)
fieldName
- The field name. Must be non-null.
public void initTypeCheckingDefinitions()
public void initTypeCheckingFSMHeaders()
public void initTypeCheckingFSMs()
public void initTypeCheckingGlobals()
public String toString()
toString
in class Object
public boolean isIdentifierDeclared(String id)
public SystemMember getDeclarationForIdentifier(String id)
public String getSystemMemberType(SystemMember mem)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |