projects
/
perl-pqf.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
81780a1
)
Proofread documentation, fix bug in _error().
author
Mike Taylor
<mike@indexdata.com>
Fri, 17 Dec 2004 17:12:05 +0000
(17:12 +0000)
committer
Mike Taylor
<mike@indexdata.com>
Fri, 17 Dec 2004 17:12:05 +0000
(17:12 +0000)
lib/Net/Z3950/PQF.pm
patch
|
blob
|
history
diff --git
a/lib/Net/Z3950/PQF.pm
b/lib/Net/Z3950/PQF.pm
index
bbdbc9e
..
1251acf
100644
(file)
--- a/
lib/Net/Z3950/PQF.pm
+++ b/
lib/Net/Z3950/PQF.pm
@@
-1,4
+1,4
@@
-# $Id: PQF.pm,v 1.3 2004-12-17 16:58:09 mike Exp $
+# $Id: PQF.pm,v 1.4 2004-12-17 17:12:05 mike Exp $
package Net::Z3950::PQF;
package Net::Z3950::PQF;
@@
-28,9
+28,11
@@
This library provides a parser for PQF (Prefix Query Format), an ugly
but precise string format for expressing Z39.50 Type-1 queries. This
format is widely used behind the scenes of Z39.50 applications, and is
also used extensively with test-harness programs such as the YAZ
but precise string format for expressing Z39.50 Type-1 queries. This
format is widely used behind the scenes of Z39.50 applications, and is
also used extensively with test-harness programs such as the YAZ
-command-line client, C<yaz-client>.
+command-line client, C<yaz-client>. A few particularly misguided
+souls have been known to type it by hand.
-It is simple to use. Create a parser object, then pass PQF strings
+Unlike PQF itself, this module
+is simple to use. Create a parser object, then pass PQF strings
into its C<parse()> method to yield parse-trees. The trees are made
up of nodes whose types are subclasses of
C<Net::Z3950::PQF::Node>.
into its C<parse()> method to yield parse-trees. The trees are made
up of nodes whose types are subclasses of
C<Net::Z3950::PQF::Node>.
@@
-69,7
+71,7
@@
sub new {
$query = '@and @attr 1=1003 kernighan @attr 1=4 unix';
$node = $parser->parse($query);
$query = '@and @attr 1=1003 kernighan @attr 1=4 unix';
$node = $parser->parse($query);
- if (!defined $node)
+ if (!defined $node) {
die "parse($query) failed: " . $parser->errmsg();
}
die "parse($query) failed: " . $parser->errmsg();
}
@@
-81,11
+83,12
@@
of the parse tree is returned.
$node2 = $parser->parse($query, "zthes");
$node3 = $parser->parse($query, "1.2.840.10003.3.13");
$node2 = $parser->parse($query, "zthes");
$node3 = $parser->parse($query, "1.2.840.10003.3.13");
-A second argument may be provided, after the query itself. If it is
+A second argument may be provided after the query itself. If it is
provided, then it is taken to be either the name or the OID of a
default attribute set, which attributes specified in the query belong
provided, then it is taken to be either the name or the OID of a
default attribute set, which attributes specified in the query belong
-to if no alternative attribute set is explicitly specified. When this
-second argument is absent, the default attribute set is BIB-1.
+to if no alternative attribute set is explicitly specified within the
+query. When this second argument is absent, the default attribute set
+is BIB-1.
=cut
=cut
@@
-173,7
+176,7
@@
sub _error {
my $this = shift();
my (@msg) = @_;
my $this = shift();
my (@msg) = @_;
- $this->{errmsg} = join(@msg);
+ $this->{errmsg} = join("", @msg);
return undef;
}
return undef;
}
@@
-197,6
+200,9
@@
sub _term {
print $parser->errmsg();
print $parser->errmsg();
+Returns the last error-message generated by a failed attempt to parse
+a query.
+
=cut
sub errmsg {
=cut
sub errmsg {
@@
-207,6
+213,8
@@
sub errmsg {
=head1 SEE ALSO
=head1 SEE ALSO
+The C<Net::Z3950::PQF::Node> module.
+
The definition of the Type-1 query in the Z39.50 standard, the
relevant section of which is on-line at
http://www.loc.gov/z3950/agency/markup/09.html#3.7
The definition of the Type-1 query in the Z39.50 standard, the
relevant section of which is on-line at
http://www.loc.gov/z3950/agency/markup/09.html#3.7