.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Text::Query::Parse 3" .TH Text::Query::Parse 3 2024-07-13 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Text::Query::Parse \- Base class for query parsers .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& package Text::Query::ParseThisSyntax; \& \& use Text::Query::Parse; \& \& use vars qw(@ISA); \& \& @ISA = qw(Text::Query::Parse); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" This module provides a virtual base class for query parsers. .PP It defines the \f(CW\*(C`prepare\*(C'\fR method that is called by the \f(CW\*(C`Text::Query\*(C'\fR object to compile the query string. .SH MEMBERS .IX Header "MEMBERS" .IP "\fB\-build\fR Pointer to a Text::Query::Build object." 4 .IX Item "-build Pointer to a Text::Query::Build object." .PD 0 .IP "\fBscope\fR Scope stack. Defines the context in which the query must be solved." 4 .IX Item "scope Scope stack. Defines the context in which the query must be solved." .ie n .IP "\fBtoken\fR The current token. Destroyed by ""prepare""." 4 .el .IP "\fBtoken\fR The current token. Destroyed by \f(CWprepare\fR." 4 .IX Item "token The current token. Destroyed by prepare." .ie n .IP "\fBtokens\fR A reference to the list of all the tokens. Filled by parse_tokens. Destroyed by ""prepare""." 4 .el .IP "\fBtokens\fR A reference to the list of all the tokens. Filled by parse_tokens. Destroyed by \f(CWprepare\fR." 4 .IX Item "tokens A reference to the list of all the tokens. Filled by parse_tokens. Destroyed by prepare." .ie n .IP "\fBparseopts\fR A reference to a hash table containing all the parameters given to the ""prepare"" function." 4 .el .IP "\fBparseopts\fR A reference to a hash table containing all the parameters given to the \f(CWprepare\fR function." 4 .IX Item "parseopts A reference to a hash table containing all the parameters given to the prepare function." .IP "\fB\-verbose\fR Integer indicating the desired verbose level." 4 .IX Item "-verbose Integer indicating the desired verbose level." .PD .SH METHODS .IX Header "METHODS" .IP "prepare (QSTRING [OPTIONS])" 4 .IX Item "prepare (QSTRING [OPTIONS])" Compiles the query expression in \f(CW\*(C`QSTRING\*(C'\fR to internal form and sets any options. First calls \f(CW\*(C`build_init\*(C'\fR to reset the builder and destroy the \&\f(CW\*(C`token\*(C'\fR and \f(CW\*(C`tokens\*(C'\fR members. Then calls \f(CW\*(C`parse_tokens\*(C'\fR to fill the \f(CW\*(C`tokens\*(C'\fR member. Then calls \f(CW\*(C`expression\*(C'\fR to use the tokens from \&\f(CW\*(C`tokens\*(C'\fR. The \f(CW\*(C`expression\*(C'\fR is expected to call the \f(CW\*(C`build_*\*(C'\fR functions to build the compiled expression. At last calls \f(CW\*(C`build_final_expression\*(C'\fR with the result of \f(CW\*(C`expression\*(C'\fR. .Sp A derived parser must redefine this function to define default values for specific options. .IP "expression ()" 4 .IX Item "expression ()" Must be redefined by derived package. Returns the internal form of the question built from \f(CW\*(C`build_*\*(C'\fR functions using the \f(CW\*(C`tokens\*(C'\fR. .IP "parse_tokens (QSTRING)" 4 .IX Item "parse_tokens (QSTRING)" Must be redefined by derived package. Parses the \f(CW\*(C`QSTRING\*(C'\fR scalar and fills the \f(CW\*(C`tokens\*(C'\fR member with lexical units. .IP build_* 4 .IX Item "build_*" Shortcuts to the corresponding function of the Text::Query::Build object found in the \f(CW\*(C`\-build\*(C'\fR member. .SH OPTIONS .IX Header "OPTIONS" These are the options of the \f(CW\*(C`prepare\*(C'\fR method and the constructor. .IP "\-quotes defaults to \e'\e""" 4 .IX Item "-quotes defaults to '""" Defines the quote characters. .IP "\-case defaults to 0" 4 .IX Item "-case defaults to 0" If true, do case-sensitive match. .IP "\-litspace defaults to 0" 4 .IX Item "-litspace defaults to 0" If true, match spaces (except between operators) in \&\f(CW\*(C`QSTRING\*(C'\fR literally. If false, match spaces as \f(CW\*(C`\es+\*(C'\fR. .IP "\-regexp defaults to 0" 4 .IX Item "-regexp defaults to 0" If true, treat patterns in \f(CW\*(C`QSTRING\*(C'\fR as regular expressions rather than literal text. .IP "\-whole defaults to 0" 4 .IX Item "-whole defaults to 0" If true, match whole words only, not substrings of words. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBText::Query\fR\|(3) .SH AUTHORS .IX Header "AUTHORS" Eric Bohlman (ebohlman@netcom.com) .PP Loic Dachary (loic@senga.org)