[m-rev.] for review: --imports-graph option
Peter Ross
pro at missioncriticalit.com
Wed Jun 13 12:32:08 AEST 2007
On 6/13/07, Peter Wang <wangp at students.csse.unimelb.edu.au> wrote:
> On 2007-06-13, Peter Ross <pro at missioncriticalit.com> wrote:
> >
> > Estimated hours taken: 3
> > Branches: main
> >
> > Add the option --imports-graph which outputs the directed graph of
> > module A imports module B.
>
> Can you explain that more clearly?
>
Add the option --imports-graph which outputs the directed graph of
which modules import which other modules into <module>.imports_graph.
> > +:- func filter_relation(pair(sym_name, sym_name),
> > + relation(sym_name)) = relation(sym_name).
> > +
>
> You might want to rename filter_relation, write_relation, write_node
> and write_edge to less ambiguous names.
>
renamed to filter_imports_relation
write_relation, write_node and write_edge now take a function which
converts the T into a string which represents that T, so they are now
fully generic.
Maybe these routines should now go into relation.m?
> > +:- pred write_edge(io.output_stream::in, sym_name::in, sym_name::in,
> > + io::di, io::uo) is det.
> > +
> > +write_edge(Stream, A, B, !IO) :-
> > + % Names can't contain "." so use "__"
> > + io.write_string(Stream, sym_name_to_string_sep(A, "__"), !IO),
> > + io.write_string(Stream, " -> ", !IO),
> > + io.write_string(Stream, sym_name_to_string_sep(B, "__"), !IO),
> > + io.write_string(Stream, ";\n", !IO).
>
> I think dot labels can contain . if you use quotes.
>
They are now quoted and contain the "."
> > @@ -3318,6 +3321,10 @@
> > "\tuse the `--no-llds-optimize' option.)",
> > "--show-dependency-graph",
> > "\tWrite out the dependency graph to `<module>.dependency_graph'.",
> > + "--imports-graph",
> > + "\tWrite out the imports graph to `<module>.imports_graph'.",
> > + "\tThe imports graph shows the directed graph module A",
> > + "\timports module B.",
>
> It doesn't mention that these can be processed by dot.
>
Added the sentence.
The resulting file can be processed by the graphviz tools.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to: mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions: mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------
More information about the reviews
mailing list