logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

CQL::Lexer - a lexical analyzer for CQL

Description

       CQL::Lexer is lexical analyzer for a string of CQL. Once you've got a CQL::Lexer object you can tokenize
       a CQL string into CQL::Token objects. Ordinarily you'll never want to do this yourself since CQL::Parser
       calls CQL::Lexer for you.

       CQL::Lexer uses Stevan Little's lovely String::Tokenizer in the background, and does a bit of analysis
       afterwards to handle some peculiarities of CQL: double quoted strings, <, <=, etc.

Methods

new()
       The constructor.

   tokenize()
       Pass in a string of CQL to tokenize. This initializes the lexer with data so that you can retrieve
       tokens.

   getTokens()
       Returns a list of all the tokens.

   token()
       Returns the current token.

   nextToken()
       Returns the next token, or undef if there are more tokens to retrieve from the lexer.

   prevToken()
       Returns the previous token, or undef if there are no tokens prior to the current token.

   reset()
       Resets the iterator to start reading tokens from the beginning.

perl v5.36.0                                       2022-12-11                                    CQL::Lexer(3pm)

Name

       CQL::Lexer - a lexical analyzer for CQL

Synopsis

           my $lexer = CQL::Lexer->new();
           $lexer->tokenize( 'foo and bar' );
           my @tokens = $lexer->getTokens();

See Also