« blib/lib/PMLTQ/Relation/FSFileIterator.pm
↑ Summary
blib/lib/PMLTQ/Relation/Treex/AEParentCIterator.pm »
| 1 | package PMLTQ::Relation::SiblingIterator; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 12 | our $AUTHORITY = 'cpan:MATY'; | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | 12 | $PMLTQ::Relation::SiblingIterator::VERSION = '1.2.2'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: Iterates over siblings given node | ||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 12 | ▶ | use 5.006; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 12 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 12 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 12 | ▶ | use base qw(PMLTQ::Relation::Iterator); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 12 | ▶ | use constant CONDITIONS=>0; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 12 | ▶ | use constant NODE=>1; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 12 | ▶ | use constant FILE=>2; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 12 | ▶ | use constant START=>3; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | sub start { | ||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 0 | ▶ | my ($self,$start_node,$fsfile)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: not called CC=7 SCAR=40.3
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 0 | $self->[FILE]=$fsfile; | |||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | $self->[START]=$start_node; | |||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | my $n = $start_node->parent; | |||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | ▶ | $n=$n && $n->firstson; | ||||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$n && $n->firstson
MC/DC0%0/2
$n && $n->firstson
$n
$n->firstson
Truth table0%0/3
A && B
A= $nB= $n->firstson
| |||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | ▶ | $n=$n->rbrother if $n && $n==$start_node; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$n and $n == $start_node
MC/DC0%0/2
$n and $n == $start_node
$n
$n == $start_node
Truth table0%0/3
A and B
A= $nB= $n == $start_node
| |||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | $self->[NODE]=$n; | |||||||||||||||||||||||||||||||||||||||||||||
| 24 | 0 | ▶ | return ($n && $self->[CONDITIONS]->($n,$fsfile)) ? $n : ($n && $self->next); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$n and $self->[0]->($n, $fsfile)
$n and $self->next
MC/DC0%0/2
$n and $self->[0]->($n, $fsfile)
$n
$self->[0]->($n, $fsfile)
MC/DC0%0/2
$n and $self->next
$n
$self->next
Truth table0%0/3
A and B
A= $nB= $self->[0]->($n, $fsfile)
Truth table0%0/3
A and B
A= $nB= $self->next
| |||||||||||||||||||||||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 26 | sub next { | ||||||||||||||||||||||||||||||||||||||||||||||
| 27 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
next: not called CC=4 SCAR=30.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | 0 | my $conditions=$self->[CONDITIONS]; | |||||||||||||||||||||||||||||||||||||||||||||
| 29 | 0 | my $n=$self->[NODE]->rbrother; | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | 0 | my $start_node = $self->[START]; | |||||||||||||||||||||||||||||||||||||||||||||
| 31 | 0 | my $fsfile = $self->[FILE]; | |||||||||||||||||||||||||||||||||||||||||||||
| 32 | 0 | ▶ | $n=$n->rbrother while ($n and !($n!=$start_node and $conditions->($n,$fsfile))); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$n and not $n != $start_node && &$conditions($n, $fsfile)
$n != $start_node && &$conditions($n, $fsfile)
MC/DC0%0/3
$n and not $n != $start_node && &$conditions($n, $fsfile)
$n
$n != $start_node
&$conditions($n, $fsfile)
Truth table0%0/4
A and not(B && C)
A= $nB= $n != $start_nodeC= &$conditions($n, $fsfile)
| |||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 0 | return $_[0]->[NODE]=$n; | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 35 | sub node { | ||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | ▶ | return $_[0]->[NODE]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
node: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 38 | sub file { | ||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 0 | ▶ | return $_[0]->[FILE]; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
file: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 40 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 41 | sub reset { | ||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 0 | ▶ | my ($self)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
reset: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 0 | $self->[NODE]=undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | $self->[FILE]=undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 45 | 0 | $self->[START]=undef; | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||||
| 48 | 12 | 1; # End of PMLTQ::Relation::SiblingIterator | |||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||
| 50 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||