PreviousUpNext

15.3.322  src/lib/graph/make-empty-graph.api

## make-empty-graph.api
#
# API extracting just the make_empty_graph call from a graph implementation.
# (Since all other calls are made via fns in the returned record, this is pretty
# much the whole interface.)
#
# Ultimately, the actual underlying digraph implementation is almost always:
#
#     src/lib/graph/digraph-by-adjacency-list-g.pkg
#
# In the Mythryl compiler backend lowhalf we usually used this wrapped up as:
#
#     src/lib/compiler/back/low/mcg/machcode-controlflow-graph-g.pkg

# Compiled by:
#     src/lib/graph/graphs.lib

stipulate
    package odg =  oop_digraph;                                                 # oop_digraph           is from   src/lib/graph/oop-digraph.pkg
herein

    # This api is referenced in:
    #
    #     src/lib/graph/dominator-tree.api
    #     src/lib/graph/dominator-tree-g.pkg
    #     
    #     src/lib/graph/loop-structure.api
    #     src/lib/graph/loop-structure-g.pkg
    #     
    #     src/lib/graph/digraph-by-adjacency-list-g.pkg
    #     src/lib/graph/undirected-graph-g.pkg
    #     src/lib/graph/graph-snapshot-g.pkg
    #     
    #     src/lib/compiler/back/low/ir-archive/cdg.pkg
    #     src/lib/compiler/back/low/mcg/machcode-controlflow-graph-g.pkg
    #
    api Make_Empty_Graph {
        #
        make_empty_graph
          :
          { graph_name:             String,                                     # Arbitrary name for graph.
            graph_info:             G,                                          # Arbitrary client-package value to be associated with graph.
            expected_node_count:    Int                                         # Serves as a hint for initial sizing of internal graph vectors.  This is not a hard limit.
          }
          -> odg::Digraph (N,E,G);                                              # "N,E,G" ==  types for node-, edge-, and graph-associated info specified by client package.
    };

end;


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext