Class Hierarchy Graphs

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Mar 29 15:44:02 PDT 2015


On 3/29/15 9:18 AM, w0rp wrote:
> On Sunday, 29 March 2015 at 15:40:56 UTC, Andrei Alexandrescu wrote:
>> One other informative graph that should be much easier to generate is
>> the direct imports graph (no transitivity).
>
> I had a go at it, and I have something for that now. This graph should
> show what std.regex imports. I'm not sure if anything is missing from
> the module info. I imagine there's a template which might need
> insantiating first in order to add in import line, and I'm not sure if
> the ModuleInfo will include all the scoped imports or not. I assume it
> does.
>
> https://i.imgur.com/r1TZVKO.png
>
> I added an extra method named 'addModuleWithDirectDepdencies' for adding
> a module to the set of modules and just its direct dependencies, not the
> transitive dependencies. Then I added an extra set to the structure for
> tracking which modules are supposed to be leaf nodes in the graph, and
> made the DOT functions check for that.
>
> I had to add the leaf checking, as the dependencies could be importing
> each other, and the structure was only storing nodes, not edges. I
> should maybe make the structures store just a directed graph, but whatever.

Awesome. Two more ideas:

* imports in unittest mode vs. not (will show how good we are at making 
imports local)

* direct imports but followed transitively, e.g. the graph for 
std.regex' imports would show the imports of the modules imported etc.


Andrei


More information about the Digitalmars-d mailing list