line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Lingua::YaTeA::InternalNode; |
2
|
5
|
|
|
5
|
|
37
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
147
|
|
3
|
5
|
|
|
5
|
|
27
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
128
|
|
4
|
5
|
|
|
5
|
|
3064
|
use Lingua::YaTeA::Node; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
73
|
|
5
|
5
|
|
|
5
|
|
203
|
use Lingua::YaTeA::Edge; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
33
|
|
6
|
5
|
|
|
5
|
|
113
|
use UNIVERSAL; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
17
|
|
7
|
5
|
|
|
5
|
|
133
|
use Scalar::Util qw(blessed); |
|
5
|
|
|
|
|
14
|
|
|
5
|
|
|
|
|
2135
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(Lingua::YaTeA::Node Lingua::YaTeA::Edge); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION=$Lingua::YaTeA::VERSION; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new |
14
|
|
|
|
|
|
|
{ |
15
|
83
|
|
|
83
|
1
|
175
|
my ($class,$level) = @_; |
16
|
83
|
|
|
|
|
276
|
my $this = $class->SUPER::new($level); |
17
|
83
|
|
|
|
|
206
|
$this->{FATHER} = (); |
18
|
83
|
|
|
|
|
160
|
bless ($this,$class); |
19
|
83
|
|
|
|
|
180
|
return $this; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub setFather |
23
|
|
|
|
|
|
|
{ |
24
|
64
|
|
|
64
|
1
|
151
|
my ($this,$father) = @_; |
25
|
64
|
|
|
|
|
175
|
$this->{FATHER} = $father; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub getFather |
29
|
|
|
|
|
|
|
{ |
30
|
42
|
|
|
42
|
1
|
71
|
my ($this) = @_; |
31
|
42
|
|
|
|
|
183
|
return $this->{FATHER}; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub updateLevel |
35
|
|
|
|
|
|
|
{ |
36
|
111
|
|
|
111
|
1
|
223
|
my ($this,$new_level) = @_; |
37
|
111
|
|
|
|
|
203
|
$this->{LEVEL} = $new_level++; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
# warn "Debug: Level in updateLevel: $new_level \n"; |
40
|
|
|
|
|
|
|
|
41
|
111
|
50
|
|
|
|
222
|
if ($new_level < 50) { # Temporary added by Thierry Hamon 02/02/2007 |
42
|
111
|
100
|
66
|
|
|
252
|
if ((blessed($this->getLeftEdge)) && ($this->getLeftEdge->isa('Lingua::YaTeA::InternalNode'))) |
43
|
|
|
|
|
|
|
{ |
44
|
10
|
|
|
|
|
30
|
$this->getLeftEdge->updateLevel($new_level); |
45
|
|
|
|
|
|
|
} |
46
|
111
|
100
|
66
|
|
|
295
|
if ((blessed($this->getRightEdge)) && ($this->getRightEdge->isa('Lingua::YaTeA::InternalNode'))) |
47
|
|
|
|
|
|
|
{ |
48
|
37
|
|
|
|
|
125
|
$this->getRightEdge->updateLevel($new_level); |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
} else { |
51
|
0
|
|
|
|
|
0
|
warn "updateLevel: Going out a deep recursive method call (more than 50 calls)\n"; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
} |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub searchRoot |
56
|
|
|
|
|
|
|
{ |
57
|
14
|
|
|
14
|
1
|
31
|
my ($this) = @_; |
58
|
14
|
100
|
66
|
|
|
46
|
if ((blessed($this->getFather)) && ($this->getFather->isa('Lingua::YaTeA::RootNode'))) |
59
|
|
|
|
|
|
|
{ |
60
|
10
|
|
|
|
|
29
|
return $this->getFather; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
4
|
|
|
|
|
16
|
return $this->getFather->searchRoot; |
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub printFather |
70
|
|
|
|
|
|
|
{ |
71
|
0
|
|
|
0
|
1
|
|
my ($this,$fh) = @_; |
72
|
0
|
|
|
|
|
|
print $fh "\t\tfather: " . $this->getFather->getID . "\n"; |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |