Skip to content

Conversation

@sahilagichani14
Copy link
Collaborator

No description provided.

@sahilagichani14 sahilagichani14 linked an issue Jan 20, 2025 that may be closed by this pull request
3 tasks
@sahilagichani14 sahilagichani14 marked this pull request as draft January 20, 2025 05:13
Copy link
Collaborator

@swissiety swissiety left a 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)

@sahilagichani14
Copy link
Collaborator Author

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?

@swissiety
Copy link
Collaborator

yes and please make use/implement a StmtVisitor to print the details of the respective Stmts. And in those methods of the StmtVisitor you could make use of that JavaPoet library if it helps you to keep track of the different Java variables of the generated source code. Maybe a Map<Value, JavaVariableNameString> of already generated Jimple objects would suffice as well, so you could generate each Stmt and initialize its Operands or reuse the already created ones.

@sahilagichani14 sahilagichani14 marked this pull request as ready for review March 15, 2025 23:01
@sahilagichani14 sahilagichani14 marked this pull request as draft March 17, 2025 09:39
List<Stmt> bodyStmts = body.getStmts();
if (!bodyStmts.isEmpty()) {
Iterator<Stmt> stmtIterator = bodyStmts.iterator();
// TODO: how to add edges or blocks when jumping statements?
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@swissiety can we have a call to discuss this part?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: JimpleJavaObjectPrinter

3 participants