The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CallGraph::Dumper - Dump a call graph into a string representation

SYNOPSIS

    my $dumper = CallGraph::Dumper->new(root => $root, 
        indent => 8, dups => 0);
    print $dumper->dump;

DESCRIPTION

This module dumps a call graph into a string representation. The output looks something like this:

    MAIN
            EXTSUB *
    1       SUB1
                    SUB11
                    SUB12
            SUB2
                    SUB1 (1)
                    SUB21

This means that MAIN calls EXTSUB, which is labeled with an asterisk because it is external (meaning it is not defined within the program that was parsed), SUB1, and SUB2. SUB1 calls SUB11 and SUB12. SUB2 calls SUB1; to avoid duplication, a link is made by labeling SUB1 with a 1. This is the default behavior, with 'dups' => 0. When dups => 1, the branch is duplicated:

    MAIN
            EXTSUB *
            SUB1
                    SUB11
                    SUB12
            SUB2
                    SUB1
                            SUB11
                            SUB12
                    SUB21

In case of recursion, the label system is used even with dups => 1, to avoid an endless loop.

METHODS

my $sub = CallGraph::Dumper->new(root => $root, option => value, ...)

Creates a new dumper. The root option must be given and it must be a CallGraph::Node object. The other options are the following:

indent

The number of spaces to indent each call level. The default is 8.

dups

If true, duplicate a branch that has already been called. If false, place a level pointing to the first place where the branch was defined. The default is false.

my $dump = $dumper->dump

Turn the call graph into a string representation.

VERSION

0.55

SEE ALSO

CallGraph, CallGraph::Node, CallGraph::Lang::Fortran

AUTHOR

Ivan Tubert <itub@cpan.org>

COPYRIGHT

Copyright (c) 2004 Ivan Tubert. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.