-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jimple to JavaObjects to change minimaltestsuite #1162
base: develop
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear we are on the same page: the goal is to transform a StmtGraph to a String containing Java Sourcecode. And if we run that Javacode we should get the equivalent StmtGraph (again)
So the starting point is StmtGraph and not Jimple String? |
yes and please make use/implement a |
if (stmt.getRightOp() instanceof IntConstant) { | ||
typeString = | ||
String.format( | ||
"IntConstant.getInstance(%s)", ((IntConstant) stmt.getRightOp()).getValue()); | ||
} else if (stmt.getRightOp() instanceof Local) { | ||
typeString = | ||
String.format( | ||
"JavaJimple.newLocal(\"%s\", factory.getClassType(\"%s\"))", | ||
((Local) stmt.getRightOp()).getName(), stmt.getRightOp().getType()); | ||
} | ||
javaCodeObjects.add( | ||
String.format( | ||
"Stmt %s = JavaJimple.newAssignment(JavaJimple.newLocal(\"%s\", factory.classType(\"%s\")), %s , noStmtPositionInfo)", | ||
stmt.getLeftOp().toString(), | ||
stmt.getLeftOp().toString(), | ||
stmt.getType().toString(), | ||
typeString)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't forget we have more of those visitors like the ValueVisitor e.g. for Operands
No description provided.