import { NonTerminal as i, Option as f, Alternation as s, RepetitionMandatory as c, RepetitionMandatoryWithSeparator as u, RepetitionWithSeparator as o, Repetition as r, Terminal as l, Alternative as m, Rule as O, AbstractProduction as A } from "./model.js";
import E from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/some.js";
import S from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/includes.js";
import N from "../../../../../../lodash-es@4.17.21/node_modules/lodash-es/every.js";
function M(n) {
  return n instanceof m || n instanceof f || n instanceof r || n instanceof c || n instanceof u || n instanceof o || n instanceof l || n instanceof O;
}
function a(n, e = []) {
  return n instanceof f || n instanceof r || n instanceof o ? !0 : n instanceof s ? E(n.definition, (t) => a(t, e)) : n instanceof i && S(e, n) ? !1 : n instanceof A ? (n instanceof i && e.push(n), N(n.definition, (t) => a(t, e))) : !1;
}
function v(n) {
  return n instanceof s;
}
function D(n) {
  if (n instanceof i)
    return "SUBRULE";
  if (n instanceof f)
    return "OPTION";
  if (n instanceof s)
    return "OR";
  if (n instanceof c)
    return "AT_LEAST_ONE";
  if (n instanceof u)
    return "AT_LEAST_ONE_SEP";
  if (n instanceof o)
    return "MANY_SEP";
  if (n instanceof r)
    return "MANY";
  if (n instanceof l)
    return "CONSUME";
  throw Error("non exhaustive match");
}
export {
  D as getProductionDslName,
  v as isBranchingProd,
  a as isOptionalProd,
  M as isSequenceProd
};
