Extends ANTLR's BaseErrorListener, in order to implement custom displays of parse errors. All error reporting displays the line and column number, and underlines the place in the line where the error occurred.

(ns mini-java.ErrorListener
  (:require [mini-java.errors :refer [print-error]])
  (:gen-class
     :name    mini-java.ErrorListener
     :extends org.antlr.v4.runtime.BaseErrorListener))

Report a syntax error.

(defn -syntaxError
  [this parser symbol line column msg exeption]
  (print-error parser msg line column))