Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / lib / site_perl / 5.8.0 / Graph / DFS.pm
CommitLineData
86530b38
AT
1package Graph::DFS;
2
3use strict;
4local $^W = 1;
5
6use Graph::Traversal;
7
8use vars qw(@ISA);
9@ISA = qw(Graph::Traversal);
10
11=head1 NAME
12
13Graph::DFS - graph depth-first search
14
15=head1 SYNOPSIS
16
17B<see description>
18
19=head1 DESCRIPTION
20
21=over 4
22
23=cut
24
25=pod
26
27=item new
28
29 $dfs = Graph::DFS->new($G, %param)
30
31 Returns a new depth-first search object for the graph $G
32 and the (optional) parameters %param.
33
34=cut
35
36sub new {
37 my $class = shift;
38 my $graph = shift;
39
40 Graph::Traversal::new( $class,
41 $graph,
42 current =>
43 sub { $_[0]->{ active_list }->[ -1 ] },
44 finish =>
45 sub { pop @{ $_[0]->{ active_list } } },
46 @_);
47}
48
49=pod
50
51=back
52
53See also C<Graph::Traversal>.
54
55=head1 COPYRIGHT
56
57Copyright 1999, O'Reilly & Associates.
58
59This code is distributed under the same copyright terms as Perl itself.
60
61=cut
62
631;