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