FDG v0.0.4 FDG.Importers.Digraph

Allows Erlang Digraphs (acyclic ones in particular) to be parsed and converted into other formats.

Summary

Types

Used to describe Erlang Digraphs

Used to pass along the digraph along with the atoms of one of its vertices

Functions

Retrieves a dag (Directed acyclic graph), finds its root, and builds an AST from it by iterating through its direct neighbours

Types

digraph_type :: {:digraph, integer, integer, integer, boolean}

Used to describe Erlang Digraphs

vertex_type :: {:vertex, digraph_type, atom}

Used to pass along the digraph along with the atoms of one of its vertices.

Functions

import(arg)

Specs

Retrieves a dag (Directed acyclic graph), finds its root, and builds an AST from it by iterating through its direct neighbours.

Examples:

iex> dag = :digraph.new([:acyclic])
iex> :digraph.add_vertex(dag, :a, [label: "A"])
iex> :digraph.add_vertex(dag, :b, [label: "B"])
iex> :digraph.add_vertex(dag, :c, [label: "C"])
iex> :digraph.add_edge(dag, :a, :b)
iex> :digraph.add_edge(dag, :a, :c)
iex> FDG.Importers.Digraph.import(dag)
[node: [label: "A",
  children: [
    node: [label: "C", children: []],
    node: [label: "B", children: []]
  ]
]]