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();
}
/** * {@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); }