|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectkoala.dynamicjava.interpreter.context.VariableContext
koala.dynamicjava.interpreter.context.GlobalContext
koala.dynamicjava.interpreter.context.StaticContext
A static method context.
| Nested Class Summary |
| Nested classes inherited from class koala.dynamicjava.interpreter.context.GlobalContext |
GlobalContext.PseudoClassLoader, GlobalContext.PseudoError |
| Nested classes inherited from class koala.dynamicjava.interpreter.context.VariableContext |
VariableContext.AbstractVariable, VariableContext.Constant, VariableContext.Link, VariableContext.LinkFactory, VariableContext.Scope, VariableContext.Variable |
| Field Summary | |
protected java.lang.Class |
declaringClass
The declaring class of the method |
protected Node |
defaultQualifier
The default qualifier |
| Fields inherited from class koala.dynamicjava.interpreter.context.GlobalContext |
accessible, CLASS_TYPE, classCount, classLoader, clc, functions, importationManager, interpreter, LOCALS, LOCALS_NAME, MAP_TYPE, OBJECT_ARRAY_ARRAY, OBJECT_CLASS, OBJECT_TYPE |
| Fields inherited from class koala.dynamicjava.interpreter.context.VariableContext |
cscope, scope, scopes |
| Constructor Summary | |
StaticContext(Interpreter i,
java.lang.Class c,
ImportationManager im)
Creates a new context |
|
StaticContext(Interpreter i,
java.lang.Class c,
java.util.Set fp)
Creates a new context |
|
| Method Summary | |
boolean |
classExists(java.lang.String name)
Whether a simple identifier is a class |
Expression |
createName(Node node,
IdentifierToken name)
Creates the tree that is associated with the given name |
void |
defineClass(TypeDeclaration node)
Defines a class from its syntax tree |
void |
defineFunction(MethodDeclaration node)
Defines a MethodDeclaration as a function |
protected boolean |
fieldExists(java.lang.String name)
Whether the given name represents a field in this context |
Node |
getDefaultQualifier(Node node)
Returns the default qualifier for this context |
java.lang.reflect.Field |
getField(java.lang.Class fc,
java.lang.String fn)
Looks for a field |
LeftHandSideModifier |
getModifier(SuperFieldAccess node)
Returns the modifier that match the given node |
java.lang.reflect.Field |
getSuperField(Node node,
java.lang.String fn)
Looks for a field in the super class |
boolean |
isDefined(java.lang.String name)
Tests whether a variable is defined in this context |
protected boolean |
isInnerClass(java.lang.Class c1,
java.lang.Class c2)
Is c1 an inner class of c2? |
java.lang.Class |
lookupClass(java.lang.String cname)
Looks for a class |
java.lang.reflect.Method |
lookupMethod(Node prefix,
java.lang.String mname,
java.lang.Class[] params)
Looks for a method |
java.lang.reflect.Method |
lookupSuperMethod(Node node,
java.lang.String mname,
java.lang.Class[] params)
Looks for a super method |
protected void |
setAccessFlag(java.lang.reflect.Member m)
Sets the access flag of a member |
java.lang.Class |
setProperties(ClassAllocation node,
java.lang.Class c,
java.lang.Class[] args,
java.util.List memb)
Sets the properties of a ClassAllocation node |
| Methods inherited from class koala.dynamicjava.interpreter.context.GlobalContext |
createClassArrayInitializer, declareClassImport, declarePackageImport, exists, getAccessible, getAdditionalClassLoader, getCurrentPackage, getDefaultQualifier, getFunctions, getHiddenArgument, getImportationManager, getInterpreter, getModifier, getModifier, getModifier, getPackageName, invokeConstructor, invokeConstructor, lookupClass, lookupConstructor, lookupFunction, setAccessible, setAdditionalClassLoaderContainer, setCurrentPackage, setFunctions, setImportationManager, setProperties |
| Methods inherited from class koala.dynamicjava.interpreter.context.VariableContext |
define, defineConstant, defineVariables, enterScope, enterScope, get, getConstants, getCurrentScopeVariableNames, getCurrentScopeVariables, isDefinedVariable, isFinal, leaveScope, set, setConstant, setVariable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface koala.dynamicjava.interpreter.context.SimpleContext |
define, defineConstant, defineVariables, enterScope, enterScope, get, getConstants, getCurrentScopeVariableNames, getCurrentScopeVariables, isDefinedVariable, isFinal, leaveScope, set, setConstant, setVariable |
| Field Detail |
protected java.lang.Class declaringClass
protected Node defaultQualifier
| Constructor Detail |
public StaticContext(Interpreter i,
java.lang.Class c,
ImportationManager im)
i - the interpreterc - the declaring class of the methodim - the importation manager
public StaticContext(Interpreter i,
java.lang.Class c,
java.util.Set fp)
i - the interpreterc - the declaring class of the methodfp - the formal parameters| Method Detail |
public boolean isDefined(java.lang.String name)
isDefined in interface ContextisDefined in class GlobalContextname - the name of the entry
public java.lang.reflect.Field getField(java.lang.Class fc,
java.lang.String fn)
throws java.lang.NoSuchFieldException,
AmbiguousFieldException
getField in interface ContextgetField in class GlobalContextfc - the field classfn - the field name
java.lang.NoSuchFieldException - if the field cannot be found
AmbiguousFieldException - if the field is ambiguous
public Expression createName(Node node,
IdentifierToken name)
createName in interface ContextcreateName in class GlobalContextnode - the current nodename - the variable name
java.lang.IllegalStateException - if the variable is not definedpublic Node getDefaultQualifier(Node node)
getDefaultQualifier in interface ContextgetDefaultQualifier in class GlobalContextnode - the current nodepublic LeftHandSideModifier getModifier(SuperFieldAccess node)
getModifier in interface ContextgetModifier in class GlobalContextnode - a tree node
public java.lang.reflect.Method lookupMethod(Node prefix,
java.lang.String mname,
java.lang.Class[] params)
throws java.lang.NoSuchMethodException
lookupMethod in interface ContextlookupMethod in class GlobalContextprefix - the method prefixmname - the method nameparams - the parameter types
java.lang.NoSuchMethodException - if the method cannot be found
public java.lang.reflect.Field getSuperField(Node node,
java.lang.String fn)
throws java.lang.NoSuchFieldException,
AmbiguousFieldException
getSuperField in interface ContextgetSuperField in class GlobalContextnode - the current nodefn - the field name
java.lang.NoSuchFieldException - if the field cannot be found
AmbiguousFieldException - if the field is ambiguous
public java.lang.Class lookupClass(java.lang.String cname)
throws java.lang.ClassNotFoundException
lookupClass in interface ContextlookupClass in class GlobalContextcname - the class name
java.lang.ClassNotFoundException - if the class cannot be foundpublic void defineFunction(MethodDeclaration node)
defineFunction in interface ContextdefineFunction in class GlobalContextnode - the function declarationpublic void defineClass(TypeDeclaration node)
defineClass in interface ContextdefineClass in class GlobalContextnode - the class declaration
public java.lang.Class setProperties(ClassAllocation node,
java.lang.Class c,
java.lang.Class[] args,
java.util.List memb)
setProperties in interface ContextsetProperties in class GlobalContextnode - the allocation nodec - the class of the constructorargs - the classes of the arguments of the constructormemb - the class members
public java.lang.reflect.Method lookupSuperMethod(Node node,
java.lang.String mname,
java.lang.Class[] params)
throws java.lang.NoSuchMethodException
lookupSuperMethod in interface ContextlookupSuperMethod in class GlobalContextnode - the current nodemname - the method nameparams - the parameter types
java.lang.NoSuchMethodException - if the method cannot be foundpublic boolean classExists(java.lang.String name)
classExists in interface ContextclassExists in class GlobalContextname - the identifierprotected void setAccessFlag(java.lang.reflect.Member m)
setAccessFlag in class GlobalContext
protected boolean isInnerClass(java.lang.Class c1,
java.lang.Class c2)
protected boolean fieldExists(java.lang.String name)
name - the field name
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||