koala.dynamicjava.interpreter
Class NodeProperties

java.lang.Object
  extended by koala.dynamicjava.interpreter.NodeProperties

public class NodeProperties
extends Object

This class provides concrete methods to facilitate attaching and reading auxiliary properties associated with AST nodes. To encourage safety, the properties defined here should be manipulated exclusively through this interface (a better design would require working through the interface...)


Field Summary
static String ASSERTED_TYPE
          A Thunk> representing the asserted type of an upcast (for diagnostic purposes).
static String CHECKED_TYPE
          A Thunk> representing the checked cast type of a cast, method, or field
static String CONSTRUCTOR
          DJConstructor used by a constructor invocation
static String CONVERTED_TYPE
          A Thunk> representing the converted type of a primitive cast
static String DJCLASS
          DJClass declared by a class declaration or referenced by "this"
static String ENCLOSING_THIS
          This DJClass of "this" used implicitly as the enclosing object of an allocation.
static String ERASED_TYPE
          A Thunk> representing the erased type of certain expressions and statements.
static String ERROR
          An ExecutionError that occurred at the given node.
static String ERROR_CONTEXT
          The new context that would have been the result had there not been an error.
static String ERROR_STRINGS
          The errorStrings property contains an array of additional messages (Strings)
static String FIELD
          DJField used by a field access or declared by a field declaration
static String LEFT_EXPRESSION
          An Expression representing the (possibly promoted) left side of an assignment or increment/decrement in which the value of the left expression is used to calculate the new value
static String METHOD
          Method used by a method invocation or declared by a method declaration
static Lambda<Node,Type> NODE_TYPE
           
static Lambda<Node,VariableType> NODE_TYPE_VARIABLE
           
static Lambda<Node,LocalVariable> NODE_VARIABLE
           
static String OPERATION
          A Lambda2 -- determines the operation to be used where it is ambiguous (for example, a PlusExpression might require addition or concatenation)
static String STATEMENT_TRANSLATION
          A Node representing the translated equivalent of the tagged statement (or declaration)
static String SUPER_TYPE
          The Type extended by an AnonymousInnerAllocation (not necessary for AnonymousAllocations and TypeDeclarations, because the type is expressed in the syntax).
static String TRANSLATION
          An Expression representing the translated equivalent of the tagged Expression
static String TYPE
          The Type of an expression
static String TYPE_VARIABLE
          VariableType declared in a class or method signature
static String VALUE
          An Object value of a constant expression
static String VARIABLE
          A LocalVariable corresponding to the variable declared by the given node
static String VARIABLE_TYPE
          The Type of an expression when treated as a variable (an lvalue)
 
Constructor Summary
protected NodeProperties()
          This class contains only static method and constants, so it is not useful to create instances of it.
 
Method Summary
static Thunk<Class<?>> getAssertedType(Node n)
           
static Thunk<Class<?>> getCheckedType(Node n)
           
static DJConstructor getConstructor(Node n)
           
static Thunk<Class<?>> getConvertedType(Node n)
           
static DJClass getDJClass(Node n)
           
static DJClass getEnclosingThis(Node n)
           
static Thunk<Class<?>> getErasedType(Node n)
           
static ExecutionError getError(Node n)
           
static TypeContext getErrorContext(Node n)
           
static String[] getErrorStrings(Node n)
           
static DJField getField(Node n)
           
static Expression getLeftExpression(Node n)
           
static DJMethod getMethod(Node n)
           
static Lambda2<Object,Object,Object> getOperation(Node n)
           
static Node getStatementTranslation(Node n)
           
static Type getSuperType(Node n)
           
static Expression getTranslation(Node n)
           
static Type getType(Node n)
           
static VariableType getTypeVariable(Node n)
           
static Object getValue(Node n)
           
static LocalVariable getVariable(Node n)
           
static Type getVariableType(Node n)
           
static boolean hasAssertedType(Node n)
           
static boolean hasCheckedType(Node n)
           
static boolean hasConstructor(Node n)
           
static boolean hasConvertedType(Node n)
           
static boolean hasDJClass(Node n)
           
static boolean hasEnclosingThis(Node n)
           
static boolean hasErasedType(Node n)
           
static boolean hasError(Node n)
           
static boolean hasErrorContext(Node n)
           
static boolean hasErrorStrings(Node n)
           
static boolean hasField(Node n)
           
static boolean hasLeftExpression(Node n)
           
static boolean hasMethod(Node n)
           
static boolean hasOperation(Node n)
           
static boolean hasStatementTranslation(Node n)
           
static boolean hasSuperType(Node n)
           
static boolean hasTranslation(Node n)
           
static boolean hasType(Node n)
           
static boolean hasTypeVariable(Node n)
           
static boolean hasValue(Node n)
           
static boolean hasVariable(Node n)
           
static boolean hasVariableType(Node n)
           
static Thunk<Class<?>> setAssertedType(Node n, Thunk<Class<?>> c)
           
static Thunk<Class<?>> setCheckedType(Node n, Thunk<Class<?>> c)
           
static DJConstructor setConstructor(Node n, DJConstructor c)
           
static Thunk<Class<?>> setConvertedType(Node n, Thunk<Class<?>> c)
           
static DJClass setDJClass(Node n, DJClass c)
           
static DJClass setEnclosingThis(Node n, DJClass c)
           
static Thunk<Class<?>> setErasedType(Node n, Thunk<Class<?>> c)
           
static ExecutionError setError(Node n, ExecutionError e)
           
static TypeContext setErrorContext(Node n, TypeContext c)
           
static String[] setErrorStrings(Node n, String... strings)
           
static DJField setField(Node n, DJField f)
           
static Expression setLeftExpression(Node n, Expression exp)
           
static DJMethod setMethod(Node n, DJMethod m)
           
static Lambda2<Object,Object,Object> setOperation(Node n, Lambda2<Object,Object,Object> f)
           
static Node setStatementTranslation(Node n, Node s)
           
static Type setSuperType(Node n, Type t)
           
static Expression setTranslation(Node n, Expression exp)
           
static Type setType(Node n, Type t)
           
static VariableType setTypeVariable(Node n, VariableType v)
           
static Object setValue(Node n, Object o)
           
static LocalVariable setVariable(Node n, LocalVariable v)
           
static Type setVariableType(Node n, Type t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE

public static final String TYPE
The Type of an expression

See Also:
Constant Field Values

NODE_TYPE

public static final Lambda<Node,Type> NODE_TYPE

VARIABLE_TYPE

public static final String VARIABLE_TYPE
The Type of an expression when treated as a variable (an lvalue)

See Also:
Constant Field Values

SUPER_TYPE

public static final String SUPER_TYPE
The Type extended by an AnonymousInnerAllocation (not necessary for AnonymousAllocations and TypeDeclarations, because the type is expressed in the syntax).

See Also:
Constant Field Values

CONVERTED_TYPE

public static final String CONVERTED_TYPE
A Thunk> representing the converted type of a primitive cast

See Also:
Constant Field Values

ASSERTED_TYPE

public static final String ASSERTED_TYPE
A Thunk> representing the asserted type of an upcast (for diagnostic purposes).

See Also:
Constant Field Values

CHECKED_TYPE

public static final String CHECKED_TYPE
A Thunk> representing the checked cast type of a cast, method, or field

See Also:
Constant Field Values

ERASED_TYPE

public static final String ERASED_TYPE
A Thunk> representing the erased type of certain expressions and statements.

See Also:
Constant Field Values

LEFT_EXPRESSION

public static final String LEFT_EXPRESSION
An Expression representing the (possibly promoted) left side of an assignment or increment/decrement in which the value of the left expression is used to calculate the new value

See Also:
Constant Field Values

TRANSLATION

public static final String TRANSLATION
An Expression representing the translated equivalent of the tagged Expression

See Also:
Constant Field Values

STATEMENT_TRANSLATION

public static final String STATEMENT_TRANSLATION
A Node representing the translated equivalent of the tagged statement (or declaration)

See Also:
Constant Field Values

VALUE

public static final String VALUE
An Object value of a constant expression

See Also:
Constant Field Values

ERROR_STRINGS

public static final String ERROR_STRINGS
The errorStrings property contains an array of additional messages (Strings)

See Also:
Constant Field Values

VARIABLE

public static final String VARIABLE
A LocalVariable corresponding to the variable declared by the given node

See Also:
Constant Field Values

NODE_VARIABLE

public static final Lambda<Node,LocalVariable> NODE_VARIABLE

CONSTRUCTOR

public static final String CONSTRUCTOR
DJConstructor used by a constructor invocation

See Also:
Constant Field Values

FIELD

public static final String FIELD
DJField used by a field access or declared by a field declaration

See Also:
Constant Field Values

METHOD

public static final String METHOD
Method used by a method invocation or declared by a method declaration

See Also:
Constant Field Values

DJCLASS

public static final String DJCLASS
DJClass declared by a class declaration or referenced by "this"

See Also:
Constant Field Values

ENCLOSING_THIS

public static final String ENCLOSING_THIS
This DJClass of "this" used implicitly as the enclosing object of an allocation.

See Also:
Constant Field Values

TYPE_VARIABLE

public static final String TYPE_VARIABLE
VariableType declared in a class or method signature

See Also:
Constant Field Values

NODE_TYPE_VARIABLE

public static final Lambda<Node,VariableType> NODE_TYPE_VARIABLE

ERROR

public static final String ERROR
An ExecutionError that occurred at the given node.

See Also:
Constant Field Values

ERROR_CONTEXT

public static final String ERROR_CONTEXT
The new context that would have been the result had there not been an error.

See Also:
Constant Field Values

OPERATION

public static final String OPERATION
A Lambda2 -- determines the operation to be used where it is ambiguous (for example, a PlusExpression might require addition or concatenation)

See Also:
Constant Field Values
Constructor Detail

NodeProperties

protected NodeProperties()
This class contains only static method and constants, so it is not useful to create instances of it.

Method Detail

getType

public static Type getType(Node n)

setType

public static Type setType(Node n,
                           Type t)

hasType

public static boolean hasType(Node n)

getVariableType

public static Type getVariableType(Node n)

setVariableType

public static Type setVariableType(Node n,
                                   Type t)

hasVariableType

public static boolean hasVariableType(Node n)

getSuperType

public static Type getSuperType(Node n)

setSuperType

public static Type setSuperType(Node n,
                                Type t)

hasSuperType

public static boolean hasSuperType(Node n)

getConvertedType

public static Thunk<Class<?>> getConvertedType(Node n)

setConvertedType

public static Thunk<Class<?>> setConvertedType(Node n,
                                               Thunk<Class<?>> c)

hasConvertedType

public static boolean hasConvertedType(Node n)

getAssertedType

public static Thunk<Class<?>> getAssertedType(Node n)

setAssertedType

public static Thunk<Class<?>> setAssertedType(Node n,
                                              Thunk<Class<?>> c)

hasAssertedType

public static boolean hasAssertedType(Node n)

getCheckedType

public static Thunk<Class<?>> getCheckedType(Node n)

setCheckedType

public static Thunk<Class<?>> setCheckedType(Node n,
                                             Thunk<Class<?>> c)

hasCheckedType

public static boolean hasCheckedType(Node n)

getErasedType

public static Thunk<Class<?>> getErasedType(Node n)

setErasedType

public static Thunk<Class<?>> setErasedType(Node n,
                                            Thunk<Class<?>> c)

hasErasedType

public static boolean hasErasedType(Node n)

getLeftExpression

public static Expression getLeftExpression(Node n)

setLeftExpression

public static Expression setLeftExpression(Node n,
                                           Expression exp)

hasLeftExpression

public static boolean hasLeftExpression(Node n)

getTranslation

public static Expression getTranslation(Node n)

setTranslation

public static Expression setTranslation(Node n,
                                        Expression exp)

hasTranslation

public static boolean hasTranslation(Node n)

getStatementTranslation

public static Node getStatementTranslation(Node n)

setStatementTranslation

public static Node setStatementTranslation(Node n,
                                           Node s)

hasStatementTranslation

public static boolean hasStatementTranslation(Node n)

getValue

public static Object getValue(Node n)

setValue

public static Object setValue(Node n,
                              Object o)

hasValue

public static boolean hasValue(Node n)

getErrorStrings

public static String[] getErrorStrings(Node n)

setErrorStrings

public static String[] setErrorStrings(Node n,
                                       String... strings)

hasErrorStrings

public static boolean hasErrorStrings(Node n)

getVariable

public static LocalVariable getVariable(Node n)

setVariable

public static LocalVariable setVariable(Node n,
                                        LocalVariable v)

hasVariable

public static boolean hasVariable(Node n)

getConstructor

public static DJConstructor getConstructor(Node n)

setConstructor

public static DJConstructor setConstructor(Node n,
                                           DJConstructor c)

hasConstructor

public static boolean hasConstructor(Node n)

getField

public static DJField getField(Node n)

setField

public static DJField setField(Node n,
                               DJField f)

hasField

public static boolean hasField(Node n)

getMethod

public static DJMethod getMethod(Node n)

setMethod

public static DJMethod setMethod(Node n,
                                 DJMethod m)

hasMethod

public static boolean hasMethod(Node n)

getDJClass

public static DJClass getDJClass(Node n)

setDJClass

public static DJClass setDJClass(Node n,
                                 DJClass c)

hasDJClass

public static boolean hasDJClass(Node n)

getEnclosingThis

public static DJClass getEnclosingThis(Node n)

setEnclosingThis

public static DJClass setEnclosingThis(Node n,
                                       DJClass c)

hasEnclosingThis

public static boolean hasEnclosingThis(Node n)

getTypeVariable

public static VariableType getTypeVariable(Node n)

setTypeVariable

public static VariableType setTypeVariable(Node n,
                                           VariableType v)

hasTypeVariable

public static boolean hasTypeVariable(Node n)

getError

public static ExecutionError getError(Node n)

setError

public static ExecutionError setError(Node n,
                                      ExecutionError e)

hasError

public static boolean hasError(Node n)

getErrorContext

public static TypeContext getErrorContext(Node n)

setErrorContext

public static TypeContext setErrorContext(Node n,
                                          TypeContext c)

hasErrorContext

public static boolean hasErrorContext(Node n)

getOperation

public static Lambda2<Object,Object,Object> getOperation(Node n)

setOperation

public static Lambda2<Object,Object,Object> setOperation(Node n,
                                                         Lambda2<Object,Object,Object> f)

hasOperation

public static boolean hasOperation(Node n)