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