---
name: "CQL::Token"
section: "3pm"
platform: "linux"
package: "libcql-parser-perl"
version: "1.13-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/CQL::Token"
---

# CQL::Token(3pm)

class for token objects returned by CQL::Lexer

## NAME

CQL::Token - class for token objects returned by CQL::Lexer

## SYNOPSIS

```
    my $token = $lexer->nextToken();

    if ( $token->type() == CQL_WORD ) {
        print "the token is a word with value=", $token->string(), "\n";
    }
```

## DESCRIPTION

Ordinarily you won't really care about the tokens returned by the  CQL::Lexer since the lexer is used behind the scenes by CQL::Parser.

## METHODS

### new()

```
    my $token = CQL::Token->new( '=' );
```

### new()

### getType()

Returns the token type which will be available as one of the constants that CQL::Token exports. See internals for a list of available constants.

### getString()

Retruns the string equivalent of the token. Particularly useful when you only know it's a CQL\_WORD.
