lib/Doctrine/ORM/Query/Parser.php
public function match($token)
    {
        $lookaheadType = $this->lexer->lookahead['type'];

        // Short-circuit on first condition, usually types match
        if ($lookaheadType === $token) {
            $this->lexer->moveNext();

            return;
        }

        // If parameter is not identifier (1-99) must be exact match
        if ($token < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is keyword (200+) must be exact match
        if ($token > Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
        if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        $this->lexer->moveNext();
    }
public function match($token)
    {
        $lookaheadType = $this->lexer->lookahead['type'];

        // Short-circuit on first condition, usually types match
        if ($lookaheadType === $token) {
            $this->lexer->moveNext();

            return;
        }

        // If parameter is not identifier (1-99) must be exact match
        if ($token < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is keyword (200+) must be exact match
        if ($token > Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+)
        if ($token === Lexer::T_IDENTIFIER && $lookaheadType < Lexer::T_IDENTIFIER) {
            $this->syntaxError($this->lexer->getLiteral($token));
        }

        $this->lexer->moveNext();
    }
public function match ( $ token ) { $ lookaheadType = $ this -> lexer -> lookahead [ 'type' ] ; // Short-circuit on first condition, usually types match if ( $ lookaheadType === $ token ) { $ this -> lexer -> moveNext ( ) ; return ; } // If parameter is not identifier (1-99) must be exact match if ( $ token < Lexer :: T_IDENTIFIER ) { $ this -> syntaxError ( $ this -> lexer -> getLiteral ( $ token ) ) ; } // If parameter is keyword (200+) must be exact match if ( $ token > Lexer :: T_IDENTIFIER ) { $ this -> syntaxError ( $ this -> lexer -> getLiteral ( $ token ) ) ; } // If parameter is T_IDENTIFIER, then matches T_IDENTIFIER (100) and keywords (200+) if ( $ token === Lexer :: T_IDENTIFIER && $ lookaheadType < Lexer :: T_IDENTIFIER ) { $ this -> syntaxError ( $ this -> lexer -> getLiteral ( $ token ) ) ; } $ this -> lexer -> moveNext ( ) ; }
Attempts to match the given token with the current lookahead token.

If they match, updates the lookahead token; otherwise raises a syntax
error.

@param int $token The token type.

@throws QueryException If the tokens don't match.
Attempts to match the given token with the current lookahead token .