Doctrine\ORM\Query\Parser::match PHP Метод

match() публичный Метод

If they match, updates the lookahead token; otherwise raises a syntax error.
public match ( $token ) : void
Результат void
    public function match($token)
    {
        // short-circuit on first condition, usually types match
        if ($this->_lexer->lookahead['type'] !== $token &&
                $token !== Lexer::T_IDENTIFIER &&
                $this->_lexer->lookahead['type'] <= Lexer::T_IDENTIFIER
         ) {
            $this->syntaxError($this->_lexer->getLiteral($token));
        }

        $this->_lexer->moveNext();
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function parse(Parser $parser)
 {
     $parser->match(Lexer::T_IDENTIFIER);
     $parser->match(Lexer::T_OPEN_PARENTHESIS);
     $this->pathExpression = $parser->SingleValuedPathExpression();
     $parser->match(Lexer::T_CLOSE_PARENTHESIS);
 }
All Usage Examples Of Doctrine\ORM\Query\Parser::match
Parser