@@ -34,9 +34,9 @@ Find `Slice` class (`tfm/slicing`), set the program path and execute. The sliced
## Structure
Graphs are built using a library called `graphlib`, located in `lib/graphlib.jar`. This library is old and has some issues I had to fix...
Graphs are built using a library called `JGraphT`.
The main class is the `Graph` class, which extends from `graphlib`'s `Graph` class. This class includes some behaviour fixes, and some general interest methods (like `toString`, `toGraphvizRepresentation`, etc.)
The main class is the `Graph` class, which extends from `JGraphT`'s `DefaultDirectedGraph` class. This class includes some general interest methods (like `toString`, etc.)
Every graph has a set of nodes and arrows. `GraphNode` and `Arc` classes are used to represent them respectively.
@@ -104,7 +104,7 @@ Forget about the `tfm/scopes` folder, it was an idea I had to discard and it has
### General
- Switch to a (much) better graph library like [JGraphT](https://jgrapht.org/). It also supports graph visualization
- Switch to a (much) better graph library like [JGraphT](https://jgrapht.org/). It also supports graph visualization (done).
- Performance review
- Make a test suite (test graph building, slicing, etc.)
- Add support to more Java language features (lambdas, etc.)
@@ -114,28 +114,44 @@ Forget about the `tfm/scopes` folder, it was an idea I had to discard and it has
### Build a CFG from a program
```java
publicCFGGraphbuildCFG(FileprogramFile){
JavaParser.getStaticConfiguration().setAttributeComments(false);// Always disable comments, just in case
publicclassExample{
publicCFGbuildCFG(FileprogramFile){
// Always disable attribution of comments, just in case