|
CallGraph::Node - represent a subroutine as a node in a call graph |
CallGraph::Node - represent a subroutine as a node in a call graph
my $sub1 = CallGraph::Node->new(name => 'main', type => 'internal');
my $sub2 = CallGraph::Node->new(name => 'mysub', type => 'external');
$sub1->add_call($sub2);
print $sub1->dump;
my @calls = $sub1->calls;
my @callers = $sub2->callers;
print $sub1->name; # prints 'main'
print $sub1->type; # prints 'internal'
This module creates a node within a ``call graph'' for a program. A node corresponds to a subroutine (or function, method, or whatever it's called), and it has the properties 'name' and 'type'. Subroutines are linked to one another by 'calls'.
add_call($sub2)
0.55
the CallGraph manpage, the CallGraph::Dumper manpage, the CallGraph::Lang::Fortran manpage
Ivan Tubert <itub@cpan.org>
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.
|
CallGraph::Node - represent a subroutine as a node in a call graph |