line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Tree::Binary::VisitorFactory; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
2601
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
49
|
|
5
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
311
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.07'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1
|
|
|
1
|
1
|
2
|
my ($class) = @_; |
11
|
1
|
|
|
|
|
3
|
return bless \$class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub get { |
15
|
186
|
|
|
186
|
1
|
2923
|
my ($class, $visitor) = @_; |
16
|
186
|
100
|
|
|
|
295
|
(defined($visitor)) || die "Insufficient Arguments : You must specify a Visitor to load"; |
17
|
185
|
|
|
|
|
313
|
$visitor = "Tree::Binary::Visitor::$visitor"; |
18
|
185
|
|
|
|
|
9910
|
eval "require $visitor"; |
19
|
185
|
100
|
|
|
|
497
|
die "Illegal Operation : Could not load Visitor ($visitor) because $@" if $@; |
20
|
184
|
|
|
|
|
592
|
return $visitor->new(); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
*getVisitor = \&get; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |