Attempts to match the given token with the current lookahead token. If they match, updates the lookahead token; otherwise raises a syntax error.
int $token type of Token.:
bool True if tokens match; false otherwise.
private function match($token) {
if (!$this->lexer
->isNextToken($token)) {
$this
->syntaxError($this->lexer
->getLiteral($token));
}
return $this->lexer
->moveNext();
}