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