|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--openjava.ptree.util.ParseTreeVisitor | +--openjava.ptree.util.EvaluationShuttle | +--openjava.ptree.util.ScopeHandler | +--openjava.ptree.util.VariableBinder | +--openjava.ptree.util.ExpansionApplier
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:
new P()
new P[expr]
P.m()
, p.m()
P.f
, p.f
as a right side value
P.f = expr
, p.f = expr
ap[expr]
for P[] ap;
p
(P) expr
including implicit cast
(Q) p
including implicit cast
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.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 |
public ExpansionApplier(Environment env)
Method Detail |
private OJClass getType(Expression p) throws ParseTreeException
ParseTreeException
private OJClass getSelfType() throws ParseTreeException
ParseTreeException
private OJClass getType(TypeName typename) throws ParseTreeException
ParseTreeException
private OJClass computeRefType(TypeName typename, Expression expr) throws ParseTreeException
ParseTreeException
public void visit(AssignmentExpression p) throws ParseTreeException
visit
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(AllocationExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(ArrayAccess p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(ArrayAllocationExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(AssignmentExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(BinaryExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(CastExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(ClassLiteral p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(ConditionalExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(FieldAccess p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(InstanceofExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(Literal p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(MethodCall p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(SelfAccess p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public TypeName evaluateUp(TypeName p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(UnaryExpression p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Expression evaluateUp(Variable p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
public Statement evaluateUp(VariableDeclaration p) throws ParseTreeException
evaluateUp
in class EvaluationShuttle
ParseTreeException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |