ifc-expressions
Version:
Parsing and evaluation of IFC expressions
24 lines (23 loc) • 924 B
JavaScript
import { ErrorListener } from "antlr4";
import { isNullish, isPresent } from "./util/IfcExpressionUtils.js";
import { SyntaxErrorException } from "./error/SyntaxErrorException.js";
export class IfcExpressionErrorListener extends ErrorListener {
validationException(validationException) {
this.exception = validationException;
}
syntaxError(recognizer, offendingSymbol, line, column, msg, e) {
if (typeof offendingSymbol === "number") {
this.exception = new SyntaxErrorException(offendingSymbol, line, column, msg);
}
else {
this.exception = new SyntaxErrorException(isNullish(offendingSymbol) ? "[no symbol]" : offendingSymbol.text, line, column, msg);
}
}
isErrorOccurred() {
return isPresent(this.exception);
}
getException() {
return this.exception;
}
}
//# sourceMappingURL=IfcExpressionErrorListener.js.map