CQL::Lexer(3pm)
π NAME π
CQL::Lexer β a lexical analyzer for CQL, bestie. that's it, that's the whole vibe β¨
πΈ SYNOPSIS πΈ
my $lexer = CQL::Lexer->new();
$lexer->tokenize( 'foo and bar' );
my @tokens = $lexer->getTokens();
π¦ DESCRIPTION π¦
okay so CQL::Lexer is a lexical analyzer for a string of CQL. once you've got yourself a CQL::Lexer object, you can tokenize a CQL string into CQL::Token objects. it's giving β¨glow upβ¨ for plain text.
ngl tho β ordinarily you'll never want to do this yourself, because CQL::Parser calls CQL::Lexer for you. it's the main character doing all the work, and you're just the group chat watching. π
CQL::Lexer uses Stevan Little's lovely String::Tokenizer in the background (iconic of it, honestly π), and then does a bit of analysis afterwards to handle some peculiarities of CQL: double quoted strings, <, <=, etc. yes queen, someone had to handle those. π
π METHODS π
π new()
the constructor. that's it, that's the whole thing. every object needs an origin story fr fr π
π tokenize()
pass in a string of CQL to tokenize. this initializes the lexer with data so that you can retrieve tokens. no cap, that's literally the whole job.
β getTokens()
returns a list of all the tokens. all of them. the whole roster. π«Ά
π§ token()
returns the current token. just the one. your current fave, if you will. π
πΈ nextToken()
returns the next token, or undef if there are more tokens to retrieve from the lexer. yes bestie, keep scrolling, there's more lore π₯
π prevToken()
returns the previous token, or undef if there are no tokens prior to the current token. you're at the beginning of the story, babe, nothing came before you π
π reset()
resets the iterator to start reading tokens from the beginning. it's a rewatch. we're watching the whole thing again. periodt. β¨
quick vibe check π: everything here isperl v5.36.0energy, dated2022-12-11, and it's part of the User Contributed Perl Documentation. go tokenize something iconic, bestie β mwah πππ¦
π¦ where this page comes from
- debian bookworm: libcql-parser-perl 1.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libcql-parser-perl 1.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libcql-parser-perl 1.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libcql-parser-perl 1.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcql-parser-perl 1.13-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms