line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CQL::ProxNode; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
1423
|
use strict; |
|
8
|
|
|
|
|
18
|
|
|
8
|
|
|
|
|
289
|
|
4
|
8
|
|
|
8
|
|
42
|
use warnings; |
|
8
|
|
|
|
|
13
|
|
|
8
|
|
|
|
|
234
|
|
5
|
8
|
|
|
8
|
|
38
|
use base qw( CQL::BooleanNode ); |
|
8
|
|
|
|
|
21
|
|
|
8
|
|
|
|
|
749
|
|
6
|
8
|
|
|
8
|
|
5885
|
use CQL::ProxModifierSet; |
|
8
|
|
|
|
|
22
|
|
|
8
|
|
|
|
|
1957
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 NAME |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
CQL::ProxNode - represents a PROX node in a CQL parse tree |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 SYNOPSIS |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
use CQL::ProxNode; |
15
|
|
|
|
|
|
|
my $node = CQL::ProxNode->new( left => $left ); |
16
|
|
|
|
|
|
|
$node->addSecondTerm( $right ); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 DESCRIPTION |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 METHODS |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 new() |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Creates a new, incomplete, proximity node with the |
25
|
|
|
|
|
|
|
specified left-hand side. No right-hand side is specified at |
26
|
|
|
|
|
|
|
this stage: that must be specified later, using the |
27
|
|
|
|
|
|
|
addSecondSubterm() method. (That may seem odd, but |
28
|
|
|
|
|
|
|
it's just easier to write the parser that way.) |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
Proximity paramaters may be added at any time, |
31
|
|
|
|
|
|
|
before or after the right-hand-side sub-tree is added. |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
my $prox = CQL::ProxNode->new( $term ); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=cut |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub new { |
38
|
12
|
|
|
12
|
1
|
24
|
my ($class,$left) = @_; |
39
|
12
|
|
|
|
|
83
|
my $self = $class->SUPER::new( left => $left, right => undef ); |
40
|
12
|
|
|
|
|
120
|
$self->{modifierSet} = CQL::ProxModifierSet->new( 'prox' ); |
41
|
12
|
|
|
|
|
35
|
return $self; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head2 addSecondTerm() |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=cut |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub addSecondTerm { |
49
|
8
|
|
|
8
|
1
|
23
|
my ($self,$term) = @_; |
50
|
8
|
|
|
|
|
21
|
$self->{right} = $term; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head2 addModifier() |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=cut |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub addModifier { |
58
|
21
|
|
|
21
|
1
|
194
|
my ($self,$type,$value) = @_; |
59
|
21
|
|
|
|
|
211
|
$self->{modifierSet}->addModifier( $type, $value ); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head2 getModifiers() |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub getModifiers { |
67
|
0
|
|
|
0
|
1
|
0
|
return shift->{modifierSet}->getModifiers(); |
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
=head2 op() |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=cut |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
sub op { |
75
|
10
|
|
|
10
|
1
|
45
|
return shift->{modifierSet}->toCQL(); |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=head2 opXCQL() |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
sub opXCQL { |
83
|
0
|
|
|
0
|
1
|
|
my ($self,$level) = @_; |
84
|
0
|
|
|
|
|
|
return $self->{modifierSet}->toXCQL( $level, 'boolean' ); |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
1; |