man Text::Query::Parse () - Base class for query parsers

NAME

Text::Query::Parse - Base class for query parsers

SYNOPSIS

    package Text::Query::ParseThisSyntax;

    use Text::Query::Parse;

    use vars qw(@ISA);

    @ISA = qw(Text::Query::Parse);

DESCRIPTION

This module provides a virtual base class for query parsers.

It defines the CWprepare method that is called by the CWText::Query object to compile the query string.

MEMBERS

-build Pointer to a Text::Query::Build object.
scope Scope stack. Defines the context in which the query must be solved.
-verbose Integer indicating the desired verbose level.

METHODS

prepare (QSTRING [OPTIONS])
Compiles the query expression in CWQSTRING to internal form and sets any options. First calls CWbuild_init to reset the builder and destroy the CWtoken and CWtokens members. Then calls CWparse_tokens to fill the CWtokens member. Then calls CWexpression to use the tokens from CWtokens. The CWexpression is expected to call the CWbuild_* functions to build the compiled expression. At last calls CWbuild_final_expression with the result of CWexpression. A derived parser must redefine this function to define default values for specific options.
expression ()
Must be redefined by derived package. Returns the internal form of the question built from CWbuild_* functions using the CWtokens.
parse_tokens (QSTRING)
Must be redefined by derived package. Parses the CWQSTRING scalar and fills the CWtokens member with lexical units.
build_*
Shortcuts to the corresponding function of the Text::Query::Build object found in the CW-build member.

OPTIONS

These are the options of the CWprepare method and the constructor.

-quotes defaults to \'\
Defines the quote characters.
-case defaults to 0
If true, do case-sensitive match.
-litspace defaults to 0
If true, match spaces (except between operators) in CWQSTRING literally. If false, match spaces as CW\s+.
-regexp defaults to 0
If true, treat patterns in CWQSTRING as regular expressions rather than literal text.
-whole defaults to 0
If true, match whole words only, not substrings of words.

SEE ALSO

AUTHORS

Eric Bohlman (ebohlman@netcom.com)

Loic Dachary (loic@senga.org)