« blib/lib/PMLTQ/Relation/Treex/AEParentIterator.pm
↑ Summary
blib/lib/PMLTQ/Relation/DepthFirstFollowsIterator.pm »
| 1 | package PMLTQ::Relation::SameTreeIterator; | ||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 12 | our $AUTHORITY = 'cpan:MATY'; | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | 12 | $PMLTQ::Relation::SameTreeIterator::VERSION = '1.5.0'; | |||||||||||||||||||||||||||||||||||||||||||||
| 4 | # ABSTRACT: Evaluates condition on nodes of current tree | ||||||||||||||||||||||||||||||||||||||||||||||
| 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 Carp; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 12 | ▶ | use base qw(PMLTQ::Relation::TreeIterator); | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||||||||||||||||||||
| 13 | sub new { | ||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 0 | ▶ | my ($class,$conditions)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 0 | ▶ | croak "usage: $class->new(sub{...})" unless ref($conditions) eq 'CODE'; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 0 | return bless [$conditions],$class; | |||||||||||||||||||||||||||||||||||||||||||||
| 17 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 18 | sub start { | ||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 0 | ▶ | my ($self,$root,$fsfile)=@_; | ||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
start: not called CC=5 SCAR=34.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | ▶ | $root=$root->root if $root; | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 0 | $self->[PMLTQ::Relation::TreeIterator::NODE] = $self->[PMLTQ::Relation::TreeIterator::TREE] = $root; | |||||||||||||||||||||||||||||||||||||||||||||
| 22 | 0 | $self->[PMLTQ::Relation::TreeIterator::FILE]=$fsfile; | |||||||||||||||||||||||||||||||||||||||||||||
| 23 | 0 | ▶ | return ($root && $self->[PMLTQ::Relation::TreeIterator::CONDITIONS]->($root,$fsfile)) ? $root : ($root && $self->next); | ||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/6
$root and $self->[0]->($root, $fsfile)
$root and $self->next
MC/DC0%0/2
$root and $self->[0]->($root, $fsfile)
$root
$self->[0]->($root, $fsfile)
MC/DC0%0/2
$root and $self->next
$root
$self->next
Truth table0%0/3
A and B
A= $rootB= $self->[0]->($root, $fsfile)
Truth table0%0/3
A and B
A= $rootB= $self->next
| |||||||||||||||||||||||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 12 | 1; # End of PMLTQ::Relation::SameTreeIterator | |||||||||||||||||||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||||||||||||||||||||
| 28 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||