5

I have a large OCaml code base and would like to obtain some UML-like class/module diagrams from it, similar to what some Java reverse engineering tools do.

These diagrams do not need to be formal UML diagrams, but being able to see at least the names of functions/types defined in each module signature would be very useful to help understanding OCaml code bases. Even better if this could be combined with associations between modules.

Can it be done using ocamldoc? I know it is able to produce DOT dependence graphs between modules, but I couldn't find out whether it can produce information about each type/function defined in a module.

anol
  • 8,264
  • 3
  • 34
  • 78

2 Answers2

4

No, ocamldoc can't do this, unless you write a corresponding plugin yourself. The closest match to your needs is, as far as I know, Facebook Pfff. It doesn't generate UML, but it has a dependency code vizualizer, that shows the required information as a design structure matrix.

ivg
  • 34,431
  • 2
  • 35
  • 63
1

opam install odoc-depgraph should do everything you need it to do, if I'm understanding the question correctly.

chrismamo1
  • 917
  • 1
  • 7
  • 15
  • Thanks for the indication, it does generate dependence graphs but they do not seem to contain the equivalent of methods/attributes for each module. For instance, the [example graph](https://zoggy.github.io/stog/ref-doc/index.html) shows all of the modules of Stog, but if I want to know that `Stog_url` contains a value `wrapper` or a function `concat`, I have to click on the module and read its textual contents. If I could see it directly from the diagram, it would be perfect! – anol Jul 16 '15 at 05:59