2 * ----------------------------------------------------------------------
10 (* A directed graph whose edges are marked with strings (= element types)
11 * and with the constraint that for a given vertex and a given element
12 * type the edge must be unique.
15 exception Edge_not_unique
17 val create : unit -> graph
18 (* Creates an empty graph *)
20 val new_vertex : graph -> vertex
21 (* Adds a new vertex to the graph, and returns the vertex *)
23 val new_edge : vertex -> string -> vertex -> unit
24 (* new_edge v_from etype v_to:
25 * Adds a new edge from vertex v_from to vertex v_to, marked with
27 * Raises Edge_not_unique if there is already an edge etype starting
28 * at v_from to a different vertex than v_to.
31 val graph_of_vertex : vertex -> graph
32 (* Returns the graph the passed vertex is contained in. *)
34 val union : graph -> graph -> unit
36 * Moves the vertexes and edged found in g2 to g1.
37 * After that, g2 is empty again.
40 val outgoing_edges : vertex -> (string * vertex) list
41 (* Returns the list of outgoing edges starting in the passed vertex *)
43 val follow_edge : vertex -> string -> vertex
44 (* Follows the edge starting in the passed vertex which is marked
45 * with the passed element type.
46 * Raises Not_found if there is no such edge.
49 val ingoing_edges : vertex -> (vertex * string) list
50 (* Returns the list of ingoing edges ending in the passed vertex *)
53 module VertexSet : Set.S with type elt = Graph.vertex
57 { dfa_graph : Graph.graph;
58 dfa_start : Graph.vertex; (* Where the automaton starts *)
59 dfa_stops : VertexSet.t; (* Where the automaton may stop *)
60 dfa_null : bool; (* Whether dfa_start member of dfa_stops *)
63 val dfa_of_regexp_content_model : Pxp_types.regexp_spec -> dfa_definition
64 (* Computes the DFA or raises Not_found if it does not exist *)
66 (* ======================================================================
70 * Revision 1.1 2000/11/17 09:57:29 lpadovan
73 * Revision 1.1 2000/07/23 02:16:08 gerd