line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Graph::Reader::OID; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
94464
|
use base qw(Graph::Reader); |
|
4
|
|
|
|
|
37
|
|
|
4
|
|
|
|
|
2168
|
|
4
|
4
|
|
|
4
|
|
189475
|
use strict; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
81
|
|
5
|
4
|
|
|
4
|
|
25
|
use warnings; |
|
4
|
|
|
|
|
11
|
|
|
4
|
|
|
|
|
130
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
1987
|
use Readonly; |
|
4
|
|
|
|
|
12105
|
|
|
4
|
|
|
|
|
1258
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# Constants. |
10
|
|
|
|
|
|
|
Readonly::Scalar our $DOT => q{.}; |
11
|
|
|
|
|
|
|
Readonly::Scalar our $EMPTY_STR => q{}; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# Version. |
14
|
|
|
|
|
|
|
our $VERSION = 0.04; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Read graph subroutine. |
17
|
|
|
|
|
|
|
sub _read_graph { |
18
|
4
|
|
|
4
|
|
21190
|
my ($self, $graph, $fh) = @_; |
19
|
4
|
|
|
|
|
106
|
while (my $line = <$fh>) { |
20
|
8
|
|
|
|
|
20
|
chomp $line; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# End of vertexes section. |
23
|
8
|
100
|
|
|
|
38
|
if ($line =~ m/^#/ms) { |
24
|
1
|
|
|
|
|
5
|
next; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# Process OID. |
28
|
7
|
|
|
|
|
38
|
my ($line_oid, $line_label) = split m/\s+/ms, $line, 2; |
29
|
7
|
|
|
|
|
23
|
my @oid = split m/\./ms, $line_oid; |
30
|
7
|
|
|
|
|
12
|
my $last_oid; |
31
|
7
|
|
|
|
|
14
|
my $act_oid = $EMPTY_STR; |
32
|
7
|
|
|
|
|
14
|
foreach my $oid (@oid) { |
33
|
14
|
100
|
|
|
|
30
|
if ($act_oid ne $EMPTY_STR) { |
34
|
7
|
|
|
|
|
13
|
$act_oid .= $DOT; |
35
|
|
|
|
|
|
|
} |
36
|
14
|
|
|
|
|
21
|
$act_oid .= $oid; |
37
|
14
|
|
|
|
|
40
|
$graph->add_vertex($act_oid); |
38
|
14
|
100
|
|
|
|
525
|
if ($act_oid eq $line_oid) { |
39
|
7
|
100
|
|
|
|
16
|
if (! $line_label) { |
40
|
2
|
|
|
|
|
25
|
$line_label = $line_oid; |
41
|
|
|
|
|
|
|
} |
42
|
7
|
|
|
|
|
20
|
$graph->set_vertex_attribute($act_oid, 'label', |
43
|
|
|
|
|
|
|
$line_label); |
44
|
|
|
|
|
|
|
} |
45
|
14
|
100
|
|
|
|
550
|
if (defined $last_oid) { |
46
|
7
|
|
|
|
|
21
|
$graph->add_edge($last_oid, $act_oid); |
47
|
|
|
|
|
|
|
} |
48
|
14
|
|
|
|
|
777
|
$last_oid = $act_oid; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} |
51
|
4
|
|
|
|
|
16
|
return; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
1; |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
__END__ |