|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.rice.cs.dynamicjava.interpreter.DelegatingContext
edu.rice.cs.dynamicjava.interpreter.FunctionContext
public class FunctionContext
The context of a function's (method, constructor, or local function) body, introducing the function's parameters.
| Constructor Summary | |
|---|---|
FunctionContext(TypeContext next,
Function f)
|
|
| Method Summary | |
|---|---|
protected FunctionContext |
duplicate(TypeContext next)
Create a copy of this context with the given context enclosing it. |
boolean |
fieldExists(String name,
TypeSystem ts)
Test whether name is an in-scope field |
boolean |
functionExists(String name,
TypeSystem ts)
Test whether name is an in-scope method or local function |
Iterable<Type> |
getDeclaredThrownTypes()
The types that are allowed to be thrown in the current context. |
Iterable<LocalFunction> |
getLocalFunctions(String name,
TypeSystem ts,
Iterable<LocalFunction> partial)
Helper for getLocalFunctions: list all matching functions, including those provided. |
LocalVariable |
getLocalVariable(String name,
TypeSystem ts)
Return the variable object for the given name, or null if it does not exist. |
Type |
getReturnType()
The expected type of a return statement in the given context, or null
if return statements should not appear here. |
DJClass |
getThis()
Return the class of this in the current context, or null
if there is no such value (for example, in a static context). |
DJClass |
getThis(String className)
Return the class of className.this in the current context, or null
if there is no such value (for example, in a static context). |
DJClass |
getThis(Type expected,
TypeSystem ts)
Return the innermost "this" class with the given type in the current context, or null if there is no such value (for example, in a static context). |
DJClass |
initializingClass()
Class which is being initialized (via a constructor or initialization block); null otherwise. |
boolean |
localFunctionExists(String name,
TypeSystem ts)
Test whether name is an in-scope local function |
boolean |
localVariableExists(String name,
TypeSystem ts)
Test whether name is an in-scope local variable |
String |
makeClassName(String n)
Return a full name for a class with the given name declared here. |
boolean |
methodExists(String name,
TypeSystem ts)
Test whether name is an in-scope method |
ClassType |
typeContainingField(String name,
TypeSystem ts)
Return the most inner type containing a field with the given name, or null
if there is no such type. |
Type |
typeContainingMethod(String name,
TypeSystem ts)
Return the most inner type containing a method with the given name, or null
if there is no such type. |
boolean |
variableExists(String name,
TypeSystem ts)
Test whether name is an in-scope field or local variable |
| Methods inherited from class edu.rice.cs.dynamicjava.interpreter.DelegatingContext |
|---|
accessModule, getClassLoader, getLocalFunctions, getTopLevelClass, getTypeVariable, importField, importMemberClass, importMemberClasses, importMethod, importStaticMembers, importTopLevelClass, importTopLevelClasses, makeAnonymousClassName, memberClassExists, setPackage, topLevelClassExists, typeContainingMemberClass, typeExists, typeVariableExists |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FunctionContext(TypeContext next,
Function f)
| Method Detail |
|---|
protected FunctionContext duplicate(TypeContext next)
DelegatingContext
duplicate in class DelegatingContext
public boolean variableExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope field or local variable
variableExists in interface TypeContextvariableExists in class DelegatingContext
public boolean localVariableExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope local variable
localVariableExists in interface TypeContextlocalVariableExists in class DelegatingContext
public LocalVariable getLocalVariable(String name,
TypeSystem ts)
DelegatingContextnull if it does not exist.
getLocalVariable in interface TypeContextgetLocalVariable in class DelegatingContext
public boolean fieldExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope field
fieldExists in interface TypeContextfieldExists in class DelegatingContext
public ClassType typeContainingField(String name,
TypeSystem ts)
throws AmbiguousNameException
DelegatingContextnull
if there is no such type.
typeContainingField in interface TypeContexttypeContainingField in class DelegatingContextAmbiguousNameException
public boolean functionExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope method or local function
functionExists in interface TypeContextfunctionExists in class DelegatingContext
public boolean localFunctionExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope local function
localFunctionExists in interface TypeContextlocalFunctionExists in class DelegatingContext
public Iterable<LocalFunction> getLocalFunctions(String name,
TypeSystem ts,
Iterable<LocalFunction> partial)
TypeContext
getLocalFunctions in interface TypeContextgetLocalFunctions in class DelegatingContext
public boolean methodExists(String name,
TypeSystem ts)
DelegatingContextname is an in-scope method
methodExists in interface TypeContextmethodExists in class DelegatingContext
public Type typeContainingMethod(String name,
TypeSystem ts)
DelegatingContextnull
if there is no such type.
typeContainingMethod in interface TypeContexttypeContainingMethod in class DelegatingContextpublic String makeClassName(String n)
DelegatingContext
makeClassName in interface TypeContextmakeClassName in class DelegatingContextpublic DJClass getThis()
DelegatingContextthis in the current context, or null
if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContextpublic DJClass getThis(String className)
DelegatingContextclassName.this in the current context, or null
if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContext
public DJClass getThis(Type expected,
TypeSystem ts)
TypeContextnull if there is no such value (for example, in a static context).
getThis in interface TypeContextgetThis in class DelegatingContextpublic DJClass initializingClass()
TypeContextnull otherwise.
initializingClass in interface TypeContextinitializingClass in class DelegatingContextpublic Type getReturnType()
DelegatingContextreturn statement in the given context, or null
if return statements should not appear here.
getReturnType in interface TypeContextgetReturnType in class DelegatingContextpublic Iterable<Type> getDeclaredThrownTypes()
DelegatingContext
getDeclaredThrownTypes in interface TypeContextgetDeclaredThrownTypes in class DelegatingContext
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||