public function parse(string $input)
    {
        $ts = $this->lexer->tokenize($input);
        $parseResult = $this->parseImplementation($ts);

        if ($ts->hasPendingTokens()) {
            throw new SyntaxErrorException('There are tokens not processed.');
        }

        return $parseResult;
    }