antlr4-runtime
Version:
JavaScript runtime for ANTLR4
33 lines (27 loc) • 1.36 kB
JavaScript
/* Copyright (c) 2012-2022 The ANTLR Project Contributors. All rights reserved.
* Use is of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
import ErrorListener from "./ErrorListener.js";
export default class ProxyErrorListener extends ErrorListener {
constructor(delegates) {
super();
if (delegates===null) {
throw "delegates";
}
this.delegates = delegates;
return this;
}
syntaxError(recognizer, offendingSymbol, line, column, msg, e) {
this.delegates.map(d => d.syntaxError(recognizer, offendingSymbol, line, column, msg, e));
}
reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs) {
this.delegates.map(d => d.reportAmbiguity(recognizer, dfa, startIndex, stopIndex, exact, ambigAlts, configs));
}
reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs) {
this.delegates.map(d => d.reportAttemptingFullContext(recognizer, dfa, startIndex, stopIndex, conflictingAlts, configs));
}
reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs) {
this.delegates.map(d => d.reportContextSensitivity(recognizer, dfa, startIndex, stopIndex, prediction, configs));
}
}