line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package Tree::Visualize::ASCII::Layouts::Simple; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
1302
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
66
|
|
5
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
117
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
10
|
use base qw(Tree::Visualize::Layout::ILayout); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
656
|
|
10
|
|
|
|
|
|
|
|
11
|
2
|
|
|
2
|
|
11
|
use Tree::Visualize::Exceptions; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
56
|
|
12
|
2
|
|
|
2
|
|
615
|
use Tree::Visualize::ASCII::BoundingBox; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
63
|
|
13
|
2
|
|
|
2
|
|
1614
|
use Tree::Visualize::Node::Factory; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
489
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub checkTree { |
16
|
16
|
|
|
16
|
1
|
23
|
my ($self, $tree) = @_; |
17
|
16
|
50
|
33
|
|
|
122
|
(defined($tree) && ref($tree) && UNIVERSAL::isa($tree, "Tree::Simple")) |
|
|
|
33
|
|
|
|
|
18
|
|
|
|
|
|
|
|| throw Tree::Visualize::IncorrectObjectType "tree argument must be a Tree::Simple object"; |
19
|
16
|
|
|
|
|
42
|
return $tree; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub drawNode { |
23
|
16
|
|
|
16
|
1
|
19
|
my ($self, $tree) = @_; |
24
|
16
|
|
|
|
|
80
|
my $node = Tree::Visualize::Node::Factory->new()->get(output => 'ASCII', node_type => 'PlainBox', args => [ $tree ]); |
25
|
16
|
|
|
|
|
120
|
return Tree::Visualize::ASCII::BoundingBox->new($node->draw()); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub drawChildren { |
29
|
16
|
|
|
16
|
1
|
21
|
my ($self, $tree) = @_; |
30
|
16
|
100
|
|
|
|
147
|
return () if $tree->isLeaf(); |
31
|
|
|
|
|
|
|
|
32
|
7
|
|
|
|
|
55
|
my @children; |
33
|
7
|
|
|
|
|
19
|
foreach my $child ($tree->getAllChildren()) { |
34
|
14
|
|
|
|
|
73
|
push @children => $self->draw($child); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
7
|
|
|
|
|
27
|
return @children; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
1; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
__END__ |