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