Text::Query::Parse(3)
β¨ NAME β¨
okay so welcome to Text::Query::Parse(3), bestie β this is the User Contributed Perl Documentation page for Text::Query::Parse, aka the base class for query parsers. it's giving foundational, it's giving "build your parser on me" π
π¦ 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. no cap, it's the blueprint π
It defines the prepare method that is called by the Text::Query object to compile the query string. iconic behavior, honestly.
π MEMBERS π
-buildβ Pointer to aText::Query::Buildobject.scopeβ Scope stack. Defines the context in which the query must be solved.tokenβ The current token. Destroyed byprepare.tokensβ A reference to the list of all the tokens. Filled byparse_tokens. Destroyed byprepare.parseoptsβ A reference to a hash table containing all the parameters given to thepreparefunction.-verboseβ Integer indicating the desired verbose level.
π METHODS π
π prepare (QSTRING [OPTIONS])
Compiles the query expression in QSTRING to internal form and sets any options. main character method energy β¨
First calls build_init to reset the builder and destroy the token and tokens members. Then calls parse_tokens to fill the tokens member. Then calls expression to use the tokens from tokens. The expression is expected to call the build_* functions to build the compiled expression. At last calls build_final_expression with the result of expression.
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 build_* functions using the tokens.
π parse_tokens (QSTRING)
Must be redefined by derived package. Parses the QSTRING scalar and fills the tokens member with lexical units.
π
build_*
Shortcuts to the corresponding function of the Text::Query::Build object found in the -build member.
π OPTIONS π
These are the options of the prepare method and the constructor. so many little slay buttons π«Ά
-quotesβ defaults to\'\". Defines the quote characters.-caseβ defaults to0. If true, do case-sensitive match.-litspaceβ defaults to0. If true, match spaces (except between operators) inQSTRINGliterally. If false, match spaces as"\s+".-regexpβ defaults to0. If true, treat patterns inQSTRINGas regular expressions rather than literal text.-wholeβ defaults to0. If true, match whole words only, not substrings of words.
π₯ SEE ALSO π₯
π AUTHORS π
- Eric Bohlman (
ebohlman@netcom.com) - Loic Dachary (
loic@senga.org)
mwah π this page is perl v5.38.2, dated 2024-07-13, and it's the Text::Query::Parse(3) manual page. bye bestie, go build something iconic π«Άβ¨
π¦ where this page comes from
- arch rolling: perl-text-query 0.09-5 Β· GPL AND PerlArtistic
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms