function u(t) {
  return typeof t == "object" && t !== null && typeof t.$type == "string";
}
function o(t) {
  return typeof t == "object" && t !== null && typeof t.$refText == "string";
}
function l(t) {
  return typeof t == "object" && t !== null && typeof t.name == "string" && typeof t.type == "string" && typeof t.path == "string";
}
function c(t) {
  return typeof t == "object" && t !== null && u(t.container) && o(t.reference) && typeof t.message == "string";
}
class p {
  constructor() {
    this.subtypes = {}, this.allSubtypes = {};
  }
  isInstance(e, s) {
    return u(e) && this.isSubtype(e.$type, s);
  }
  isSubtype(e, s) {
    if (e === s)
      return !0;
    let n = this.subtypes[e];
    n || (n = this.subtypes[e] = {});
    const i = n[s];
    if (i !== void 0)
      return i;
    {
      const r = this.computeIsSubtype(e, s);
      return n[s] = r, r;
    }
  }
  getAllSubTypes(e) {
    const s = this.allSubtypes[e];
    if (s)
      return s;
    {
      const n = this.getAllTypes(), i = [];
      for (const r of n)
        this.isSubtype(r, e) && i.push(r);
      return this.allSubtypes[e] = i, i;
    }
  }
}
function f(t) {
  return typeof t == "object" && t !== null && Array.isArray(t.content);
}
function y(t) {
  return typeof t == "object" && t !== null && typeof t.tokenType == "object";
}
function a(t) {
  return f(t) && typeof t.fullText == "string";
}
export {
  p as AbstractAstReflection,
  u as isAstNode,
  l as isAstNodeDescription,
  f as isCompositeCstNode,
  y as isLeafCstNode,
  c as isLinkingError,
  o as isReference,
  a as isRootCstNode
};
