openjava.ptree.util
Class ExpansionApplier

java.lang.Object
  |
  +--openjava.ptree.util.ParseTreeVisitor
        |
        +--openjava.ptree.util.EvaluationShuttle
              |
              +--openjava.ptree.util.ScopeHandler
                    |
                    +--openjava.ptree.util.VariableBinder
                          |
                          +--openjava.ptree.util.ExpansionApplier
Direct Known Subclasses:
SaffronExpansionApplier

public class ExpansionApplier
extends VariableBinder

The class ExpansionApplier is an evaluator of each objects of ParseTree family. Each methods in this class is invoked from the class EvaluationShuttle.

The method evaluateDown() is invoked before evaluating the children of the parse tree object, and evaluateUp() is invoked after the evaluation.

For a class P and a object p statically typed as P, the parts in source code each expantion will be applied are:

in feature version:

Since:
%SOFTWARE% 1.0
Version:
1.0
Author:
Michiaki Tatsubori
See Also:
ParseTree, EvaluationShuttle

Field Summary
 
Fields inherited from class openjava.ptree.util.ScopeHandler
 
Fields inherited from class openjava.ptree.util.EvaluationShuttle
 
Constructor Summary
ExpansionApplier(Environment env)
           
 
Method Summary
private  OJClass computeRefType(TypeName typename, Expression expr)
           
 Expression evaluateUp(AllocationExpression p)
          Includes expandAllocation() and expandExpression().
 Expression evaluateUp(ArrayAccess p)
          Includes expandArrayAccess() and expandExpression().
 Expression evaluateUp(ArrayAllocationExpression p)
          Includes expandArrayAllocation() and expandExpression().
 Expression evaluateUp(AssignmentExpression p)
          Includes expandFieldWrite(), expandAssignmentExpression() and expandExpression().
 Expression evaluateUp(BinaryExpression p)
          Includes expandExpression().
 Expression evaluateUp(CastExpression p)
          Includes expandCastExpression(), expandCastedExpression() and expandExpression().
 Expression evaluateUp(ClassLiteral p)
          Includes expandExpression().
 Expression evaluateUp(ConditionalExpression p)
          Includes expandExpression().
 Expression evaluateUp(FieldAccess p)
          Includes expandFieldRead() and expandExpression().
 Expression evaluateUp(InstanceofExpression p)
          Includes expandExpression().
 Expression evaluateUp(Literal p)
          Includes expandExpression().
 Expression evaluateUp(MethodCall p)
          Includes expandMethodCall() and expandExpression().
 Expression evaluateUp(SelfAccess p)
          Includes expandExpression().
 TypeName evaluateUp(TypeName p)
          Includes expandTypeName().
 Expression evaluateUp(UnaryExpression p)
          Includes expandExpression().
 Expression evaluateUp(Variable p)
          Includes expandExpression().
 Statement evaluateUp(VariableDeclaration p)
          Includes expandVariableDeclaration().
private  OJClass getSelfType()
           
private  OJClass getType(Expression p)
           
private  OJClass getType(TypeName typename)
          Converts a type name to a class.
 void visit(AssignmentExpression p)
           
 
Methods inherited from class openjava.ptree.util.VariableBinder
evaluateDown, evaluateDown, evaluateDown
 
Methods inherited from class openjava.ptree.util.ScopeHandler
evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, pop, push, pushClosedEnvironment
 
Methods inherited from class openjava.ptree.util.EvaluationShuttle
evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateDown, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, evaluateUp, getEnvironment, setEnvironment, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class openjava.ptree.util.ParseTreeVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpansionApplier

public ExpansionApplier(Environment env)
Method Detail

getType

private OJClass getType(Expression p)
                 throws ParseTreeException
ParseTreeException

getSelfType

private OJClass getSelfType()
                     throws ParseTreeException
ParseTreeException

getType

private OJClass getType(TypeName typename)
                 throws ParseTreeException
Converts a type name to a class. Never returns null.

ParseTreeException

computeRefType

private OJClass computeRefType(TypeName typename,
                               Expression expr)
                        throws ParseTreeException
ParseTreeException

visit

public void visit(AssignmentExpression p)
           throws ParseTreeException
Overrides:
visit in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(AllocationExpression p)
                      throws ParseTreeException
Includes expandAllocation() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(ArrayAccess p)
                      throws ParseTreeException
Includes expandArrayAccess() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(ArrayAllocationExpression p)
                      throws ParseTreeException
Includes expandArrayAllocation() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(AssignmentExpression p)
                      throws ParseTreeException
Includes expandFieldWrite(), expandAssignmentExpression() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(BinaryExpression p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(CastExpression p)
                      throws ParseTreeException
Includes expandCastExpression(), expandCastedExpression() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(ClassLiteral p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(ConditionalExpression p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(FieldAccess p)
                      throws ParseTreeException
Includes expandFieldRead() and expandExpression(). Not to be applied for itself.

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(InstanceofExpression p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(Literal p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(MethodCall p)
                      throws ParseTreeException
Includes expandMethodCall() and expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(SelfAccess p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public TypeName evaluateUp(TypeName p)
                    throws ParseTreeException
Includes expandTypeName().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(UnaryExpression p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Expression evaluateUp(Variable p)
                      throws ParseTreeException
Includes expandExpression().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

evaluateUp

public Statement evaluateUp(VariableDeclaration p)
                     throws ParseTreeException
Includes expandVariableDeclaration().

Overrides:
evaluateUp in class EvaluationShuttle
ParseTreeException

SourceForge.net_Logo