This utility parses source files and constructs diagrams for each interesting function found. This diagram shows the basic blocks of that function making it easier to understand what the code is doing. Also, this can help in refactoring.
It is written in Python and requires PLY to be installed. On Ubuntu, the
python-ply
package is enough. the diagrams are created using DOT, thus
graphviz
has to be installed too.
Running ixcode
without arguments a short usage will be given. Full usage is
given by passing -h
.
A run needs at least the name of the file to be parsed. The user can supply a list of interesting functions, only them would be graphed later.
Example:
./ixcode.py test/simple.c -o outdir
Use the -d
argument only when writing a new grammar.
- Some diagrams are hard to understand without using colors. It is a DOT limitation though.
- This tool assumes that the code compiles successfully. It uses a more permissive grammar than C's and may give wrong results if the code is not legal.
- C grammar is incomplete
- Parse enums, structs and unions, finish C grammar
- Parse and graph
switch
,case
,continue
andbreak
. - Add a config file for colors
- Add support for Python too.
- Add regexp support for function matching
- Create a more interesting presentation for the tool.
- Prepare for ROSEdu CDL
- Make this list into a GitHub issues series.