Text::Query::Parse(3)

πŸ“¦ version 0.09, in arch rolling

✨ 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 a Text::Query::Build object.
  • scope β€” Scope stack. Defines the context in which the query must be solved.
  • token β€” The current token. Destroyed by prepare.
  • tokens β€” A reference to the list of all the tokens. Filled by parse_tokens. Destroyed by prepare.
  • parseopts β€” A reference to a hash table containing all the parameters given to the prepare function.
  • -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 to 0. If true, do case-sensitive match.
  • -litspace β€” defaults to 0. If true, match spaces (except between operators) in QSTRING literally. If false, match spaces as "\s+".
  • -regexp β€” defaults to 0. If true, treat patterns in QSTRING as regular expressions rather than literal text.
  • -whole β€” defaults to 0. If true, match whole words only, not substrings of words.

πŸ”₯ SEE ALSO πŸ”₯

Text::Query(3)


πŸ‘‘ 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