import { AbstractProduction as e, Alternation as t, Alternative as n, NonTerminal as r, Option as i, Repetition as a, RepetitionMandatory as o, RepetitionMandatoryWithSeparator as s, RepetitionWithSeparator as c, Rule as l, Terminal as u } from "./model.js";
//#region ../../node_modules/@chevrotain/gast/lib/src/helpers.js
function d(e) {
	return e instanceof n || e instanceof i || e instanceof a || e instanceof o || e instanceof s || e instanceof c || e instanceof u || e instanceof l;
}
function f(n, o = []) {
	return n instanceof i || n instanceof a || n instanceof c ? !0 : n instanceof t ? n.definition.some((e) => f(e, o)) : n instanceof r && o.includes(n) ? !1 : n instanceof e ? (n instanceof r && o.push(n), n.definition.every((e) => f(e, o))) : !1;
}
function p(e) {
	return e instanceof t;
}
function m(e) {
	/* istanbul ignore else */
	if (e instanceof r) return "SUBRULE";
	if (e instanceof i) return "OPTION";
	if (e instanceof t) return "OR";
	if (e instanceof o) return "AT_LEAST_ONE";
	if (e instanceof s) return "AT_LEAST_ONE_SEP";
	if (e instanceof c) return "MANY_SEP";
	if (e instanceof a) return "MANY";
	if (e instanceof u) return "CONSUME";
	throw Error("non exhaustive match");
}
//#endregion
export { m as getProductionDslName, p as isBranchingProd, f as isOptionalProd, d as isSequenceProd };
