import { AbstractAstReflection as X } from "../../syntax-tree.js";
const U = "AbstractRule", x = "AbstractType", H = "Condition", Q = "TypeDefinition", M = "ValueLiteral", s = "AbstractElement";
function _(e) {
  return n.isInstance(e, s);
}
const D = "ArrayLiteral", E = "ArrayType", i = "BooleanLiteral";
function ee(e) {
  return n.isInstance(e, i);
}
const c = "Conjunction";
function ne(e) {
  return n.isInstance(e, c);
}
const u = "Disjunction";
function ae(e) {
  return n.isInstance(e, u);
}
const j = "Grammar", q = "GrammarImport", m = "InferredType";
function re(e) {
  return n.isInstance(e, m);
}
const o = "Interface";
function te(e) {
  return n.isInstance(e, o);
}
const z = "NamedArgument", l = "Negation";
function se(e) {
  return n.isInstance(e, l);
}
const B = "NumberLiteral", O = "Parameter", p = "ParameterReference";
function ie(e) {
  return n.isInstance(e, p);
}
const d = "ParserRule";
function ce(e) {
  return n.isInstance(e, d);
}
const $ = "ReferenceType", W = "ReturnType";
function ue(e) {
  return n.isInstance(e, W);
}
const f = "SimpleType";
function me(e) {
  return n.isInstance(e, f);
}
const F = "StringLiteral", t = "TerminalRule";
function oe(e) {
  return n.isInstance(e, t);
}
const y = "Type";
function le(e) {
  return n.isInstance(e, y);
}
const J = "TypeAttribute", K = "UnionType", T = "Action";
function pe(e) {
  return n.isInstance(e, T);
}
const h = "Alternatives";
function de(e) {
  return n.isInstance(e, h);
}
const R = "Assignment";
function fe(e) {
  return n.isInstance(e, R);
}
const I = "CharacterRange";
function ye(e) {
  return n.isInstance(e, I);
}
const g = "CrossReference";
function Te(e) {
  return n.isInstance(e, g);
}
const k = "EndOfFile";
function he(e) {
  return n.isInstance(e, k);
}
const A = "Group";
function Re(e) {
  return n.isInstance(e, A);
}
const V = "Keyword";
function Ie(e) {
  return n.isInstance(e, V);
}
const b = "NegatedToken";
function ge(e) {
  return n.isInstance(e, b);
}
const C = "RegexToken";
function ke(e) {
  return n.isInstance(e, C);
}
const G = "RuleCall";
function Ae(e) {
  return n.isInstance(e, G);
}
const S = "TerminalAlternatives";
function Ve(e) {
  return n.isInstance(e, S);
}
const v = "TerminalGroup";
function be(e) {
  return n.isInstance(e, v);
}
const L = "TerminalRuleCall";
function Ce(e) {
  return n.isInstance(e, L);
}
const N = "UnorderedGroup";
function Ge(e) {
  return n.isInstance(e, N);
}
const P = "UntilToken";
function Se(e) {
  return n.isInstance(e, P);
}
const w = "Wildcard";
function ve(e) {
  return n.isInstance(e, w);
}
class Y extends X {
  getAllTypes() {
    return [s, U, x, T, h, D, E, R, i, I, H, c, g, u, k, j, q, A, m, o, V, z, b, l, B, O, p, d, $, C, W, G, f, F, S, v, t, L, y, J, Q, K, N, P, M, w];
  }
  computeIsSubtype(r, a) {
    switch (r) {
      case T:
      case h:
      case R:
      case I:
      case g:
      case k:
      case A:
      case V:
      case b:
      case C:
      case G:
      case S:
      case v:
      case L:
      case N:
      case P:
      case w:
        return this.isSubtype(s, a);
      case D:
      case B:
      case F:
        return this.isSubtype(M, a);
      case E:
      case $:
      case f:
      case K:
        return this.isSubtype(Q, a);
      case i:
        return this.isSubtype(H, a) || this.isSubtype(M, a);
      case c:
      case u:
      case l:
      case p:
        return this.isSubtype(H, a);
      case m:
      case o:
      case y:
        return this.isSubtype(x, a);
      case d:
        return this.isSubtype(U, a) || this.isSubtype(x, a);
      case t:
        return this.isSubtype(U, a);
      default:
        return !1;
    }
  }
  getReferenceType(r) {
    const a = `${r.container.$type}:${r.property}`;
    switch (a) {
      case "Action:type":
      case "CrossReference:type":
      case "Interface:superTypes":
      case "ParserRule:returnType":
      case "SimpleType:typeRef":
        return x;
      case "Grammar:hiddenTokens":
      case "ParserRule:hiddenTokens":
      case "RuleCall:rule":
        return U;
      case "Grammar:usedGrammars":
        return j;
      case "NamedArgument:parameter":
      case "ParameterReference:parameter":
        return O;
      case "TerminalRuleCall:rule":
        return t;
      default:
        throw new Error(`${a} is not a valid reference id.`);
    }
  }
  getTypeMetaData(r) {
    switch (r) {
      case s:
        return {
          name: s,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" }
          ]
        };
      case D:
        return {
          name: D,
          properties: [
            { name: "elements", defaultValue: [] }
          ]
        };
      case E:
        return {
          name: E,
          properties: [
            { name: "elementType" }
          ]
        };
      case i:
        return {
          name: i,
          properties: [
            { name: "true", defaultValue: !1 }
          ]
        };
      case c:
        return {
          name: c,
          properties: [
            { name: "left" },
            { name: "right" }
          ]
        };
      case u:
        return {
          name: u,
          properties: [
            { name: "left" },
            { name: "right" }
          ]
        };
      case j:
        return {
          name: j,
          properties: [
            { name: "definesHiddenTokens", defaultValue: !1 },
            { name: "hiddenTokens", defaultValue: [] },
            { name: "imports", defaultValue: [] },
            { name: "interfaces", defaultValue: [] },
            { name: "isDeclared", defaultValue: !1 },
            { name: "name" },
            { name: "rules", defaultValue: [] },
            { name: "types", defaultValue: [] },
            { name: "usedGrammars", defaultValue: [] }
          ]
        };
      case q:
        return {
          name: q,
          properties: [
            { name: "path" }
          ]
        };
      case m:
        return {
          name: m,
          properties: [
            { name: "name" }
          ]
        };
      case o:
        return {
          name: o,
          properties: [
            { name: "attributes", defaultValue: [] },
            { name: "name" },
            { name: "superTypes", defaultValue: [] }
          ]
        };
      case z:
        return {
          name: z,
          properties: [
            { name: "calledByName", defaultValue: !1 },
            { name: "parameter" },
            { name: "value" }
          ]
        };
      case l:
        return {
          name: l,
          properties: [
            { name: "value" }
          ]
        };
      case B:
        return {
          name: B,
          properties: [
            { name: "value" }
          ]
        };
      case O:
        return {
          name: O,
          properties: [
            { name: "name" }
          ]
        };
      case p:
        return {
          name: p,
          properties: [
            { name: "parameter" }
          ]
        };
      case d:
        return {
          name: d,
          properties: [
            { name: "dataType" },
            { name: "definesHiddenTokens", defaultValue: !1 },
            { name: "definition" },
            { name: "entry", defaultValue: !1 },
            { name: "fragment", defaultValue: !1 },
            { name: "hiddenTokens", defaultValue: [] },
            { name: "inferredType" },
            { name: "name" },
            { name: "parameters", defaultValue: [] },
            { name: "returnType" },
            { name: "wildcard", defaultValue: !1 }
          ]
        };
      case $:
        return {
          name: $,
          properties: [
            { name: "referenceType" }
          ]
        };
      case W:
        return {
          name: W,
          properties: [
            { name: "name" }
          ]
        };
      case f:
        return {
          name: f,
          properties: [
            { name: "primitiveType" },
            { name: "stringType" },
            { name: "typeRef" }
          ]
        };
      case F:
        return {
          name: F,
          properties: [
            { name: "value" }
          ]
        };
      case t:
        return {
          name: t,
          properties: [
            { name: "definition" },
            { name: "fragment", defaultValue: !1 },
            { name: "hidden", defaultValue: !1 },
            { name: "name" },
            { name: "type" }
          ]
        };
      case y:
        return {
          name: y,
          properties: [
            { name: "name" },
            { name: "type" }
          ]
        };
      case J:
        return {
          name: J,
          properties: [
            { name: "defaultValue" },
            { name: "isOptional", defaultValue: !1 },
            { name: "name" },
            { name: "type" }
          ]
        };
      case K:
        return {
          name: K,
          properties: [
            { name: "types", defaultValue: [] }
          ]
        };
      case T:
        return {
          name: T,
          properties: [
            { name: "cardinality" },
            { name: "feature" },
            { name: "inferredType" },
            { name: "lookahead" },
            { name: "operator" },
            { name: "type" }
          ]
        };
      case h:
        return {
          name: h,
          properties: [
            { name: "cardinality" },
            { name: "elements", defaultValue: [] },
            { name: "lookahead" }
          ]
        };
      case R:
        return {
          name: R,
          properties: [
            { name: "cardinality" },
            { name: "feature" },
            { name: "lookahead" },
            { name: "operator" },
            { name: "terminal" }
          ]
        };
      case I:
        return {
          name: I,
          properties: [
            { name: "cardinality" },
            { name: "left" },
            { name: "lookahead" },
            { name: "right" }
          ]
        };
      case g:
        return {
          name: g,
          properties: [
            { name: "cardinality" },
            { name: "deprecatedSyntax", defaultValue: !1 },
            { name: "lookahead" },
            { name: "terminal" },
            { name: "type" }
          ]
        };
      case k:
        return {
          name: k,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" }
          ]
        };
      case A:
        return {
          name: A,
          properties: [
            { name: "cardinality" },
            { name: "elements", defaultValue: [] },
            { name: "guardCondition" },
            { name: "lookahead" }
          ]
        };
      case V:
        return {
          name: V,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "value" }
          ]
        };
      case b:
        return {
          name: b,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "terminal" }
          ]
        };
      case C:
        return {
          name: C,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "regex" }
          ]
        };
      case G:
        return {
          name: G,
          properties: [
            { name: "arguments", defaultValue: [] },
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "rule" }
          ]
        };
      case S:
        return {
          name: S,
          properties: [
            { name: "cardinality" },
            { name: "elements", defaultValue: [] },
            { name: "lookahead" }
          ]
        };
      case v:
        return {
          name: v,
          properties: [
            { name: "cardinality" },
            { name: "elements", defaultValue: [] },
            { name: "lookahead" }
          ]
        };
      case L:
        return {
          name: L,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "rule" }
          ]
        };
      case N:
        return {
          name: N,
          properties: [
            { name: "cardinality" },
            { name: "elements", defaultValue: [] },
            { name: "lookahead" }
          ]
        };
      case P:
        return {
          name: P,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" },
            { name: "terminal" }
          ]
        };
      case w:
        return {
          name: w,
          properties: [
            { name: "cardinality" },
            { name: "lookahead" }
          ]
        };
      default:
        return {
          name: r,
          properties: []
        };
    }
  }
}
const n = new Y();
export {
  s as AbstractElement,
  U as AbstractRule,
  x as AbstractType,
  T as Action,
  h as Alternatives,
  D as ArrayLiteral,
  E as ArrayType,
  R as Assignment,
  i as BooleanLiteral,
  I as CharacterRange,
  H as Condition,
  c as Conjunction,
  g as CrossReference,
  u as Disjunction,
  k as EndOfFile,
  j as Grammar,
  q as GrammarImport,
  A as Group,
  m as InferredType,
  o as Interface,
  V as Keyword,
  Y as LangiumGrammarAstReflection,
  z as NamedArgument,
  b as NegatedToken,
  l as Negation,
  B as NumberLiteral,
  O as Parameter,
  p as ParameterReference,
  d as ParserRule,
  $ as ReferenceType,
  C as RegexToken,
  W as ReturnType,
  G as RuleCall,
  f as SimpleType,
  F as StringLiteral,
  S as TerminalAlternatives,
  v as TerminalGroup,
  t as TerminalRule,
  L as TerminalRuleCall,
  y as Type,
  J as TypeAttribute,
  Q as TypeDefinition,
  K as UnionType,
  N as UnorderedGroup,
  P as UntilToken,
  M as ValueLiteral,
  w as Wildcard,
  _ as isAbstractElement,
  pe as isAction,
  de as isAlternatives,
  fe as isAssignment,
  ee as isBooleanLiteral,
  ye as isCharacterRange,
  ne as isConjunction,
  Te as isCrossReference,
  ae as isDisjunction,
  he as isEndOfFile,
  Re as isGroup,
  re as isInferredType,
  te as isInterface,
  Ie as isKeyword,
  ge as isNegatedToken,
  se as isNegation,
  ie as isParameterReference,
  ce as isParserRule,
  ke as isRegexToken,
  ue as isReturnType,
  Ae as isRuleCall,
  me as isSimpleType,
  Ve as isTerminalAlternatives,
  be as isTerminalGroup,
  oe as isTerminalRule,
  Ce as isTerminalRuleCall,
  le as isType,
  Ge as isUnorderedGroup,
  Se as isUntilToken,
  ve as isWildcard,
  n as reflection
};
