NAME
Devel::Graph - Turn Perl code into a Graph::Flowchart object
SYNOPSIS
use Devel::Graph;
my $graph = Devel::Graph->graph( '$a = 9 if $b == 1' );
print $graph->as_ascii();
DESCRIPTION
This module decomposes Perl code into blocks and generates an Graph::Flowchart object out of these. The resulting object represents the code in a flowchart manner and it can return you a Graph::Easy object.
This in turn can be converted it into all output formats currently supported by Graph::Easy, namely HTML, SVG, ASCII text etc.
Note: The actual decomposing parts are not yet implemented. Currently there is only code to assemble the flowchart manually via methods.
EXPORT
Exports nothing.
METHODS
graph()
provides a simple function-style interface, while all other methods are for an object-oriented model.
graph()
my $graph = Devel::Graph->graph( $code );
Takes Perl code in $code (as string or code ref) and returns a flowchart as Graph::Easy
object.
This is a shortcut to avoid the OO interface described below and will be equivalent to:
my $grapher = Devel::Graph->new();
$grapher->decompose( $code );
my $graph = $grapher->as_graph();
Please see Graph::Easy
for further details on what to do with the returned object.
new()
my $grapher = Devel::Graph->new();
Creates a new Devel::Graph
object.
decompose()
$grapher->decompose( $code );
Takes Perl code in $code (as string or code ref) and decomposes it into blocks and updates the internal structures with a flowchart representing this code.
Note: Not yet implemented.
as_graph()
my $graph = $grapher->as_graph();
Return the internal data structure as Graph::Easy
object.
as_flowchart()
my $chart = $grapher->as_flowchart();
Return the internal data structure as Graph::Flowchart
object.
SEE ALSO
Graph::Easy, Graph::Flowchart.
COPYRIGHT AND LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms of the GPL version 2. See the LICENSE file for information.
AUTHOR
Copyright (C) 2004-2005 by Tels http://bloodgate.com