PPIx::R...p::Lexer(3)

πŸ’– PPIx::Regexp::Lexer πŸ’–

okay bestie, welcome to PPIx::Regexp::Lexer, a page straight out of the User Contributed Perl Documentation collection. she's the one who takes your tokenizer's messy lil pile of tokens and turns them into an actual parse tree. iconic behavior, honestly. πŸŽ€


✨ NAME ✨

PPIx::Regexp::Lexer β€” Assemble tokenizer output. that's it, that's the job. πŸ’…


🌸 SYNOPSIS 🌸

use PPIx::Regexp::Lexer;
use PPIx::Regexp::Dumper;
my $lex = PPIx::Regexp::Lexer->new('qr{foo}smx');
my $dmp = PPIx::Regexp::Dumper->new( $lex );
$dmp->print();

look at her go πŸ¦‹ she lexes, the dumper dumps, the vibes are immaculate.


πŸ’œ INHERITANCE πŸ’œ

PPIx::Regexp::Lexer is a PPIx::Regexp::Support. she knows where she came from.

PPIx::Regexp::Lexer has no descendants. no children, no heirs, just main character energy. πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea β˜• this class takes the token stream that PPIx::Regexp::Tokenizer generated and turns it into the parse tree. tokenizer makes the tokens, lexer makes the tree, everybody eats. πŸ”₯


✨ METHODS ✨

this class provides the following public methods. any method not documented down here is private, and unsupported in the sense that the author reserves the right to change or remove it without notice. so don't get attached to the undocumented ones, bestie, they could ghost you at any time. πŸ’€

🫢 new

this method instantiates the lexer. she takes as her argument either a PPIx::Regexp::Tokenizer or the text to be parsed. if you hand her text, the tokenizer gets instantiated from that text for you. convenient fr fr. ✨

any optional name/value pairs after the first argument get passed along to the tokenizer, which interprets them or not as the case may be. that's the tokenizer's business, not hers. πŸ™ˆ

😭 errstr

this method returns the error string from the last attempt to instantiate a PPIx::Regexp::Lexer.

if the last attempt actually succeeded? then the error is undef. no drama, no error, we thriving. πŸ’–

πŸ’€ failures

print $lexer->failures(), " parse failures\n";

this method returns the number of parse failures encountered. a parse failure is either:

  • a tokenization failure (peep PPIx::Regexp::Tokenizer->failures() for that one), or
  • a structural error.

count them, cry about them, whatever you need to do. 😭

⭐ lex

this method lexes the tokens in the text and returns the lexed list of elements. this is the whole point of her existence and she slays it. πŸ‘‘

🌈 strict

this method returns true or false based on the value of the 'strict' argument that got passed to new(). simple as that, no cap. πŸ’…


🧚 SUPPORT 🧚

support is by the author, bestie. please file bug reports at https://github.com/trwyant/perl-PPIx-Regexp/issues or in electronic mail to the author. don't suffer in silence, that's not the vibe. 🫢


πŸ‘‘ AUTHOR πŸ‘‘

Thomas R. Wyant, III β€” harryfmudd at comcast dot net


Copyright (C) 2009-2023, 2025-2026 by Thomas R. Wyant, III

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. for more details, see the full text of the licenses in the directory LICENSES. πŸ“

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. that's the legal way of saying "she's yours now, good luck". πŸ™ˆ


perl v5.42.2 Β· 2026-06-15 β€” and that's the whole page bestie, mwah πŸ’…βœ¨ go lex something cute, ily, bye! πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from