| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
# RDF::Query::Parser |
|
2
|
|
|
|
|
|
|
# ----------------------------------------------------------------------------- |
|
3
|
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
=head1 NAME |
|
5
|
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
RDF::Query::Parser - Parser base class |
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
=head1 VERSION |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
This document describes RDF::Query::Parser version 2.918. |
|
11
|
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=cut |
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
package RDF::Query::Parser; |
|
15
|
|
|
|
|
|
|
|
|
16
|
36
|
|
|
36
|
|
169
|
use strict; |
|
|
36
|
|
|
|
|
45
|
|
|
|
36
|
|
|
|
|
825
|
|
|
17
|
36
|
|
|
36
|
|
116
|
use warnings; |
|
|
36
|
|
|
|
|
42
|
|
|
|
36
|
|
|
|
|
706
|
|
|
18
|
36
|
|
|
36
|
|
112
|
no warnings 'redefine'; |
|
|
36
|
|
|
|
|
41
|
|
|
|
36
|
|
|
|
|
773
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
36
|
|
|
36
|
|
120
|
use RDF::Query::Node::Resource; |
|
|
36
|
|
|
|
|
41
|
|
|
|
36
|
|
|
|
|
1674
|
|
|
21
|
36
|
|
|
36
|
|
149
|
use RDF::Query::Node::Literal; |
|
|
36
|
|
|
|
|
67
|
|
|
|
36
|
|
|
|
|
1068
|
|
|
22
|
36
|
|
|
36
|
|
132
|
use RDF::Query::Node::Blank; |
|
|
36
|
|
|
|
|
46
|
|
|
|
36
|
|
|
|
|
1041
|
|
|
23
|
36
|
|
|
36
|
|
12272
|
use RDF::Query::Node::Variable; |
|
|
36
|
|
|
|
|
64
|
|
|
|
36
|
|
|
|
|
1774
|
|
|
24
|
36
|
|
|
36
|
|
913
|
use RDF::Query::Algebra; |
|
|
36
|
|
|
|
|
50
|
|
|
|
36
|
|
|
|
|
1070
|
|
|
25
|
36
|
|
|
36
|
|
127
|
use RDF::Query::Error qw(:try); |
|
|
36
|
|
|
|
|
45
|
|
|
|
36
|
|
|
|
|
194
|
|
|
26
|
|
|
|
|
|
|
|
|
27
|
36
|
|
|
36
|
|
4598
|
use Data::Dumper; |
|
|
36
|
|
|
|
|
48
|
|
|
|
36
|
|
|
|
|
1239
|
|
|
28
|
36
|
|
|
36
|
|
125
|
use Scalar::Util qw(blessed); |
|
|
36
|
|
|
|
|
50
|
|
|
|
36
|
|
|
|
|
1127
|
|
|
29
|
36
|
|
|
36
|
|
141
|
use Carp qw(carp croak confess); |
|
|
36
|
|
|
|
|
43
|
|
|
|
36
|
|
|
|
|
1776
|
|
|
30
|
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
###################################################################### |
|
32
|
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
our ($VERSION); |
|
34
|
|
|
|
|
|
|
BEGIN { |
|
35
|
36
|
|
|
36
|
|
15387
|
$VERSION = '2.918'; |
|
36
|
|
|
|
|
|
|
} |
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
###################################################################### |
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 METHODS |
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=over 4 |
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=item C<new_literal ( $literal, $language, $datatype )> |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Returns a new literal structure. |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=cut |
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub new_literal { |
|
53
|
10
|
|
|
10
|
1
|
8277
|
my $self = shift; |
|
54
|
10
|
|
|
|
|
18
|
my $literal = shift; |
|
55
|
10
|
|
|
|
|
16
|
my $lang = shift; |
|
56
|
10
|
|
|
|
|
13
|
my $dt = shift; |
|
57
|
10
|
|
|
|
|
109
|
return RDF::Query::Node::Literal->new( $literal, $lang, $dt ); |
|
58
|
|
|
|
|
|
|
} |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=item C<new_variable ( $name )> |
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Returns a new variable structure. |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub new_variable { |
|
67
|
103
|
|
|
103
|
1
|
34745
|
my $self = shift; |
|
68
|
103
|
|
|
|
|
113
|
my $name; |
|
69
|
103
|
50
|
|
|
|
186
|
if (@_) { |
|
70
|
103
|
|
|
|
|
113
|
$name = shift; |
|
71
|
|
|
|
|
|
|
} else { |
|
72
|
0
|
|
|
|
|
0
|
my $count = $self->{__PRIVATE_VARIABLE_COUNT}++; |
|
73
|
0
|
|
|
|
|
0
|
$name = '_____rdfquery_private_' . $count; |
|
74
|
|
|
|
|
|
|
} |
|
75
|
103
|
|
|
|
|
302
|
return RDF::Query::Node::Variable->new( $name ); |
|
76
|
|
|
|
|
|
|
} |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
=item C<new_blank ( $name )> |
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
Returns a new blank node structure. |
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
=cut |
|
83
|
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
sub new_blank { |
|
85
|
36
|
|
|
36
|
1
|
59
|
my $self = shift; |
|
86
|
36
|
|
|
|
|
42
|
my $id; |
|
87
|
36
|
100
|
|
|
|
84
|
if (@_) { |
|
88
|
7
|
|
|
|
|
10
|
$id = shift; |
|
89
|
|
|
|
|
|
|
} else { |
|
90
|
29
|
50
|
|
|
|
72
|
if (not defined($self->{blank_ids})) { |
|
91
|
0
|
|
|
|
|
0
|
$self->{blank_ids} = 1; |
|
92
|
|
|
|
|
|
|
} |
|
93
|
29
|
|
|
|
|
62
|
$id = 'a' . $self->{blank_ids}++; |
|
94
|
|
|
|
|
|
|
} |
|
95
|
36
|
|
|
|
|
189
|
return RDF::Query::Node::Blank->new( $id ); |
|
96
|
|
|
|
|
|
|
} |
|
97
|
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item C<new_uri ( $uri )> |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
Returns a new variable structure. |
|
101
|
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=cut |
|
103
|
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
sub new_uri { |
|
105
|
8
|
|
|
8
|
1
|
9754
|
my $self = shift; |
|
106
|
8
|
|
|
|
|
11
|
my $uri = shift; |
|
107
|
8
|
|
|
|
|
56
|
return RDF::Query::Node::Resource->new( $uri ); |
|
108
|
|
|
|
|
|
|
} |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# =item C<new_qname ( $prefix, $localPart )> |
|
111
|
|
|
|
|
|
|
# |
|
112
|
|
|
|
|
|
|
# Returns a new QName URI structure. |
|
113
|
|
|
|
|
|
|
# |
|
114
|
|
|
|
|
|
|
# =cut |
|
115
|
|
|
|
|
|
|
# |
|
116
|
|
|
|
|
|
|
# sub new_qname { |
|
117
|
|
|
|
|
|
|
# my $self = shift; |
|
118
|
|
|
|
|
|
|
# my $prefix = shift; |
|
119
|
|
|
|
|
|
|
# my $name = shift; |
|
120
|
|
|
|
|
|
|
# return [ 'URI', [ $prefix, $name ] ]; |
|
121
|
|
|
|
|
|
|
# } |
|
122
|
|
|
|
|
|
|
# |
|
123
|
|
|
|
|
|
|
# =item C<new_union ( @patterns )> |
|
124
|
|
|
|
|
|
|
# |
|
125
|
|
|
|
|
|
|
# Returns a new UNION structure. |
|
126
|
|
|
|
|
|
|
# |
|
127
|
|
|
|
|
|
|
# =cut |
|
128
|
|
|
|
|
|
|
# |
|
129
|
|
|
|
|
|
|
# sub new_union { |
|
130
|
|
|
|
|
|
|
# my $self = shift; |
|
131
|
|
|
|
|
|
|
# my @patterns = @_; |
|
132
|
|
|
|
|
|
|
# return RDF::Query::Algebra::Union->new( @patterns ); |
|
133
|
|
|
|
|
|
|
# } |
|
134
|
|
|
|
|
|
|
# |
|
135
|
|
|
|
|
|
|
# =item C<new_optional ( $patterns )> |
|
136
|
|
|
|
|
|
|
# |
|
137
|
|
|
|
|
|
|
# Returns a new OPTIONAL structure. |
|
138
|
|
|
|
|
|
|
# |
|
139
|
|
|
|
|
|
|
# =cut |
|
140
|
|
|
|
|
|
|
# |
|
141
|
|
|
|
|
|
|
# sub new_optional { |
|
142
|
|
|
|
|
|
|
# my $self = shift; |
|
143
|
|
|
|
|
|
|
# my $ggp = shift; |
|
144
|
|
|
|
|
|
|
# my $opt = shift; |
|
145
|
|
|
|
|
|
|
# return RDF::Query::Algebra::Optional->new( $ggp, $opt ); |
|
146
|
|
|
|
|
|
|
# } |
|
147
|
|
|
|
|
|
|
# |
|
148
|
|
|
|
|
|
|
# =item C<new_named_graph ( $graph, $triples )> |
|
149
|
|
|
|
|
|
|
# |
|
150
|
|
|
|
|
|
|
# Returns a new NAMED GRAPH structure. |
|
151
|
|
|
|
|
|
|
# |
|
152
|
|
|
|
|
|
|
# =cut |
|
153
|
|
|
|
|
|
|
# |
|
154
|
|
|
|
|
|
|
# sub new_named_graph { |
|
155
|
|
|
|
|
|
|
# my $self = shift; |
|
156
|
|
|
|
|
|
|
# my $graph = shift; |
|
157
|
|
|
|
|
|
|
# my $triples = shift; |
|
158
|
|
|
|
|
|
|
# return RDF::Query::Algebra::NamedGraph->new( $graph, $triples ); |
|
159
|
|
|
|
|
|
|
# } |
|
160
|
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
=item C<new_triple ( $s, $p, $o )> |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
Returns a new triple structure. |
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=cut |
|
166
|
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
sub new_triple { |
|
168
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
169
|
0
|
|
|
|
|
0
|
my ($s,$p,$o) = @_; |
|
170
|
0
|
|
|
|
|
0
|
return RDF::Query::Algebra::Triple->new( $s, $p, $o ); |
|
171
|
|
|
|
|
|
|
} |
|
172
|
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
=item C<new_unary_expression ( $operator, $operand )> |
|
174
|
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
Returns a new unary expression structure. |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
=cut |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
sub new_unary_expression { |
|
180
|
4
|
|
|
4
|
1
|
7
|
my $self = shift; |
|
181
|
4
|
|
|
|
|
10
|
my $op = shift; |
|
182
|
4
|
|
|
|
|
7
|
my $operand = shift; |
|
183
|
4
|
|
|
|
|
36
|
return RDF::Query::Expression::Unary->new( $op, $operand ); |
|
184
|
|
|
|
|
|
|
} |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=item C<new_binary_expression ( $operator, @operands )> |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
Returns a new binary expression structure. |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=cut |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
sub new_binary_expression { |
|
193
|
30
|
|
|
30
|
1
|
48
|
my $self = shift; |
|
194
|
30
|
|
|
|
|
55
|
my $op = shift; |
|
195
|
30
|
|
|
|
|
84
|
my @operands = @_[0,1]; |
|
196
|
30
|
|
|
|
|
236
|
return RDF::Query::Expression::Binary->new( $op, @operands ); |
|
197
|
|
|
|
|
|
|
} |
|
198
|
|
|
|
|
|
|
|
|
199
|
|
|
|
|
|
|
# =item C<new_nary_expression ( $operator, @operands )> |
|
200
|
|
|
|
|
|
|
# |
|
201
|
|
|
|
|
|
|
# Returns a new n-ary expression structure. |
|
202
|
|
|
|
|
|
|
# |
|
203
|
|
|
|
|
|
|
# =cut |
|
204
|
|
|
|
|
|
|
# |
|
205
|
|
|
|
|
|
|
# sub new_nary_expression { |
|
206
|
|
|
|
|
|
|
# my $self = shift; |
|
207
|
|
|
|
|
|
|
# my $op = shift; |
|
208
|
|
|
|
|
|
|
# my @operands = @_; |
|
209
|
|
|
|
|
|
|
# return RDF::Query::Expression::Binary->new( $op, @operands ); |
|
210
|
|
|
|
|
|
|
# } |
|
211
|
|
|
|
|
|
|
# |
|
212
|
|
|
|
|
|
|
# =item C<new_logical_expression ( $operator, @operands )> |
|
213
|
|
|
|
|
|
|
# |
|
214
|
|
|
|
|
|
|
# Returns a new logical expression structure. |
|
215
|
|
|
|
|
|
|
# |
|
216
|
|
|
|
|
|
|
# =cut |
|
217
|
|
|
|
|
|
|
# |
|
218
|
|
|
|
|
|
|
# sub new_logical_expression { |
|
219
|
|
|
|
|
|
|
# my $self = shift; |
|
220
|
|
|
|
|
|
|
# my $op = shift; |
|
221
|
|
|
|
|
|
|
# my @operands = @_; |
|
222
|
|
|
|
|
|
|
# die $op; |
|
223
|
|
|
|
|
|
|
# return RDF::Query::Expression->new( $op, @operands ); |
|
224
|
|
|
|
|
|
|
# } |
|
225
|
|
|
|
|
|
|
|
|
226
|
|
|
|
|
|
|
=item C<new_function_expression ( $function, @operands )> |
|
227
|
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
Returns a new function expression structure. |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=cut |
|
231
|
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
sub new_function_expression { |
|
233
|
67
|
|
|
67
|
1
|
108
|
my $self = shift; |
|
234
|
67
|
|
|
|
|
92
|
my $function = shift; |
|
235
|
67
|
|
|
|
|
122
|
my @operands = @_; |
|
236
|
67
|
100
|
|
|
|
270
|
unless (blessed($function)) { |
|
237
|
7
|
|
|
|
|
36
|
$function = RDF::Query::Node::Resource->new( $function ); |
|
238
|
|
|
|
|
|
|
} |
|
239
|
67
|
|
|
|
|
514
|
return RDF::Query::Expression::Function->new( $function, @operands ); |
|
240
|
|
|
|
|
|
|
} |
|
241
|
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
=item C<new_alias_expression ( $alias, $expression )> |
|
243
|
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
Returns a new alias expression structure. |
|
245
|
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
=cut |
|
247
|
|
|
|
|
|
|
|
|
248
|
|
|
|
|
|
|
sub new_alias_expression { |
|
249
|
29
|
|
|
29
|
1
|
40
|
my $self = shift; |
|
250
|
29
|
|
|
|
|
44
|
my $var = shift; |
|
251
|
29
|
|
|
|
|
41
|
my $expr = shift; |
|
252
|
29
|
|
|
|
|
197
|
return RDF::Query::Expression::Alias->new( 'alias', $var, $expr ); |
|
253
|
|
|
|
|
|
|
} |
|
254
|
|
|
|
|
|
|
|
|
255
|
|
|
|
|
|
|
=item C<new_filter ( $filter_expr, $pattern )> |
|
256
|
|
|
|
|
|
|
|
|
257
|
|
|
|
|
|
|
Returns a new filter structure. |
|
258
|
|
|
|
|
|
|
|
|
259
|
|
|
|
|
|
|
=cut |
|
260
|
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
sub new_filter { |
|
262
|
0
|
|
|
0
|
1
|
0
|
my $self = shift; |
|
263
|
0
|
|
|
|
|
0
|
my $expr = shift; |
|
264
|
0
|
|
|
|
|
0
|
my $pattern = shift; |
|
265
|
0
|
|
|
|
|
0
|
return RDF::Query::Algebra::Filter->new( $expr, $pattern ); |
|
266
|
|
|
|
|
|
|
} |
|
267
|
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
|
|
269
|
|
|
|
|
|
|
###################################################################### |
|
270
|
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
=item C<fail ( $error )> |
|
272
|
|
|
|
|
|
|
|
|
273
|
|
|
|
|
|
|
Sets the current error to C<$error>. |
|
274
|
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
If the parser is in commit mode (by calling C<set_commit>), throws a |
|
276
|
|
|
|
|
|
|
RDF::Query::Error::ParseError object. Otherwise returns C<undef>. |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
=cut |
|
279
|
|
|
|
|
|
|
|
|
280
|
|
|
|
|
|
|
sub fail { |
|
281
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
|
282
|
1
|
|
|
|
|
2
|
my $error = shift; |
|
283
|
1
|
|
|
|
|
5
|
my $l = Log::Log4perl->get_logger("rdf.query.parser"); |
|
284
|
|
|
|
|
|
|
|
|
285
|
36
|
|
|
36
|
|
183
|
no warnings 'uninitialized'; |
|
|
36
|
|
|
|
|
44
|
|
|
|
36
|
|
|
|
|
8734
|
|
|
286
|
1
|
|
|
|
|
264
|
my $parsed = substr($self->{input}, 0, $self->{position}); |
|
287
|
1
|
|
|
|
|
3
|
my $line = ($parsed =~ tr/\n//) + 1; |
|
288
|
1
|
|
|
|
|
5
|
my ($lline) = $parsed =~ m/^(.*)\Z/mx; |
|
289
|
1
|
|
|
|
|
2
|
my $col = length($lline); |
|
290
|
1
|
|
|
|
|
2
|
my $rest = substr($self->{remaining}, 0, 10); |
|
291
|
|
|
|
|
|
|
|
|
292
|
1
|
|
|
|
|
10
|
$self->set_error( "Syntax error; $error at $line:$col (near '$rest')" ); |
|
293
|
1
|
50
|
|
|
|
3
|
if ($self->{commit}) { |
|
294
|
0
|
|
|
|
|
0
|
throw RDF::Query::Error::ParseError( -text => "$error at $line:$col (near '$rest')" ); |
|
295
|
|
|
|
|
|
|
} else { |
|
296
|
1
|
|
|
|
|
4
|
return undef; |
|
297
|
|
|
|
|
|
|
} |
|
298
|
|
|
|
|
|
|
} |
|
299
|
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
###################################################################### |
|
301
|
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=item C<error ()> |
|
303
|
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
Returns the last error the parser experienced. |
|
305
|
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=cut |
|
307
|
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
sub error { |
|
309
|
2
|
|
|
2
|
1
|
2
|
my $self = shift; |
|
310
|
2
|
50
|
|
|
|
5
|
if (defined $self->{error}) { |
|
311
|
2
|
|
|
|
|
8
|
return $self->{error}; |
|
312
|
|
|
|
|
|
|
} else { |
|
313
|
0
|
|
|
|
|
0
|
return ''; |
|
314
|
|
|
|
|
|
|
} |
|
315
|
|
|
|
|
|
|
} |
|
316
|
|
|
|
|
|
|
|
|
317
|
|
|
|
|
|
|
=begin private |
|
318
|
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
=item C<set_error ( $error )> |
|
320
|
|
|
|
|
|
|
|
|
321
|
|
|
|
|
|
|
Sets the object's error variable. |
|
322
|
|
|
|
|
|
|
|
|
323
|
|
|
|
|
|
|
=end private |
|
324
|
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
=cut |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
sub set_error { |
|
328
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
|
329
|
1
|
|
|
|
|
2
|
my $error = shift; |
|
330
|
1
|
|
|
|
|
3
|
$self->{error} = $error; |
|
331
|
|
|
|
|
|
|
} |
|
332
|
|
|
|
|
|
|
|
|
333
|
|
|
|
|
|
|
=begin private |
|
334
|
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
=item C<clear_error ()> |
|
336
|
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
Clears the object's error variable. |
|
338
|
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
=end private |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
=cut |
|
342
|
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
sub clear_error { |
|
344
|
0
|
|
|
0
|
1
|
|
my $self = shift; |
|
345
|
0
|
|
|
|
|
|
$self->{error} = undef; |
|
346
|
|
|
|
|
|
|
} |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
# =begin private |
|
349
|
|
|
|
|
|
|
# |
|
350
|
|
|
|
|
|
|
# =item C<set_commit ( [ $value ] )> |
|
351
|
|
|
|
|
|
|
# |
|
352
|
|
|
|
|
|
|
# Sets the object's commit state. |
|
353
|
|
|
|
|
|
|
# |
|
354
|
|
|
|
|
|
|
# =end private |
|
355
|
|
|
|
|
|
|
# |
|
356
|
|
|
|
|
|
|
# =cut |
|
357
|
|
|
|
|
|
|
# |
|
358
|
|
|
|
|
|
|
# sub set_commit { |
|
359
|
|
|
|
|
|
|
# my $self = shift; |
|
360
|
|
|
|
|
|
|
# if (@_) { |
|
361
|
|
|
|
|
|
|
# $self->{commit} = shift; |
|
362
|
|
|
|
|
|
|
# } else { |
|
363
|
|
|
|
|
|
|
# $self->{commit} = 1; |
|
364
|
|
|
|
|
|
|
# } |
|
365
|
|
|
|
|
|
|
# } |
|
366
|
|
|
|
|
|
|
# |
|
367
|
|
|
|
|
|
|
# =begin private |
|
368
|
|
|
|
|
|
|
# |
|
369
|
|
|
|
|
|
|
# =item C<unset_commit ()> |
|
370
|
|
|
|
|
|
|
# |
|
371
|
|
|
|
|
|
|
# Clears the object's commit state. |
|
372
|
|
|
|
|
|
|
# |
|
373
|
|
|
|
|
|
|
# =end private |
|
374
|
|
|
|
|
|
|
# |
|
375
|
|
|
|
|
|
|
# =cut |
|
376
|
|
|
|
|
|
|
# |
|
377
|
|
|
|
|
|
|
# sub unset_commit { |
|
378
|
|
|
|
|
|
|
# my $self = shift; |
|
379
|
|
|
|
|
|
|
# $self->{commit} = 0; |
|
380
|
|
|
|
|
|
|
# } |
|
381
|
|
|
|
|
|
|
# |
|
382
|
|
|
|
|
|
|
# =begin private |
|
383
|
|
|
|
|
|
|
# |
|
384
|
|
|
|
|
|
|
# =item C<get_commit ()> |
|
385
|
|
|
|
|
|
|
# |
|
386
|
|
|
|
|
|
|
# Returns the object's commit state. |
|
387
|
|
|
|
|
|
|
# |
|
388
|
|
|
|
|
|
|
# =end private |
|
389
|
|
|
|
|
|
|
# |
|
390
|
|
|
|
|
|
|
# =cut |
|
391
|
|
|
|
|
|
|
# |
|
392
|
|
|
|
|
|
|
# sub get_commit { |
|
393
|
|
|
|
|
|
|
# my $self = shift; |
|
394
|
|
|
|
|
|
|
# return $self->{commit}; |
|
395
|
|
|
|
|
|
|
# } |
|
396
|
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
1; |
|
398
|
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
__END__ |
|
400
|
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
=back |
|
402
|
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=head1 AUTHOR |
|
404
|
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
Gregory Williams <gwilliams@cpan.org> |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=cut |