line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Tree::Binary::VisitorFactory; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
2715
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
43
|
|
5
|
2
|
|
|
2
|
|
6
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
239
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '1.08'; |
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
|
3230
|
my ($class, $visitor) = @_; |
16
|
186
|
100
|
|
|
|
314
|
(defined($visitor)) || die "Insufficient Arguments : You must specify a Visitor to load"; |
17
|
185
|
|
|
|
|
293
|
$visitor = "Tree::Binary::Visitor::$visitor"; |
18
|
185
|
|
|
|
|
10266
|
eval "require $visitor"; |
19
|
185
|
100
|
|
|
|
497
|
die "Illegal Operation : Could not load Visitor ($visitor) because $@" if $@; |
20
|
184
|
|
|
|
|
567
|
return $visitor->new(); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
*getVisitor = \&get; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
__END__ |