|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.multijava.util.Utils
org.multijava.mjc.CContext
org.multijava.mjc.CClassContext
org.multijava.mjc.CExtMethodContext
This represents the context in which an external method declaration
is typechecked. It subclasses CClassContextType and so
can be returned when a client calls getClassContext()
on a local context. This context provides access to the external
method's receiver CClass singleton.
| Field Summary | |
private CClass |
owner
Represents the logical owner of this context, i.e., the receiver of the method. |
| Fields inherited from class org.multijava.mjc.CClassContext |
fieldInfo, self |
| Fields inherited from class org.multijava.mjc.CContext |
cunit, parent |
| Fields inherited from class org.multijava.util.Utils |
DBG_LEVEL_HIGH, DBG_LEVEL_LOW, DBG_LEVEL_NO |
| Constructor Summary | |
CExtMethodContext(CContextType parent,
CSourceClass host,
CClass owner)
|
|
| Method Summary | |
CMemberHost |
findNearestHost()
Returns the signature of the nearest lexically enclosing context that can host member declarations (i.e., a CClass or a CCompilationUnit). |
CClass |
getOwnerClass()
Returns the CClass representing the signature of the class that is the logical owner of this context. |
CClass |
lookupClass(String name)
Searches for a class with the given name. |
CFieldAccessor |
lookupField(String ident,
CExpressionContextType context)
Searches for a field with the given name in this context. |
CMethod |
lookupMethod(String ident,
CType[] params,
CClassType[] args,
CClassContextType context)
Searches for the most specific method when no receiver is explicit at the call site. |
CMethodSet |
lookupMethodOrSet(String ident,
CType[] params,
CClassContextType context)
Searches for the most specific method(s) when no receiver is explicit at the call site. |
CFieldAccessor |
lookupOuterField(String ident,
CExpressionContextType context)
Searches for a field of the given name in the context surrounding the current lexical contour. |
JExpression |
lookupOuterLocalVariable(TokenReference ref,
String ident)
Finds a local variable with the given name that appears outside the current lexical contour. |
| Methods inherited from class org.multijava.util.Utils |
assertTrue, assertTrue, combineArrays, escapeString, escapeString, fail, fail, getFilePath, hasFlag, hasOtherFlags, parsePathParts, relativePathTo, splitQualifiedName, splitQualifiedName, stripJavaModifiers, stripNonJavaModifiers, stripPrivateModifier, unescapeString, vectorToArray, vectorToIntArray |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.multijava.mjc.CClassContextType |
resolveMaybeExtMethodRef |
| Methods inherited from interface org.multijava.mjc.CContextType |
arithmeticMode, catchUp, check, check, check, check, classToGenerate, createClassContext, createExtMethodContext, createInterfaceContext, declaredOutsideOfLoop, declares, fail, fail, getCMethod, getCompilationUnit, getCompiler, getFlowControlContext, getMethodContext, getParentContext, isBeforeSuperConstructorCall, isInConstructor, isInInitializer, isPure, isStatic, lookupField, lookupMethod, lookupMethodOrSet, lookupOuterField, modUtil, registerGFDecl, registerVisibleMethod, reportTrouble |
| Field Detail |
private CClass owner
| Constructor Detail |
public CExtMethodContext(CContextType parent,
CSourceClass host,
CClass owner)
parent - the parent context or null at top levelhost - the host classowner - the receiver class| Method Detail |
public CClass lookupClass(String name)
throws UnpositionedError
lookupClass in interface CClassContextTypelookupClass in class CClassContextname - method name
UnpositionedError - this error will be positioned soon
public CMethod lookupMethod(String ident,
CType[] params,
CClassType[] args,
CClassContextType context)
throws UnpositionedError
ident - method nameparams - method parameterscontext - the con text of the class containing
the method call
UnpositionedError - this error will be positioned soon
public CMethodSet lookupMethodOrSet(String ident,
CType[] params,
CClassContextType context)
throws UnpositionedError
lookupMethodOrSet in interface CClassContextTypelookupMethodOrSet in class CClassContextident - method nameparams - method parameterscontext - the con text of the class containing
the method call
UnpositionedError - this error will be positioned soon
public CFieldAccessor lookupField(String ident,
CExpressionContextType context)
throws UnpositionedError
lookupField in interface CClassContextTypelookupField in class CClassContextident - the name of the fieldcontext - the context of the field access
UnpositionedError - this error will be positioned soon
public CFieldAccessor lookupOuterField(String ident,
CExpressionContextType context)
throws UnpositionedError
lookupOuterField in interface CClassContextTypelookupOuterField in class CClassContextident - the name of the fieldcontext - the context of the field access
UnpositionedError - this error will be positioned soon
public JExpression lookupOuterLocalVariable(TokenReference ref,
String ident)
lookupOuterLocalVariable in interface CClassContextTypelookupOuterLocalVariable in class CClassContextref - a token reference used to build a new
JOuterLocalVariableExpressionident - the name of the outer variable
public CClass getOwnerClass()
getOwnerClass in interface CClassContextTypegetOwnerClass in class CClassContextCClassContextType.getHostClass()public CMemberHost findNearestHost()
CClass or a CCompilationUnit). Used
for access checks, this is slightly different than
getHostClass(). The later method returns an
anchor class signature for external methods, which is useful in
code generation and in typechecking external method bodies. On
the other hand, this method returns a
CCompilationUnit for external methods, which is
useful in checking access between two differently named generic
functions declared in the same compilation unit. !FIXME! It
may be possible to eliminate this method and just use
getHostClass now that private external methods are
duplciated in every anchor.
findNearestHost in interface CClassContextTypefindNearestHost in class CClassContextCMemberHost
|
JML | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||