src/main/java/com/acme/calculator/main/Calculator.java
/**
     * Creates a lexer to tokenize the expression.
     *
     * @param expression to be tokenized
     * @return BasicCalculatorLexer created
     */
Creates a lexer to tokenize the expression.
@param expression to be tokenized
@return BasicCalculatorLexer created
Creates a lexer to tokenize the expression . @param expression to be tokenized @return BasicCalculatorLexer created
private BasicCalculatorLexer createLexer(final String expression) {
        logger.debug("createLexer()");
        final BasicCalculatorLexer lexer = new BasicCalculatorLexer(new ANTLRInputStream(expression));
        lexer.removeErrorListeners();
        lexer.addErrorListener(errorListener);
        return lexer;
    }
private BasicCalculatorLexer createLexer ( final String expression ) { logger . debug ( "createLexer()" ) ; final BasicCalculatorLexer lexer = new BasicCalculatorLexer ( new ANTLRInputStream ( expression ) ) ; lexer . removeErrorListeners ( ) ; lexer . addErrorListener ( errorListener ) ; return lexer ; }
Creates a lexer to tokenize the expression.
Creates a lexer to tokenize the expression .
// Replace default Antlr4 error listener (which prints errors to stderr).