public function init(Parser $parser, Lexer $lexer) {
        $parser->setStartRule($this->startRule);

        foreach ($this->rules as $rule) {
            $parser->addRule($rule);
        }

        $parser->setLexer($lexer);
        $lexer->setParser($parser);

        return $this;
    }