Today I've pushed the functionality to let the C2 compiler generate the full dependency graph for a project.
The output is in XML form and shows types, (global)variables and functions and their complete relationship.
Also the containing package is show and optionally the file they're in. (yes functions are in a single file! no
header/c-file issues here
)
To show how this works, I've analysed the puzzle.c2 example (
c2lang.org/docs/puzzle.c2).
The resulting architecture is show in
c2lang.org/docs/puzzle_arch1.png.
Then I refactored it, by extracting some functions/vars into a separate file (really easy, just move them to
a new file, add that to recipe and done). This results in
c2lang.org/docs/puzzle_arch2.png.
While the example is very small, it already starts showing the potential of the language/tools.
The next step will be to integrate these into
c2reto (C2 refactor tool), so that drag-n-drop refactoring
and continuous visualization is possible. I can't wait to see how that works out!