code: void setLexerAndParser(final Lexer lexer, final ParserWithFormula parser) {
      this.lexer = lexer;
      this.parser = parser;
      this.parser.setFormulaFactory(this.f);
      this.lexer.removeErrorListeners();
      this.parser.removeErrorListeners();
      this.parser.setErrorHandler(new BailErrorStrategy());
    }
docs: Sets the internal lexer and the parser.
  @param lexer  the lexer
  @param parser the parser