Before this commit the port number was incorrectly increased when there
were no arguments in a function type, causing edges to be routed in a
less accurate way.
This commit fixes the problem.
This uses the "rank=source" feature of graphviz, that allows to select
what are the nodes with mimimal rank in a graph.
We use this to mark all the nodes that represent functions and segments
so that the graph layout is more deterministic and readable across
multiple runs when the input Model is very similar.
This reworks NameBuilder to ease the transition to the system where
the model will be guaranteed to never contain any name collisions, both
between user-specified names and the automatic ones.
- change the font of the emitted graph to `Courier`, which is the only
monospace font graphviz guarantees to support
- tweak color of the union definitions to be slightly lighter (so that
it doesn't clash as much with the other colors used)
- change the color of all the "other" nodes (like typedef) from white
to grey, so that they are visible on light backgrounds.
- leave a todo about `buildFieldName` being obsolete.
Before this commit, the TypeSystemPrinter implicitly assumed that
model::Function and model::DynamicFunction always had a prototype.
However, this is not guaranteed by the model schema.
This commit extends the TypeSystemPrinter so that it doesn't make that
wrong assumption anymore, and can successfully print any model::Function
and model::DynamicFunction, even when a prototype is not present.