|
|||||||||||
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 managerpublic StaticContext(Interpreter i, java.lang.Class c, java.util.Set fp)
i
- the interpreterc
- the declaring class of the methodfp
- the formal parametersMethod Detail |
public boolean isDefined(java.lang.String name)
isDefined
in interface Context
isDefined
in class GlobalContext
name
- 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 Context
getField
in class GlobalContext
fc
- the field classfn
- the field name
java.lang.NoSuchFieldException
- if the field cannot be found
AmbiguousFieldException
- if the field is ambiguouspublic Expression createName(Node node, IdentifierToken name)
createName
in interface Context
createName
in class GlobalContext
node
- the current nodename
- the variable name
java.lang.IllegalStateException
- if the variable is not definedpublic Node getDefaultQualifier(Node node)
getDefaultQualifier
in interface Context
getDefaultQualifier
in class GlobalContext
node
- the current nodepublic LeftHandSideModifier getModifier(SuperFieldAccess node)
getModifier
in interface Context
getModifier
in class GlobalContext
node
- a tree nodepublic java.lang.reflect.Method lookupMethod(Node prefix, java.lang.String mname, java.lang.Class[] params) throws java.lang.NoSuchMethodException
lookupMethod
in interface Context
lookupMethod
in class GlobalContext
prefix
- the method prefixmname
- the method nameparams
- the parameter types
java.lang.NoSuchMethodException
- if the method cannot be foundpublic java.lang.reflect.Field getSuperField(Node node, java.lang.String fn) throws java.lang.NoSuchFieldException, AmbiguousFieldException
getSuperField
in interface Context
getSuperField
in class GlobalContext
node
- the current nodefn
- the field name
java.lang.NoSuchFieldException
- if the field cannot be found
AmbiguousFieldException
- if the field is ambiguouspublic java.lang.Class lookupClass(java.lang.String cname) throws java.lang.ClassNotFoundException
lookupClass
in interface Context
lookupClass
in class GlobalContext
cname
- the class name
java.lang.ClassNotFoundException
- if the class cannot be foundpublic void defineFunction(MethodDeclaration node)
defineFunction
in interface Context
defineFunction
in class GlobalContext
node
- the function declarationpublic void defineClass(TypeDeclaration node)
defineClass
in interface Context
defineClass
in class GlobalContext
node
- the class declarationpublic java.lang.Class setProperties(ClassAllocation node, java.lang.Class c, java.lang.Class[] args, java.util.List memb)
setProperties
in interface Context
setProperties
in class GlobalContext
node
- the allocation nodec
- the class of the constructorargs
- the classes of the arguments of the constructormemb
- the class memberspublic java.lang.reflect.Method lookupSuperMethod(Node node, java.lang.String mname, java.lang.Class[] params) throws java.lang.NoSuchMethodException
lookupSuperMethod
in interface Context
lookupSuperMethod
in class GlobalContext
node
- 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 Context
classExists
in class GlobalContext
name
- 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 |