Question

I need to manipulate control flow graphs for Java code in a project. What might be a good java library to generate control flow graphs in Java. So far I have found a couple eclipse plugins (heavily dependent on eclipse APIs) and standalone tools (cannot embed in my code).

Was it helpful?

Solution

A tool to do this stuff is Soot, and this questions is a duplicate of Tool for generating control flow in Java

OTHER TIPS

jSonde will create sequence diagrams from your actual running code (which is arguably more useful than from source, since source analysis will not show implementation-specific functionality).

javacalltracer does something similar.

Most tools are integrated into Eclipse/similar so they have access to the AST, which makes such things pretty trivial.

It's actually not ridiculously complex to pull the information from byte code yourself (and it's an interesting exercise). Or instrument using AspectJ and create the runtime information yourself.

Edit Original answer, still valid.

JGraph is open-source, and pretty cool.

JDiagram is a Swing component, commercial product.

I'll throw another tool into the mix.

Atlas is an Eclipse plugin that enables program analysis. It has a querable graph database that includes the control flow graph (as well as data flow and other relationships).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top