/** * 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 type. * @return bool True if tokens match; false otherwise. */ public function match($token) { if (!($this->lexer->lookahead['type'] === $token)) { $this->syntaxError($this->lexer->getLiteral($token)); } $this->lexer->moveNext(); }