* dest will always be an Immediate with VarRef or an Inv
*/
@Override
public BytecodeContext visit(Assign assign) {
Expression destExpr = assign.getDest();
BytecodeRef dest;
if(destExpr instanceof Inv) {
Inv inv = (Inv) destExpr;
BytecodeOperandVisitor opVisitor = new BytecodeOperandVisitor(context);
BytecodeClass clas = (BytecodeClass) inv.getSource().accept(opVisitor);
BytecodeValue val = clas.getContext().getValue(inv.getId());
dest = (BytecodeRef) val;
} else if(destExpr instanceof Immediate) {
Immediate imm = (Immediate) destExpr;
VarRef ref = (VarRef) imm.getInner();
dest = (BytecodeRef) context.getValue(ref.getName());
} else {
throw new RuntimeException("assignment not using Inv or Imm");
}
BytecodeValue src = assign.getSrc().accept(visitor);
dest.setValue(src);
return context;
}