protected function unexpected(?Token $atToken = null): SyntaxErrorException
    {
        $token = $atToken ?? $this->lexer->getToken();

        return $this->lexer->createSyntaxErrorException(\sprintf('Unexpected %s', $token));
    }
protected function unexpected(?Token $atToken = null): SyntaxErrorException
    {
        $token = $atToken ?? $this->lexer->getToken();

        return $this->lexer->createSyntaxErrorException(\sprintf('Unexpected %s', $token));
    }
protected function unexpected ( ? Token $ atToken = null ) : SyntaxErrorException { $ token = $ atToken ?? $ this -> lexer -> getToken ( ) ; return $ this -> lexer -> createSyntaxErrorException ( \ sprintf ( 'Unexpected %s' , $ token ) ) ; }
Helper function for creating an error when an unexpected lexed token
is encountered.

@param Token|null $atToken
@return SyntaxErrorException
Helper function for creating an error when an unexpected lexed token is encountered .