line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################################################### |
2
|
|
|
|
|
|
|
### Trinket::Directory::FilterParser |
3
|
|
|
|
|
|
|
### |
4
|
|
|
|
|
|
|
### Foo |
5
|
|
|
|
|
|
|
### |
6
|
|
|
|
|
|
|
### $Id: FilterParser.pm,v 1.1.1.1 2001/02/15 18:47:50 deus_x Exp $ |
7
|
|
|
|
|
|
|
### |
8
|
|
|
|
|
|
|
### TODO: |
9
|
|
|
|
|
|
|
### |
10
|
|
|
|
|
|
|
########################################################################### |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
package Trinket::Directory::FilterParser; |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
93
|
|
15
|
2
|
|
|
2
|
|
11
|
use vars qw($VERSION @ISA @EXPORT $DESCRIPTION $AUTOLOAD); |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
186
|
|
16
|
2
|
|
|
2
|
|
13
|
no warnings qw( uninitialized ); |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
138
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# {{{ Begin POD |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Trinket::Directory::FilterParser - Base class for Trinket filter parsers |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 DESCRIPTION |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
TODO Need global description of FilterParsers, maybe how to write one. |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
=cut |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
# }}} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# {{{ METADATA |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
BEGIN |
35
|
|
|
|
|
|
|
{ |
36
|
2
|
|
|
2
|
|
5
|
$VERSION = "0.0"; |
37
|
2
|
|
|
|
|
36
|
@ISA = qw( Exporter ); |
38
|
2
|
|
|
|
|
76
|
$DESCRIPTION = 'Base FilterParser class'; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# }}} |
42
|
|
|
|
|
|
|
|
43
|
2
|
|
|
2
|
|
9
|
use Carp qw( cluck croak ); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
159
|
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# {{{ EXPORTS |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 EXPORTS |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
TODO |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
# }}} |
54
|
|
|
|
|
|
|
|
55
|
2
|
|
|
2
|
|
9
|
use constant SEARCH_OP => 0; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
124
|
|
56
|
2
|
|
|
2
|
|
9
|
use constant SEARCH_OPERAND => 1; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
527
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
@EXPORT = qw( &SEARCH_OP &SEARCH_OPERAND ); |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
# {{{ METHODS |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 METHODS |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=over 4 |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=cut |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
# }}} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
# {{{ new(): Object constructor |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item $parser = new Trinket::Directory::FilterParser(); |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Object constructor, accepts a hashref of named properties with which to |
75
|
|
|
|
|
|
|
initialize the object. In initialization, the object's set methods |
76
|
|
|
|
|
|
|
are called for each of initializing properties passed. ' |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=cut |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
sub new |
81
|
|
|
|
|
|
|
{ |
82
|
7
|
|
|
7
|
1
|
35
|
my $class = shift; |
83
|
|
|
|
|
|
|
|
84
|
7
|
|
|
|
|
18
|
my $self = {}; |
85
|
|
|
|
|
|
|
|
86
|
7
|
|
|
|
|
25
|
bless($self, $class); |
87
|
7
|
|
|
|
|
36
|
$self->init(@_); |
88
|
7
|
|
|
|
|
25
|
return $self; |
89
|
|
|
|
|
|
|
} |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
# }}} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# {{{ parse_filter: Parse a search filter into an LoL |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=item $parsed = $parser->parse_filter($filter); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
TODO |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
sub parse_filter |
102
|
|
|
|
|
|
|
{ |
103
|
0
|
|
|
0
|
1
|
|
my ($self, $filter) = @_; |
104
|
|
|
|
|
|
|
|
105
|
0
|
|
|
|
|
|
croak("Call to unimplmeparse_filter() unimplemented in ".ref($self)); |
106
|
|
|
|
|
|
|
} |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
# }}} |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# {{{ DESTROY |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
sub DESTROY |
113
|
0
|
|
|
0
|
|
|
{ |
114
|
|
|
|
|
|
|
## no-op to pacify warnings |
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
# }}} |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
# {{{ End POD |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=back |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head1 AUTHOR |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Maintained by Leslie Michael Orchard > |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head1 COPYRIGHT |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Copyright (c) 2000, Leslie Michael Orchard. All Rights Reserved. |
130
|
|
|
|
|
|
|
This module is free software; you can redistribute it and/or |
131
|
|
|
|
|
|
|
modify it under the same terms as Perl itself. |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=cut |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# }}} |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
1; |
138
|
|
|
|
|
|
|
__END__ |