Local local = (Local) rightOp;
_updateTypeInAssignment(leftOp, in.get(local), out);
} else if (rightOp instanceof NewExpr) {
NewExpr newExpr = (NewExpr) rightOp;
RefType type = newExpr.getBaseType();
SootClass castClass = type.getSootClass();
// If we are creating a Token type...
if (SootUtilities.derivesFrom(castClass,
PtolemyUtilities.tokenClass)) {
// Then the rightOp of the expression is the type of the
// constructor.
_updateTypeInAssignment(leftOp, PtolemyUtilities
.getTokenTypeForSootType(type), out);
} else {
// Otherwise there is nothing to be done.
}
} else if (rightOp instanceof NewArrayExpr) {
// Since arrays are aliasable, we must update their types.
NewArrayExpr newExpr = (NewArrayExpr) rightOp;
Type type = newExpr.getBaseType();
RefType tokenType = PtolemyUtilities.getBaseTokenType(type);
if (tokenType != null) {
_updateTypeInAssignment(leftOp, PtolemyUtilities
.getTokenTypeForSootType(tokenType), out);
}
// Otherwise there is nothing to be done.
} else if (rightOp instanceof FieldRef) {
// System.out.println("fieldRef stmt = " + stmt);
FieldRef fieldRef = (FieldRef) rightOp;
SootField field = fieldRef.getField();
TypeTag tag = (TypeTag) field.getTag("_CGType");
Object newType;
if (tag == null) {
// System.out.println("No Tag... Existing type = " + in.get(rightOp));
// System.out.println("No Tag... field type = " + field.getType());
if (in.get(rightOp) == null) {
RefType fieldType = PtolemyUtilities
.getBaseTokenType(field.getType());
newType = PtolemyUtilities
.getTokenTypeForSootType(fieldType);
} else {
// Then flow the type.