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