import { defineNameProp as e } from "../../lang/lang_extensions.js";
//#region ../../node_modules/chevrotain/lib/src/parse/cst/cst_visitor.js
function t(e, t) {
	let n = Object.keys(e), r = n.length;
	for (let i = 0; i < r; i++) {
		let r = e[n[i]], a = r.length;
		for (let e = 0; e < a; e++) {
			let n = r[e];
			n.tokenTypeIdx === void 0 && this[n.name](n.children, t);
		}
	}
}
function n(t, n) {
	let r = function() {};
	return e(r, t + "BaseSemantics"), r.prototype = {
		visit: function(e, t) {
			if (Array.isArray(e) && (e = e[0]), e !== void 0) return this[e.name](e.children, t);
		},
		validateVisitor: function() {
			let e = a(this, n);
			if (e.length !== 0) {
				let t = e.map((e) => e.msg);
				throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:\n\t${t.join("\n\n").replace(/\n/g, "\n	")}`);
			}
		}
	}, r.prototype.constructor = r, r._RULE_NAMES = n, r;
}
function r(n, r, i) {
	let a = function() {};
	e(a, n + "BaseSemanticsWithDefaults");
	let o = Object.create(i.prototype);
	return r.forEach((e) => {
		o[e] = t;
	}), a.prototype = o, a.prototype.constructor = a, a;
}
var i;
(function(e) {
	e[e.REDUNDANT_METHOD = 0] = "REDUNDANT_METHOD", e[e.MISSING_METHOD = 1] = "MISSING_METHOD";
})(i ||= {});
function a(e, t) {
	return o(e, t);
}
function o(e, t) {
	return t.filter((t) => typeof e[t] != "function").map((t) => ({
		msg: `Missing visitor method: <${t}> on ${e.constructor.name} CST Visitor.`,
		type: i.MISSING_METHOD,
		methodName: t
	})).filter(Boolean);
}
//#endregion
export { n as createBaseSemanticVisitorConstructor, r as createBaseVisitorConstructorWithDefaults };
