SYNOPSIS

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

DESCRIPTION

CQL::Lexer is lexical analyzer for a string of \s-1CQL\s0. Once you've got a CQL::Lexer object you can tokenize a \s-1CQL\s0 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 \s-1CQL:\s0 double quoted strings, <, <=, etc.

METHODS

\fInew()\fP

The constructor.

\fItokenize()\fP

Pass in a string of \s-1CQL\s0 to tokenize. This initializes the lexer with data so that you can retrieve tokens.

\fIgetTokens()\fP

Returns a list of all the tokens.

\fItoken()\fP

Returns the current token.

\fInextToken()\fP

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

\fIprevToken()\fP

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

\fIreset()\fP

Resets the iterator to start reading tokens from the beginning.