dpt.symbtab
Class ScopedDef

java.lang.Object
  |
  +--dpt.symbtab.Definition
        |
        +--dpt.symbtab.ScopedDef
Direct Known Subclasses:
BlockDef, HasImports, MethodDef, PackageDef

abstract class ScopedDef
extends Definition

An abstract class representing a symbol that provides a scope that contains other symbols.


Field Summary
protected  JavaHashtable elements
          A table of symbols "owned" by this symbol
private  boolean iAmDefaultOrBaseScope
          Is this scope one of the following: Base scope the scope that contains primitive types Default package where Java classes reside that are not explicitly in another scope.
private  JavaVector unresolvedStuff
          A list of yet-to-be-resolved references
 
Fields inherited from class dpt.symbtab.Definition
definition, name, parentScope, references, ST_CL, ST_FU, ST_FU_EXT, ST_IF, ST_IMPL, ST_IMPORT, ST_PAC, ST_SUB, ST_SUPER, ST_VAR
 
Constructor Summary
(package private) ScopedDef(java.lang.String name, Occurrence occ, ScopedDef parentScope)
          Constructor to create the base part of a scoped definition
 
Method Summary
(package private)  void add(Definition def)
          Add a symbol to our scope
(package private)  void addUnresolved(JavaToken t)
          Add a token to the list of unresolved references
(package private)  java.util.Vector GetListItems(int TypID, java.lang.String modifier)
           
(package private)  java.lang.String GetStringItems(int TypID)
          Write information about all the elements to the report
(package private)  java.lang.String GetStringLocation(int nTyp, java.lang.String sName)
          Write information about each element in the hash table to the report
(package private)  boolean hasElements()
          Return whether or not this scope actually contains any elements
(package private)  boolean isDefaultOrBaseScope()
          Return if this is a base or default scope.
(package private)  Definition lookup(java.lang.String name, int numParams)
          Lookup a method in the scope This is usually just a hashtable lookup, but if the element returned is a MultiDef, we need to ask it to find the best match
(package private)  void reportElements(IndentingPrintWriter out)
          Write information about all the elements to the report
(package private)  void resolveTypes(SymbolTable symbolTable)
          Resolve referenced names
(package private)  void setDefaultOrBaseScope(boolean val)
          Indicate that this scope is a base scope or default package
 
Methods inherited from class dpt.symbtab.Definition
addReference, ExtractClass, ExtractClass, ExtractName, ExtractPackage, ExtractPackage, getDef, GetItem, GetItems, GetLocation, getName, getOccurrence, getParentScope, getQualifiedName, GetReferences, isSuperClassOf, listReferences, lookup, report, setParentScope, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

elements

protected JavaHashtable elements
A table of symbols "owned" by this symbol

unresolvedStuff

private JavaVector unresolvedStuff
A list of yet-to-be-resolved references

iAmDefaultOrBaseScope

private boolean iAmDefaultOrBaseScope
Is this scope one of the following:
Base scope
the scope that contains primitive types
Default package
where Java classes reside that are not explicitly in another scope.
Constructor Detail

ScopedDef

ScopedDef(java.lang.String name,
          Occurrence occ,
          ScopedDef parentScope)
Constructor to create the base part of a scoped definition
Method Detail

add

void add(Definition def)
Add a symbol to our scope

addUnresolved

void addUnresolved(JavaToken t)
Add a token to the list of unresolved references

hasElements

boolean hasElements()
Return whether or not this scope actually contains any elements

isDefaultOrBaseScope

boolean isDefaultOrBaseScope()
Return if this is a base or default scope. This is used when printing information to the report so we won't prefix elements in these scopes.

lookup

Definition lookup(java.lang.String name,
                  int numParams)
Lookup a method in the scope This is usually just a hashtable lookup, but if the element returned is a MultiDef, we need to ask it to find the best match
Overrides:
lookup in class Definition

GetListItems

java.util.Vector GetListItems(int TypID,
                              java.lang.String modifier)

GetStringItems

java.lang.String GetStringItems(int TypID)
Write information about all the elements to the report

GetStringLocation

java.lang.String GetStringLocation(int nTyp,
                                   java.lang.String sName)
Write information about each element in the hash table to the report

reportElements

void reportElements(IndentingPrintWriter out)
Write information about all the elements to the report

resolveTypes

void resolveTypes(SymbolTable symbolTable)
Resolve referenced names
Overrides:
resolveTypes in class Definition

setDefaultOrBaseScope

void setDefaultOrBaseScope(boolean val)
Indicate that this scope is a base scope or default package