dpt.symbtab
Class MultiDef
java.lang.Object
|
+--dpt.symbtab.Definition
|
+--dpt.symbtab.MultiDef
- class MultiDef
- extends Definition
Because methods can be overloaded and member data can have the same name
as a method, we provide this dummy definition to hold a list of all
definitions in a scope with the same name.
Field Summary |
private JavaVector |
defs
A list of the various definitions for this symbol name |
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) |
MultiDef(java.lang.String name,
Definition oldDef)
Constructor to create a new multidef object.
|
(package private) |
MultiDef(java.lang.String name,
Occurrence occ,
ScopedDef parentScope)
Constructor to create a new multidef object |
Method Summary |
(package private) void |
addDef(Definition def)
Add a definition to the list of symbols with the same name |
java.lang.String |
GetItem(int TypID)
|
java.util.Vector |
GetItems(int TypID,
java.lang.String modifier)
|
java.lang.String |
GetLocation(int TypID,
java.lang.String sName)
|
(package private) Definition |
lookup(java.lang.String name,
int numParams)
Lookup a symbol in the list of symbols
This is a rather lame approximation that just returns the first match
based on number of parameters. |
void |
report(IndentingPrintWriter out)
Write information about all the definitions contained within this
multidef to the report |
(package private) void |
resolveTypes(SymbolTable symbolTable)
Resolve references to other symbols |
Methods inherited from class dpt.symbtab.Definition |
addReference,
ExtractClass,
ExtractClass,
ExtractName,
ExtractPackage,
ExtractPackage,
getDef,
getName,
getOccurrence,
getParentScope,
getQualifiedName,
GetReferences,
isSuperClassOf,
listReferences,
lookup,
setParentScope,
toString |
Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
wait,
wait,
wait |
defs
private JavaVector defs
- A list of the various definitions for this symbol name
MultiDef
MultiDef(java.lang.String name,
Definition oldDef)
- Constructor to create a new multidef object.
This version takes its information from a symbol that
it will be replacing.
This is just a convenience form of the real constructor
that takes a Definition as the base for the new MultiDef
MultiDef
MultiDef(java.lang.String name,
Occurrence occ,
ScopedDef parentScope)
- Constructor to create a new multidef object
addDef
void addDef(Definition def)
- Add a definition to the list of symbols with the same name
lookup
Definition lookup(java.lang.String name,
int numParams)
- Lookup a symbol in the list of symbols
This is a rather lame approximation that just returns the first match
based on number of parameters. A real routine to perform this would
use the best-fit parameter type matching algorithm described
in the Java Language Specification
- Overrides:
- lookup in class Definition
report
public void report(IndentingPrintWriter out)
- Write information about all the definitions contained within this
multidef to the report
- Overrides:
- report in class Definition
GetLocation
public java.lang.String GetLocation(int TypID,
java.lang.String sName)
- Overrides:
- GetLocation in class Definition
GetItem
public java.lang.String GetItem(int TypID)
- Overrides:
- GetItem in class Definition
GetItems
public java.util.Vector GetItems(int TypID,
java.lang.String modifier)
- Overrides:
- GetItems in class Definition
resolveTypes
void resolveTypes(SymbolTable symbolTable)
- Resolve references to other symbols
- Overrides:
- resolveTypes in class Definition