UNPKG

@cratedb/cratedb-sqlparse

Version:

![NPM License](https://img.shields.io/npm/l/@cratedb/cratedb-sqlparse) ![NPM Version](https://img.shields.io/npm/v/@cratedb/cratedb-sqlparse) ![NPM Downloads](https://img.shields.io/npm/dm/@cratedb/cratedb-sqlparse)

1,458 lines 1.36 MB
var __defProp = Object.defineProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); var t = { 763: () => { } }, e = {}; function n(s2) { var i2 = e[s2]; if (void 0 !== i2) return i2.exports; var r2 = e[s2] = { exports: {} }; return t[s2](r2, r2.exports, n), r2.exports; } n.d = (t2, e2) => { for (var s2 in e2) n.o(e2, s2) && !n.o(t2, s2) && Object.defineProperty(t2, s2, { enumerable: true, get: e2[s2] }); }, n.o = (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2); var s = {}; n.d(s, { MG: () => $, fr: () => Lt, sR: () => Ae, Zo: () => ke, iH: () => Re, rt: () => Pt, jB: () => be, M8: () => le, $t: () => Ce, aq: () => me, pG: () => Ot, eP: () => Te, KU: () => xe, zW: () => Ie, IX: () => E, mY: () => _, a7: () => j, JG: () => Ut, ay: () => Xt, X2: () => ee, WU: () => de, Uw: () => ge, gw: () => pe, iX: () => Fe, re: () => se, Pg: () => Be, tD: () => ie, R$: () => te, Dj: () => Ft, m7: () => U, NZ: () => P, xo: () => b, ou: () => i, qC: () => ze, mD: () => d, Ay: () => Ye }); class i { constructor() { this.source = null, this.type = null, this.channel = null, this.start = null, this.stop = null, this.tokenIndex = null, this.line = null, this.column = null, this._text = null; } getTokenSource() { return this.source[0]; } getInputStream() { return this.source[1]; } get text() { return this._text; } set text(t2) { this._text = t2; } } function r(t2, e2) { if (!Array.isArray(t2) || !Array.isArray(e2)) return false; if (t2 === e2) return true; if (t2.length !== e2.length) return false; for (let n2 = 0; n2 < t2.length; n2++) if (!(t2[n2] === e2[n2] || t2[n2].equals && t2[n2].equals(e2[n2]))) return false; return true; } i.INVALID_TYPE = 0, i.EPSILON = -2, i.MIN_USER_TOKEN_TYPE = 1, i.EOF = -1, i.DEFAULT_CHANNEL = 0, i.HIDDEN_CHANNEL = 1; const o = Math.round(Math.random() * Math.pow(2, 32)); function a(t2) { if (!t2) return 0; const e2 = typeof t2, n2 = "string" === e2 ? t2 : !("object" !== e2 || !t2.toString) && t2.toString(); if (!n2) return 0; let s2, i2; const r2 = 3 & n2.length, a2 = n2.length - r2; let l2 = o; const h2 = 3432918353, c2 = 461845907; let u2 = 0; for (; u2 < a2; ) i2 = 255 & n2.charCodeAt(u2) | (255 & n2.charCodeAt(++u2)) << 8 | (255 & n2.charCodeAt(++u2)) << 16 | (255 & n2.charCodeAt(++u2)) << 24, ++u2, i2 = (65535 & i2) * h2 + (((i2 >>> 16) * h2 & 65535) << 16) & 4294967295, i2 = i2 << 15 | i2 >>> 17, i2 = (65535 & i2) * c2 + (((i2 >>> 16) * c2 & 65535) << 16) & 4294967295, l2 ^= i2, l2 = l2 << 13 | l2 >>> 19, s2 = 5 * (65535 & l2) + ((5 * (l2 >>> 16) & 65535) << 16) & 4294967295, l2 = 27492 + (65535 & s2) + ((58964 + (s2 >>> 16) & 65535) << 16); switch (i2 = 0, r2) { case 3: i2 ^= (255 & n2.charCodeAt(u2 + 2)) << 16; case 2: i2 ^= (255 & n2.charCodeAt(u2 + 1)) << 8; case 1: i2 ^= 255 & n2.charCodeAt(u2), i2 = (65535 & i2) * h2 + (((i2 >>> 16) * h2 & 65535) << 16) & 4294967295, i2 = i2 << 15 | i2 >>> 17, i2 = (65535 & i2) * c2 + (((i2 >>> 16) * c2 & 65535) << 16) & 4294967295, l2 ^= i2; } return l2 ^= n2.length, l2 ^= l2 >>> 16, l2 = 2246822507 * (65535 & l2) + ((2246822507 * (l2 >>> 16) & 65535) << 16) & 4294967295, l2 ^= l2 >>> 13, l2 = 3266489909 * (65535 & l2) + ((3266489909 * (l2 >>> 16) & 65535) << 16) & 4294967295, l2 ^= l2 >>> 16, l2 >>> 0; } class l { constructor() { this.count = 0, this.hash = 0; } update() { for (let t2 = 0; t2 < arguments.length; t2++) { const e2 = arguments[t2]; if (null != e2) if (Array.isArray(e2)) this.update.apply(this, e2); else { let t3 = 0; switch (typeof e2) { case "undefined": case "function": continue; case "number": case "boolean": t3 = e2; break; case "string": t3 = a(e2); break; default: e2.updateHashCode ? e2.updateHashCode(this) : console.log("No updateHashCode for " + e2.toString()); continue; } t3 *= 3432918353, t3 = t3 << 15 | t3 >>> 17, t3 *= 461845907, this.count = this.count + 1; let n2 = this.hash ^ t3; n2 = n2 << 13 | n2 >>> 19, n2 = 5 * n2 + 3864292196, this.hash = n2; } } } finish() { let t2 = this.hash ^ 4 * this.count; return t2 ^= t2 >>> 16, t2 *= 2246822507, t2 ^= t2 >>> 13, t2 *= 3266489909, t2 ^= t2 >>> 16, t2; } static hashStuff() { const t2 = new l(); return t2.update.apply(t2, arguments), t2.finish(); } } function h(t2) { return t2 ? "string" == typeof t2 ? a(t2) : t2.hashCode() : -1; } function c(t2, e2) { return t2 && t2.equals ? t2.equals(e2) : t2 === e2; } function u(t2) { return null === t2 ? "null" : t2; } function d(t2) { return Array.isArray(t2) ? "[" + t2.map(u).join(", ") + "]" : "null"; } class g { constructor(t2, e2) { this.buckets = new Array(16), this.threshold = Math.floor(12), this.itemCount = 0, this.hashFunction = t2 || h, this.equalsFunction = e2 || c; } get(t2) { if (null == t2) return t2; const e2 = this._getBucket(t2); if (!e2) return null; for (const n2 of e2) if (this.equalsFunction(n2, t2)) return n2; return null; } add(t2) { return this.getOrAdd(t2) === t2; } getOrAdd(t2) { this._expand(); const e2 = this._getSlot(t2); let n2 = this.buckets[e2]; if (!n2) return n2 = [t2], this.buckets[e2] = n2, this.itemCount++, t2; for (const e3 of n2) if (this.equalsFunction(e3, t2)) return e3; return n2.push(t2), this.itemCount++, t2; } has(t2) { return null != this.get(t2); } values() { return this.buckets.filter((t2) => null != t2).flat(1); } toString() { return d(this.values()); } get length() { return this.itemCount; } _getSlot(t2) { return this.hashFunction(t2) & this.buckets.length - 1; } _getBucket(t2) { return this.buckets[this._getSlot(t2)]; } _expand() { if (this.itemCount <= this.threshold) return; const t2 = this.buckets, e2 = 2 * this.buckets.length; this.buckets = new Array(e2), this.threshold = Math.floor(0.75 * e2); for (const e3 of t2) if (e3) for (const t3 of e3) { const e4 = this._getSlot(t3); let n2 = this.buckets[e4]; n2 || (n2 = [], this.buckets[e4] = n2), n2.push(t3); } } } class p { hashCode() { const t2 = new l(); return this.updateHashCode(t2), t2.finish(); } evaluate(t2, e2) { } evalPrecedence(t2, e2) { return this; } static andContext(t2, e2) { if (null === t2 || t2 === p.NONE) return e2; if (null === e2 || e2 === p.NONE) return t2; const n2 = new f(t2, e2); return 1 === n2.opnds.length ? n2.opnds[0] : n2; } static orContext(t2, e2) { if (null === t2) return e2; if (null === e2) return t2; if (t2 === p.NONE || e2 === p.NONE) return p.NONE; const n2 = new x(t2, e2); return 1 === n2.opnds.length ? n2.opnds[0] : n2; } } class f extends p { constructor(t2, e2) { super(); const n2 = new g(); t2 instanceof f ? t2.opnds.map(function(t3) { n2.add(t3); }) : n2.add(t2), e2 instanceof f ? e2.opnds.map(function(t3) { n2.add(t3); }) : n2.add(e2); const s2 = T(n2); if (s2.length > 0) { let t3 = null; s2.map(function(e3) { (null === t3 || e3.precedence < t3.precedence) && (t3 = e3); }), n2.add(t3); } this.opnds = Array.from(n2.values()); } equals(t2) { return this === t2 || t2 instanceof f && r(this.opnds, t2.opnds); } updateHashCode(t2) { t2.update(this.opnds, "AND"); } evaluate(t2, e2) { for (let n2 = 0; n2 < this.opnds.length; n2++) if (!this.opnds[n2].evaluate(t2, e2)) return false; return true; } evalPrecedence(t2, e2) { let n2 = false; const s2 = []; for (let i3 = 0; i3 < this.opnds.length; i3++) { const r2 = this.opnds[i3], o2 = r2.evalPrecedence(t2, e2); if (n2 |= o2 !== r2, null === o2) return null; o2 !== p.NONE && s2.push(o2); } if (!n2) return this; if (0 === s2.length) return p.NONE; let i2 = null; return s2.map(function(t3) { i2 = null === i2 ? t3 : p.andContext(i2, t3); }), i2; } toString() { const t2 = this.opnds.map((t3) => t3.toString()); return (t2.length > 3 ? t2.slice(3) : t2).join("&&"); } } class x extends p { constructor(t2, e2) { super(); const n2 = new g(); t2 instanceof x ? t2.opnds.map(function(t3) { n2.add(t3); }) : n2.add(t2), e2 instanceof x ? e2.opnds.map(function(t3) { n2.add(t3); }) : n2.add(e2); const s2 = T(n2); if (s2.length > 0) { const t3 = s2.sort(function(t4, e4) { return t4.compareTo(e4); }), e3 = t3[t3.length - 1]; n2.add(e3); } this.opnds = Array.from(n2.values()); } equals(t2) { return this === t2 || t2 instanceof x && r(this.opnds, t2.opnds); } updateHashCode(t2) { t2.update(this.opnds, "OR"); } evaluate(t2, e2) { for (let n2 = 0; n2 < this.opnds.length; n2++) if (this.opnds[n2].evaluate(t2, e2)) return true; return false; } evalPrecedence(t2, e2) { let n2 = false; const s2 = []; for (let i2 = 0; i2 < this.opnds.length; i2++) { const r2 = this.opnds[i2], o2 = r2.evalPrecedence(t2, e2); if (n2 |= o2 !== r2, o2 === p.NONE) return p.NONE; null !== o2 && s2.push(o2); } if (!n2) return this; if (0 === s2.length) return null; return null; } toString() { const t2 = this.opnds.map((t3) => t3.toString()); return (t2.length > 3 ? t2.slice(3) : t2).join("||"); } } function T(t2) { const e2 = []; return t2.values().map(function(t3) { t3 instanceof p.PrecedencePredicate && e2.push(t3); }), e2; } function S(t2, e2) { if (null === t2) { const t3 = { state: null, alt: null, context: null, semanticContext: null }; return e2 && (t3.reachesIntoOuterContext = 0), t3; } { const n2 = {}; return n2.state = t2.state || null, n2.alt = void 0 === t2.alt ? null : t2.alt, n2.context = t2.context || null, n2.semanticContext = t2.semanticContext || null, e2 && (n2.reachesIntoOuterContext = t2.reachesIntoOuterContext || 0, n2.precedenceFilterSuppressed = t2.precedenceFilterSuppressed || false), n2; } } class m { constructor(t2, e2) { this.checkContext(t2, e2), t2 = S(t2), e2 = S(e2, true), this.state = null !== t2.state ? t2.state : e2.state, this.alt = null !== t2.alt ? t2.alt : e2.alt, this.context = null !== t2.context ? t2.context : e2.context, this.semanticContext = null !== t2.semanticContext ? t2.semanticContext : null !== e2.semanticContext ? e2.semanticContext : p.NONE, this.reachesIntoOuterContext = e2.reachesIntoOuterContext, this.precedenceFilterSuppressed = e2.precedenceFilterSuppressed; } checkContext(t2, e2) { null !== t2.context && void 0 !== t2.context || null !== e2 && null !== e2.context && void 0 !== e2.context || (this.context = null); } hashCode() { const t2 = new l(); return this.updateHashCode(t2), t2.finish(); } updateHashCode(t2) { t2.update(this.state.stateNumber, this.alt, this.context, this.semanticContext); } equals(t2) { return this === t2 || t2 instanceof m && this.state.stateNumber === t2.state.stateNumber && this.alt === t2.alt && (null === this.context ? null === t2.context : this.context.equals(t2.context)) && this.semanticContext.equals(t2.semanticContext) && this.precedenceFilterSuppressed === t2.precedenceFilterSuppressed; } hashCodeForConfigSet() { const t2 = new l(); return t2.update(this.state.stateNumber, this.alt, this.semanticContext), t2.finish(); } equalsForConfigSet(t2) { return this === t2 || t2 instanceof m && this.state.stateNumber === t2.state.stateNumber && this.alt === t2.alt && this.semanticContext.equals(t2.semanticContext); } toString() { return "(" + this.state + "," + this.alt + (null !== this.context ? ",[" + this.context.toString() + "]" : "") + (this.semanticContext !== p.NONE ? "," + this.semanticContext.toString() : "") + (this.reachesIntoOuterContext > 0 ? ",up=" + this.reachesIntoOuterContext : "") + ")"; } } class E { constructor(t2, e2) { this.start = t2, this.stop = e2; } clone() { return new E(this.start, this.stop); } contains(t2) { return t2 >= this.start && t2 < this.stop; } toString() { return this.start === this.stop - 1 ? this.start.toString() : this.start.toString() + ".." + (this.stop - 1).toString(); } get length() { return this.stop - this.start; } } E.INVALID_INTERVAL = new E(-1, -2); class _ { constructor() { this.intervals = null, this.readOnly = false; } first(t2) { return null === this.intervals || 0 === this.intervals.length ? i.INVALID_TYPE : this.intervals[0].start; } addOne(t2) { this.addInterval(new E(t2, t2 + 1)); } addRange(t2, e2) { this.addInterval(new E(t2, e2 + 1)); } addInterval(t2) { if (null === this.intervals) this.intervals = [], this.intervals.push(t2.clone()); else { for (let e2 = 0; e2 < this.intervals.length; e2++) { const n2 = this.intervals[e2]; if (t2.stop < n2.start) return void this.intervals.splice(e2, 0, t2); if (t2.stop === n2.start) return void (this.intervals[e2] = new E(t2.start, n2.stop)); if (t2.start <= n2.stop) return this.intervals[e2] = new E(Math.min(n2.start, t2.start), Math.max(n2.stop, t2.stop)), void this.reduce(e2); } this.intervals.push(t2.clone()); } } addSet(t2) { return null !== t2.intervals && t2.intervals.forEach((t3) => this.addInterval(t3), this), this; } reduce(t2) { if (t2 < this.intervals.length - 1) { const e2 = this.intervals[t2], n2 = this.intervals[t2 + 1]; e2.stop >= n2.stop ? (this.intervals.splice(t2 + 1, 1), this.reduce(t2)) : e2.stop >= n2.start && (this.intervals[t2] = new E(e2.start, n2.stop), this.intervals.splice(t2 + 1, 1)); } } complement(t2, e2) { const n2 = new _(); return n2.addInterval(new E(t2, e2 + 1)), null !== this.intervals && this.intervals.forEach((t3) => n2.removeRange(t3)), n2; } contains(t2) { if (null === this.intervals) return false; for (let e2 = 0; e2 < this.intervals.length; e2++) if (this.intervals[e2].contains(t2)) return true; return false; } removeRange(t2) { if (t2.start === t2.stop - 1) this.removeOne(t2.start); else if (null !== this.intervals) { let e2 = 0; for (let n2 = 0; n2 < this.intervals.length; n2++) { const n3 = this.intervals[e2]; if (t2.stop <= n3.start) return; if (t2.start > n3.start && t2.stop < n3.stop) { this.intervals[e2] = new E(n3.start, t2.start); const s2 = new E(t2.stop, n3.stop); return void this.intervals.splice(e2, 0, s2); } t2.start <= n3.start && t2.stop >= n3.stop ? (this.intervals.splice(e2, 1), e2 -= 1) : t2.start < n3.stop ? this.intervals[e2] = new E(n3.start, t2.start) : t2.stop < n3.stop && (this.intervals[e2] = new E(t2.stop, n3.stop)), e2 += 1; } } } removeOne(t2) { if (null !== this.intervals) for (let e2 = 0; e2 < this.intervals.length; e2++) { const n2 = this.intervals[e2]; if (t2 < n2.start) return; if (t2 === n2.start && t2 === n2.stop - 1) return void this.intervals.splice(e2, 1); if (t2 === n2.start) return void (this.intervals[e2] = new E(n2.start + 1, n2.stop)); if (t2 === n2.stop - 1) return void (this.intervals[e2] = new E(n2.start, n2.stop - 1)); if (t2 < n2.stop - 1) { const s2 = new E(n2.start, t2); return n2.start = t2 + 1, void this.intervals.splice(e2, 0, s2); } } } toString(t2, e2, n2) { return t2 = t2 || null, e2 = e2 || null, n2 = n2 || false, null === this.intervals ? "{}" : null !== t2 || null !== e2 ? this.toTokenString(t2, e2) : n2 ? this.toCharString() : this.toIndexString(); } toCharString() { const t2 = []; for (let e2 = 0; e2 < this.intervals.length; e2++) { const n2 = this.intervals[e2]; n2.stop === n2.start + 1 ? n2.start === i.EOF ? t2.push("<EOF>") : t2.push("'" + String.fromCharCode(n2.start) + "'") : t2.push("'" + String.fromCharCode(n2.start) + "'..'" + String.fromCharCode(n2.stop - 1) + "'"); } return t2.length > 1 ? "{" + t2.join(", ") + "}" : t2[0]; } toIndexString() { const t2 = []; for (let e2 = 0; e2 < this.intervals.length; e2++) { const n2 = this.intervals[e2]; n2.stop === n2.start + 1 ? n2.start === i.EOF ? t2.push("<EOF>") : t2.push(n2.start.toString()) : t2.push(n2.start.toString() + ".." + (n2.stop - 1).toString()); } return t2.length > 1 ? "{" + t2.join(", ") + "}" : t2[0]; } toTokenString(t2, e2) { const n2 = []; for (let s2 = 0; s2 < this.intervals.length; s2++) { const i2 = this.intervals[s2]; for (let s3 = i2.start; s3 < i2.stop; s3++) n2.push(this.elementName(t2, e2, s3)); } return n2.length > 1 ? "{" + n2.join(", ") + "}" : n2[0]; } elementName(t2, e2, n2) { return n2 === i.EOF ? "<EOF>" : n2 === i.EPSILON ? "<EPSILON>" : t2[n2] || e2[n2]; } get length() { return this.intervals.map((t2) => t2.length).reduce((t2, e2) => t2 + e2); } } class C { constructor() { this.atn = null, this.stateNumber = C.INVALID_STATE_NUMBER, this.stateType = null, this.ruleIndex = 0, this.epsilonOnlyTransitions = false, this.transitions = [], this.nextTokenWithinRule = null; } toString() { return this.stateNumber; } equals(t2) { return t2 instanceof C && this.stateNumber === t2.stateNumber; } isNonGreedyExitState() { return false; } addTransition(t2, e2) { void 0 === e2 && (e2 = -1), 0 === this.transitions.length ? this.epsilonOnlyTransitions = t2.isEpsilon : this.epsilonOnlyTransitions !== t2.isEpsilon && (this.epsilonOnlyTransitions = false), -1 === e2 ? this.transitions.push(t2) : this.transitions.splice(e2, 1, t2); } } C.INVALID_TYPE = 0, C.BASIC = 1, C.RULE_START = 2, C.BLOCK_START = 3, C.PLUS_BLOCK_START = 4, C.STAR_BLOCK_START = 5, C.TOKEN_START = 6, C.RULE_STOP = 7, C.BLOCK_END = 8, C.STAR_LOOP_BACK = 9, C.STAR_LOOP_ENTRY = 10, C.PLUS_LOOP_BACK = 11, C.LOOP_END = 12, C.serializationNames = ["INVALID", "BASIC", "RULE_START", "BLOCK_START", "PLUS_BLOCK_START", "STAR_BLOCK_START", "TOKEN_START", "RULE_STOP", "BLOCK_END", "STAR_LOOP_BACK", "STAR_LOOP_ENTRY", "PLUS_LOOP_BACK", "LOOP_END"], C.INVALID_STATE_NUMBER = -1; class A extends C { constructor() { return super(), this.stateType = C.RULE_STOP, this; } } class N { constructor(t2) { if (null == t2) throw "target cannot be null."; this.target = t2, this.isEpsilon = false, this.label = null; } } N.EPSILON = 1, N.RANGE = 2, N.RULE = 3, N.PREDICATE = 4, N.ATOM = 5, N.ACTION = 6, N.SET = 7, N.NOT_SET = 8, N.WILDCARD = 9, N.PRECEDENCE = 10, N.serializationNames = ["INVALID", "EPSILON", "RANGE", "RULE", "PREDICATE", "ATOM", "ACTION", "SET", "NOT_SET", "WILDCARD", "PRECEDENCE"], N.serializationTypes = { EpsilonTransition: N.EPSILON, RangeTransition: N.RANGE, RuleTransition: N.RULE, PredicateTransition: N.PREDICATE, AtomTransition: N.ATOM, ActionTransition: N.ACTION, SetTransition: N.SET, NotSetTransition: N.NOT_SET, WildcardTransition: N.WILDCARD, PrecedencePredicateTransition: N.PRECEDENCE }; class k extends N { constructor(t2, e2, n2, s2) { super(t2), this.ruleIndex = e2, this.precedence = n2, this.followState = s2, this.serializationType = N.RULE, this.isEpsilon = true; } matches(t2, e2, n2) { return false; } } class I extends N { constructor(t2, e2) { super(t2), this.serializationType = N.SET, null != e2 ? this.label = e2 : (this.label = new _(), this.label.addOne(i.INVALID_TYPE)); } matches(t2, e2, n2) { return this.label.contains(t2); } toString() { return this.label.toString(); } } class y extends I { constructor(t2, e2) { super(t2, e2), this.serializationType = N.NOT_SET; } matches(t2, e2, n2) { return t2 >= e2 && t2 <= n2 && !super.matches(t2, e2, n2); } toString() { return "~" + super.toString(); } } class L extends N { constructor(t2) { super(t2), this.serializationType = N.WILDCARD; } matches(t2, e2, n2) { return t2 >= e2 && t2 <= n2; } toString() { return "."; } } class O extends N { constructor(t2) { super(t2); } } class R { } class w extends R { } class v extends w { } class P extends v { get ruleContext() { throw new Error("missing interface implementation"); } } class b extends v { } class D extends b { } const F = { toStringTree: function(t2, e2, n2) { e2 = e2 || null, null !== (n2 = n2 || null) && (e2 = n2.ruleNames); let s2 = F.getNodeText(t2, e2); s2 = function(t3) { return t3 = t3.replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); }(s2); const i2 = t2.getChildCount(); if (0 === i2) return s2; let r2 = "(" + s2 + " "; i2 > 0 && (s2 = F.toStringTree(t2.getChild(0), e2), r2 = r2.concat(s2)); for (let n3 = 1; n3 < i2; n3++) s2 = F.toStringTree(t2.getChild(n3), e2), r2 = r2.concat(" " + s2); return r2 = r2.concat(")"), r2; }, getNodeText: function(t2, e2, n2) { if (e2 = e2 || null, null !== (n2 = n2 || null) && (e2 = n2.ruleNames), null !== e2) { if (t2 instanceof P) { const n3 = t2.ruleContext.getAltNumber(); return 0 != n3 ? e2[t2.ruleIndex] + ":" + n3 : e2[t2.ruleIndex]; } if (t2 instanceof D) return t2.toString(); if (t2 instanceof b && null !== t2.symbol) return t2.symbol.text; } const s2 = t2.getPayload(); return s2 instanceof i ? s2.text : t2.getPayload().toString(); }, getChildren: function(t2) { const e2 = []; for (let n2 = 0; n2 < t2.getChildCount(); n2++) e2.push(t2.getChild(n2)); return e2; }, getAncestors: function(t2) { let e2 = []; for (t2 = t2.getParent(); null !== t2; ) e2 = [t2].concat(e2), t2 = t2.getParent(); return e2; }, findAllTokenNodes: function(t2, e2) { return F.findAllNodes(t2, e2, true); }, findAllRuleNodes: function(t2, e2) { return F.findAllNodes(t2, e2, false); }, findAllNodes: function(t2, e2, n2) { const s2 = []; return F._findAllNodes(t2, e2, n2, s2), s2; }, _findAllNodes: function(t2, e2, n2, s2) { n2 && t2 instanceof b ? t2.symbol.type === e2 && s2.push(t2) : !n2 && t2 instanceof P && t2.ruleIndex === e2 && s2.push(t2); for (let i2 = 0; i2 < t2.getChildCount(); i2++) F._findAllNodes(t2.getChild(i2), e2, n2, s2); }, descendants: function(t2) { let e2 = [t2]; for (let n2 = 0; n2 < t2.getChildCount(); n2++) e2 = e2.concat(F.descendants(t2.getChild(n2))); return e2; } }, M = F; class U extends P { constructor(t2, e2) { super(), this.parentCtx = t2 || null, this.invokingState = e2 || -1; } depth() { let t2 = 0, e2 = this; for (; null !== e2; ) e2 = e2.parentCtx, t2 += 1; return t2; } isEmpty() { return -1 === this.invokingState; } getSourceInterval() { return E.INVALID_INTERVAL; } get ruleContext() { return this; } getPayload() { return this; } getText() { return 0 === this.getChildCount() ? "" : this.children.map(function(t2) { return t2.getText(); }).join(""); } getAltNumber() { return 0; } setAltNumber(t2) { } getChild(t2) { return null; } getChildCount() { return 0; } accept(t2) { return t2.visitChildren(this); } toStringTree(t2, e2) { return M.toStringTree(this, t2, e2); } toString(t2, e2) { t2 = t2 || null, e2 = e2 || null; let n2 = this, s2 = "["; for (; null !== n2 && n2 !== e2; ) { if (null === t2) n2.isEmpty() || (s2 += n2.invokingState); else { const e3 = n2.ruleIndex; s2 += e3 >= 0 && e3 < t2.length ? t2[e3] : "" + e3; } null === n2.parentCtx || null === t2 && n2.parentCtx.isEmpty() || (s2 += " "), n2 = n2.parentCtx; } return s2 += "]", s2; } } class B { constructor(t2) { this.cachedHashCode = t2; } isEmpty() { return this === B.EMPTY; } hasEmptyPath() { return this.getReturnState(this.length - 1) === B.EMPTY_RETURN_STATE; } hashCode() { return this.cachedHashCode; } updateHashCode(t2) { t2.update(this.cachedHashCode); } } B.EMPTY = null, B.EMPTY_RETURN_STATE = 2147483647, B.globalNodeCount = 1, B.id = B.globalNodeCount, B.trace_atn_sim = false; class z extends B { constructor(t2, e2) { const n2 = new l(); return n2.update(t2, e2), super(n2.finish()), this.parents = t2, this.returnStates = e2, this; } isEmpty() { return this.returnStates[0] === B.EMPTY_RETURN_STATE; } getParent(t2) { return this.parents[t2]; } getReturnState(t2) { return this.returnStates[t2]; } equals(t2) { return this === t2 || t2 instanceof z && this.hashCode() === t2.hashCode() && r(this.returnStates, t2.returnStates) && r(this.parents, t2.parents); } toString() { if (this.isEmpty()) return "[]"; { let t2 = "["; for (let e2 = 0; e2 < this.returnStates.length; e2++) e2 > 0 && (t2 += ", "), this.returnStates[e2] !== B.EMPTY_RETURN_STATE ? (t2 += this.returnStates[e2], null !== this.parents[e2] ? t2 = t2 + " " + this.parents[e2] : t2 += "null") : t2 += "$"; return t2 + "]"; } } get length() { return this.returnStates.length; } } class V extends B { constructor(t2, e2) { let n2 = 0; const s2 = new l(); null !== t2 ? s2.update(t2, e2) : s2.update(1), n2 = s2.finish(), super(n2), this.parentCtx = t2, this.returnState = e2; } getParent(t2) { return this.parentCtx; } getReturnState(t2) { return this.returnState; } equals(t2) { return this === t2 || t2 instanceof V && this.hashCode() === t2.hashCode() && this.returnState === t2.returnState && (null == this.parentCtx ? null == t2.parentCtx : this.parentCtx.equals(t2.parentCtx)); } toString() { const t2 = null === this.parentCtx ? "" : this.parentCtx.toString(); return 0 === t2.length ? this.returnState === B.EMPTY_RETURN_STATE ? "$" : "" + this.returnState : this.returnState + " " + t2; } get length() { return 1; } static create(t2, e2) { return e2 === B.EMPTY_RETURN_STATE && null === t2 ? B.EMPTY : new V(t2, e2); } } class q extends V { constructor() { super(null, B.EMPTY_RETURN_STATE); } isEmpty() { return true; } getParent(t2) { return null; } getReturnState(t2) { return this.returnState; } equals(t2) { return this === t2; } toString() { return "$"; } } B.EMPTY = new q(); class H { constructor(t2, e2) { this.buckets = new Array(16), this.threshold = Math.floor(12), this.itemCount = 0, this.hashFunction = t2 || h, this.equalsFunction = e2 || c; } set(t2, e2) { this._expand(); const n2 = this._getSlot(t2); let s2 = this.buckets[n2]; if (!s2) return s2 = [[t2, e2]], this.buckets[n2] = s2, this.itemCount++, e2; const i2 = s2.find((e3) => this.equalsFunction(e3[0], t2), this); if (i2) { const t3 = i2[1]; return i2[1] = e2, t3; } return s2.push([t2, e2]), this.itemCount++, e2; } containsKey(t2) { const e2 = this._getBucket(t2); return !!e2 && !!e2.find((e3) => this.equalsFunction(e3[0], t2), this); } get(t2) { const e2 = this._getBucket(t2); if (!e2) return null; const n2 = e2.find((e3) => this.equalsFunction(e3[0], t2), this); return n2 ? n2[1] : null; } entries() { return this.buckets.filter((t2) => null != t2).flat(1); } getKeys() { return this.entries().map((t2) => t2[0]); } getValues() { return this.entries().map((t2) => t2[1]); } toString() { return "[" + this.entries().map((t2) => "{" + t2[0] + ":" + t2[1] + "}").join(", ") + "]"; } get length() { return this.itemCount; } _getSlot(t2) { return this.hashFunction(t2) & this.buckets.length - 1; } _getBucket(t2) { return this.buckets[this._getSlot(t2)]; } _expand() { if (this.itemCount <= this.threshold) return; const t2 = this.buckets, e2 = 2 * this.buckets.length; this.buckets = new Array(e2), this.threshold = Math.floor(0.75 * e2); for (const e3 of t2) if (e3) for (const t3 of e3) { const e4 = this._getSlot(t3[0]); let n2 = this.buckets[e4]; n2 || (n2 = [], this.buckets[e4] = n2), n2.push(t3); } } } function K(t2, e2) { if (null == e2 && (e2 = U.EMPTY), null === e2.parentCtx || e2 === U.EMPTY) return B.EMPTY; const n2 = K(t2, e2.parentCtx), s2 = t2.states[e2.invokingState].transitions[0]; return V.create(n2, s2.followState.stateNumber); } function Y(t2, e2, n2) { if (t2.isEmpty()) return t2; let s2 = n2.get(t2) || null; if (null !== s2) return s2; if (s2 = e2.get(t2), null !== s2) return n2.set(t2, s2), s2; let i2 = false, r2 = []; for (let s3 = 0; s3 < r2.length; s3++) { const o3 = Y(t2.getParent(s3), e2, n2); if (i2 || o3 !== t2.getParent(s3)) { if (!i2) { r2 = []; for (let e3 = 0; e3 < t2.length; e3++) r2[e3] = t2.getParent(e3); i2 = true; } r2[s3] = o3; } } if (!i2) return e2.add(t2), n2.set(t2, t2), t2; let o2 = null; return o2 = 0 === r2.length ? B.EMPTY : 1 === r2.length ? V.create(r2[0], t2.getReturnState(0)) : new z(r2, t2.returnStates), e2.add(o2), n2.set(o2, o2), n2.set(t2, o2), o2; } function G(t2, e2, n2, s2) { if (t2 === e2) return t2; if (t2 instanceof V && e2 instanceof V) return function(t3, e3, n3, s3) { if (null !== s3) { let n4 = s3.get(t3, e3); if (null !== n4) return n4; if (n4 = s3.get(e3, t3), null !== n4) return n4; } const i2 = function(t4, e4, n4) { if (n4) { if (t4 === B.EMPTY) return B.EMPTY; if (e4 === B.EMPTY) return B.EMPTY; } else { if (t4 === B.EMPTY && e4 === B.EMPTY) return B.EMPTY; if (t4 === B.EMPTY) { const t5 = [e4.returnState, B.EMPTY_RETURN_STATE], n5 = [e4.parentCtx, null]; return new z(n5, t5); } if (e4 === B.EMPTY) { const e5 = [t4.returnState, B.EMPTY_RETURN_STATE], n5 = [t4.parentCtx, null]; return new z(n5, e5); } } return null; }(t3, e3, n3); if (null !== i2) return null !== s3 && s3.set(t3, e3, i2), i2; if (t3.returnState === e3.returnState) { const i3 = G(t3.parentCtx, e3.parentCtx, n3, s3); if (i3 === t3.parentCtx) return t3; if (i3 === e3.parentCtx) return e3; const r2 = V.create(i3, t3.returnState); return null !== s3 && s3.set(t3, e3, r2), r2; } { let n4 = null; if ((t3 === e3 || null !== t3.parentCtx && t3.parentCtx === e3.parentCtx) && (n4 = t3.parentCtx), null !== n4) { const i4 = [t3.returnState, e3.returnState]; t3.returnState > e3.returnState && (i4[0] = e3.returnState, i4[1] = t3.returnState); const r3 = new z([n4, n4], i4); return null !== s3 && s3.set(t3, e3, r3), r3; } const i3 = [t3.returnState, e3.returnState]; let r2 = [t3.parentCtx, e3.parentCtx]; t3.returnState > e3.returnState && (i3[0] = e3.returnState, i3[1] = t3.returnState, r2 = [e3.parentCtx, t3.parentCtx]); const o2 = new z(r2, i3); return null !== s3 && s3.set(t3, e3, o2), o2; } }(t2, e2, n2, s2); if (n2) { if (t2 instanceof q) return t2; if (e2 instanceof q) return e2; } return t2 instanceof V && (t2 = new z([t2.getParent()], [t2.returnState])), e2 instanceof V && (e2 = new z([e2.getParent()], [e2.returnState])), function(t3, e3, n3, s3) { if (null !== s3) { let n4 = s3.get(t3, e3); if (null !== n4) return B.trace_atn_sim && console.log("mergeArrays a=" + t3 + ",b=" + e3 + " -> previous"), n4; if (n4 = s3.get(e3, t3), null !== n4) return B.trace_atn_sim && console.log("mergeArrays a=" + t3 + ",b=" + e3 + " -> previous"), n4; } let i2 = 0, r2 = 0, o2 = 0, a2 = new Array(t3.returnStates.length + e3.returnStates.length).fill(0), l2 = new Array(t3.returnStates.length + e3.returnStates.length).fill(null); for (; i2 < t3.returnStates.length && r2 < e3.returnStates.length; ) { const h3 = t3.parents[i2], c2 = e3.parents[r2]; if (t3.returnStates[i2] === e3.returnStates[r2]) { const e4 = t3.returnStates[i2]; e4 === B.EMPTY_RETURN_STATE && null === h3 && null === c2 || null !== h3 && null !== c2 && h3 === c2 ? (l2[o2] = h3, a2[o2] = e4) : (l2[o2] = G(h3, c2, n3, s3), a2[o2] = e4), i2 += 1, r2 += 1; } else t3.returnStates[i2] < e3.returnStates[r2] ? (l2[o2] = h3, a2[o2] = t3.returnStates[i2], i2 += 1) : (l2[o2] = c2, a2[o2] = e3.returnStates[r2], r2 += 1); o2 += 1; } if (i2 < t3.returnStates.length) for (let e4 = i2; e4 < t3.returnStates.length; e4++) l2[o2] = t3.parents[e4], a2[o2] = t3.returnStates[e4], o2 += 1; else for (let t4 = r2; t4 < e3.returnStates.length; t4++) l2[o2] = e3.parents[t4], a2[o2] = e3.returnStates[t4], o2 += 1; if (o2 < l2.length) { if (1 === o2) { const n4 = V.create(l2[0], a2[0]); return null !== s3 && s3.set(t3, e3, n4), n4; } l2 = l2.slice(0, o2), a2 = a2.slice(0, o2); } const h2 = new z(l2, a2); return h2.equals(t3) ? (null !== s3 && s3.set(t3, e3, t3), B.trace_atn_sim && console.log("mergeArrays a=" + t3 + ",b=" + e3 + " -> a"), t3) : h2.equals(e3) ? (null !== s3 && s3.set(t3, e3, e3), B.trace_atn_sim && console.log("mergeArrays a=" + t3 + ",b=" + e3 + " -> b"), e3) : (function(t4) { const e4 = new H(); for (let n4 = 0; n4 < t4.length; n4++) { const s4 = t4[n4]; e4.containsKey(s4) || e4.set(s4, s4); } for (let n4 = 0; n4 < t4.length; n4++) t4[n4] = e4.get(t4[n4]); }(l2), null !== s3 && s3.set(t3, e3, h2), B.trace_atn_sim && console.log("mergeArrays a=" + t3 + ",b=" + e3 + " -> " + h2), h2); }(t2, e2, n2, s2); } class W { constructor() { this.data = new Uint32Array(1); } set(t2) { W._checkIndex(t2), this._resize(t2), this.data[t2 >>> 5] |= 1 << t2 % 32; } get(t2) { W._checkIndex(t2); const e2 = t2 >>> 5; return !(e2 >= this.data.length || !(this.data[e2] & 1 << t2 % 32)); } clear(t2) { W._checkIndex(t2); const e2 = t2 >>> 5; e2 < this.data.length && (this.data[e2] &= ~(1 << t2)); } or(t2) { const e2 = Math.min(this.data.length, t2.data.length); for (let n2 = 0; n2 < e2; ++n2) this.data[n2] |= t2.data[n2]; if (this.data.length < t2.data.length) { this._resize((t2.data.length << 5) - 1); const n2 = t2.data.length; for (let s2 = e2; s2 < n2; ++s2) this.data[s2] = t2.data[s2]; } } values() { const t2 = new Array(this.length); let e2 = 0; const n2 = this.data.length; for (let s2 = 0; s2 < n2; ++s2) { let n3 = this.data[s2]; for (; 0 !== n3; ) { const i2 = n3 & -n3; t2[e2++] = (s2 << 5) + W._bitCount(i2 - 1), n3 ^= i2; } } return t2; } minValue() { for (let t2 = 0; t2 < this.data.length; ++t2) { let e2 = this.data[t2]; if (0 !== e2) { let n2 = 0; for (; !(1 & e2); ) n2++, e2 >>= 1; return n2 + 32 * t2; } } return 0; } hashCode() { return l.hashStuff(this.values()); } equals(t2) { return t2 instanceof W && r(this.data, t2.data); } toString() { return "{" + this.values().join(", ") + "}"; } get length() { return this.data.map((t2) => W._bitCount(t2)).reduce((t2, e2) => t2 + e2, 0); } _resize(t2) { const e2 = t2 + 32 >>> 5; if (e2 <= this.data.length) return; const n2 = new Uint32Array(e2); n2.set(this.data), n2.fill(0, this.data.length), this.data = n2; } static _checkIndex(t2) { if (t2 < 0) throw new RangeError("index cannot be negative"); } static _bitCount(t2) { return t2 = (t2 = (858993459 & (t2 -= t2 >> 1 & 1431655765)) + (t2 >> 2 & 858993459)) + (t2 >> 4) & 252645135, t2 += t2 >> 8, 0 + (t2 += t2 >> 16) & 63; } } class j { constructor(t2) { this.atn = t2; } getDecisionLookahead(t2) { if (null === t2) return null; const e2 = t2.transitions.length, n2 = []; for (let s2 = 0; s2 < e2; s2++) { n2[s2] = new _(); const e3 = new g(), i2 = false; this._LOOK(t2.transition(s2).target, null, B.EMPTY, n2[s2], e3, new W(), i2, false), (0 === n2[s2].length || n2[s2].contains(j.HIT_PRED)) && (n2[s2] = null); } return n2; } LOOK(t2, e2, n2) { const s2 = new _(), i2 = null !== (n2 = n2 || null) ? K(t2.atn, n2) : null; return this._LOOK(t2, e2, i2, s2, new g(), new W(), true, true), s2; } _LOOK(t2, e2, n2, s2, r2, o2, a2, l2) { const h2 = new m({ state: t2, alt: 0, context: n2 }, null); if (!r2.has(h2)) { if (r2.add(h2), t2 === e2) { if (null === n2) return void s2.addOne(i.EPSILON); if (n2.isEmpty() && l2) return void s2.addOne(i.EOF); } if (t2 instanceof A) { if (null === n2) return void s2.addOne(i.EPSILON); if (n2.isEmpty() && l2) return void s2.addOne(i.EOF); if (n2 !== B.EMPTY) { const i2 = o2.get(t2.ruleIndex); try { o2.clear(t2.ruleIndex); for (let t3 = 0; t3 < n2.length; t3++) { const i3 = this.atn.states[n2.getReturnState(t3)]; this._LOOK(i3, e2, n2.getParent(t3), s2, r2, o2, a2, l2); } } finally { i2 && o2.set(t2.ruleIndex); } return; } } for (let h3 = 0; h3 < t2.transitions.length; h3++) { const c2 = t2.transitions[h3]; if (c2.constructor === k) { if (o2.get(c2.target.ruleIndex)) continue; const t3 = V.create(n2, c2.followState.stateNumber); try { o2.set(c2.target.ruleIndex), this._LOOK(c2.target, e2, t3, s2, r2, o2, a2, l2); } finally { o2.clear(c2.target.ruleIndex); } } else if (c2 instanceof O) a2 ? this._LOOK(c2.target, e2, n2, s2, r2, o2, a2, l2) : s2.addOne(j.HIT_PRED); else if (c2.isEpsilon) this._LOOK(c2.target, e2, n2, s2, r2, o2, a2, l2); else if (c2.constructor === L) s2.addRange(i.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType); else { let t3 = c2.label; null !== t3 && (c2 instanceof y && (t3 = t3.complement(i.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType)), s2.addSet(t3)); } } } } } j.HIT_PRED = i.INVALID_TYPE; class $ { constructor(t2, e2) { this.grammarType = t2, this.maxTokenType = e2, this.states = [], this.decisionToState = [], this.ruleToStartState = [], this.ruleToStopState = null, this.modeNameToStartState = {}, this.ruleToTokenType = null, this.lexerActions = null, this.modeToStartState = []; } nextTokensInContext(t2, e2) { return new j(this).LOOK(t2, null, e2); } nextTokensNoContext(t2) { return null !== t2.nextTokenWithinRule || (t2.nextTokenWithinRule = this.nextTokensInContext(t2, null), t2.nextTokenWithinRule.readOnly = true), t2.nextTokenWithinRule; } nextTokens(t2, e2) { return void 0 === e2 ? this.nextTokensNoContext(t2) : this.nextTokensInContext(t2, e2); } addState(t2) { null !== t2 && (t2.atn = this, t2.stateNumber = this.states.length), this.states.push(t2); } removeState(t2) { this.states[t2.stateNumber] = null; } defineDecisionState(t2) { return this.decisionToState.push(t2), t2.decision = this.decisionToState.length - 1, t2.decision; } getDecisionState(t2) { return 0 === this.decisionToState.length ? null : this.decisionToState[t2]; } getExpectedTokens(t2, e2) { if (t2 < 0 || t2 >= this.states.length) throw "Invalid state number."; const n2 = this.states[t2]; let s2 = this.nextTokens(n2); if (!s2.contains(i.EPSILON)) return s2; const r2 = new _(); for (r2.addSet(s2), r2.removeOne(i.EPSILON); null !== e2 && e2.invokingState >= 0 && s2.contains(i.EPSILON); ) { const t3 = this.states[e2.invokingState].transitions[0]; s2 = this.nextTokens(t3.followState), r2.addSet(s2), r2.removeOne(i.EPSILON), e2 = e2.parentCtx; } return s2.contains(i.EPSILON) && r2.addOne(i.EOF), r2; } } $.INVALID_ALT_NUMBER = 0; class X extends C { constructor() { super(), this.stateType = C.BASIC; } } class J extends C { constructor() { return super(), this.decision = -1, this.nonGreedy = false, this; } } class Z extends J { constructor() { return super(), this.endState = null, this; } } class Q extends C { constructor() { return super(), this.stateType = C.BLOCK_END, this.startState = null, this; } } class tt extends C { constructor() { return super(), this.stateType = C.LOOP_END, this.loopBackState = null, this; } } class et extends C { constructor() { return super(), this.stateType = C.RULE_START, this.stopState = null, this.isPrecedenceRule = false, this; } } class nt extends J { constructor() { return super(), this.stateType = C.TOKEN_START, this; } } class st extends J { constructor() { return super(), this.stateType = C.PLUS_LOOP_BACK, this; } } class it extends C { constructor() { return super(), this.stateType = C.STAR_LOOP_BACK, this; } } class rt extends J { constructor() { return super(), this.stateType = C.STAR_LOOP_ENTRY, this.loopBackState = null, this.isPrecedenceDecision = null, this; } } class ot extends Z { constructor() { return super(), this.stateType = C.PLUS_BLOCK_START, this.loopBackState = null, this; } } class at extends Z { constructor() { return super(), this.stateType = C.STAR_BLOCK_START, this; } } class lt extends Z { constructor() { return super(), this.stateType = C.BLOCK_START, this; } } class ht extends N { constructor(t2, e2) { super(t2), this.label_ = e2, this.label = this.makeLabel(), this.serializationType = N.ATOM; } makeLabel() { const t2 = new _(); return t2.addOne(this.label_), t2; } matches(t2, e2, n2) { return this.label_ === t2; } toString() { return this.label_; } } class ct extends N { constructor(t2, e2, n2) { super(t2), this.serializationType = N.RANGE, this.start = e2, this.stop = n2, this.label = this.makeLabel(); } makeLabel() { const t2 = new _(); return t2.addRange(this.start, this.stop), t2; } matches(t2, e2, n2) { return t2 >= this.start && t2 <= this.stop; } toString() { return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'"; } } class ut extends N { constructor(t2, e2, n2, s2) { super(t2), this.serializationType = N.ACTION, this.ruleIndex = e2, this.actionIndex = void 0 === n2 ? -1 : n2, this.isCtxDependent = void 0 !== s2 && s2, this.isEpsilon = true; } matches(t2, e2, n2) { return false; } toString() { return "action_" + this.ruleIndex + ":" + this.actionIndex; } } class dt extends N { constructor(t2, e2) { super(t2), this.serializationType = N.EPSILON, this.isEpsilon = true, this.outermostPrecedenceReturn = e2; } matches(t2, e2, n2) { return false; } toString() { return "epsilon"; } } class gt extends p { constructor(t2, e2, n2) { super(), this.ruleIndex = void 0 === t2 ? -1 : t2, this.predIndex = void 0 === e2 ? -1 : e2, this.isCtxDependent = void 0 !== n2 && n2; } evaluate(t2, e2) { const n2 = this.isCtxDependent ? e2 : null; return t2.sempred(n2, this.ruleIndex, this.predIndex); } updateHashCode(t2) { t2.update(this.ruleIndex, this.predIndex, this.isCtxDependent); } equals(t2) { return this === t2 || t2 instanceof gt && this.ruleIndex === t2.ruleIndex && this.predIndex === t2.predIndex && this.isCtxDependent === t2.isCtxDependent; } toString() { return "{" + this.ruleIndex + ":" + this.predIndex + "}?"; } } p.NONE = new gt(); class pt extends O { constructor(t2, e2, n2, s2) { super(t2), this.serializationType = N.PREDICATE, this.ruleIndex = e2, this.predIndex = n2, this.isCtxDependent = s2, this.isEpsilon = true; } matches(t2, e2, n2) { return false; } getPredicate() { return new gt(this.ruleIndex, this.predIndex, this.isCtxDependent); } toString() { return "pred_" + this.ruleIndex + ":" + this.predIndex; } } class ft extends p { constructor(t2) { super(), this.precedence = void 0 === t2 ? 0 : t2; } evaluate(t2, e2) { return t2.precpred(e2, this.precedence); } evalPrecedence(t2, e2) { return t2.precpred(e2, this.precedence) ? p.NONE : null; } compareTo(t2) { return this.precedence - t2.precedence; } updateHashCode(t2) { t2.update(this.precedence); } equals(t2) { return this === t2 || t2 instanceof ft && this.precedence === t2.precedence; } toString() { return "{" + this.precedence + ">=prec}?"; } } p.PrecedencePredicate = ft; class xt extends O { constructor(t2, e2) { super(t2), this.serializationType = N.PRECEDENCE, this.precedence = e2, this.isEpsilon = true; } matches(t2, e2, n2) { return false; } getPredicate() { return new ft(this.precedence); } toString() { return this.precedence + " >= _p"; } } class Tt { constructor(t2) { void 0 === t2 && (t2 = null), this.readOnly = false, this.verifyATN = null === t2 || t2.verifyATN, this.generateRuleBypassTransitions = null !== t2 && t2.generateRuleBypassTransitions; } } Tt.defaultOptions = new Tt(), Tt.defaultOptions.readOnly = true; class St { constructor(t2) { this.actionType = t2, this.isPositionDependent = false; } hashCode() { const t2 = new l(); return this.updateHashCode(t2), t2.finish(); } updateHashCode(t2) { t2.update(this.actionType); } equals(t2) { return this === t2; } } class mt extends St { constructor() { super(6); } execute(t2) { t2.skip(); } toString() { return "skip"; } } mt.INSTANCE = new mt(); class Et extends St { constructor(t2) { super(0), this.channel = t2; } execute(t2) { t2._channel = this.channel; } updateHashCode(t2) { t2.update(this.actionType, this.channel); } equals(t2) { return this === t2 || t2 instanceof Et && this.channel === t2.channel; } toString() { return "channel(" + this.channel + ")"; } } class _t extends St { constructor(t2, e2) { super(1), this.ruleIndex = t2, this.actionIndex = e2, this.isPositionDependent = true; } execute(t2) { t2.action(null, this.ruleIndex, this.actionIndex); } updateHashCode(t2) { t2.update(this.actionType, this.ruleIndex, this.actionIndex); } equals(t2) { return this === t2 || t2 instanceof _t && this.ruleIndex === t2.ruleIndex && this.actionIndex === t2.actionIndex; } } class Ct extends St { constructor() { super(3); } execute(t2) { t2.more(); } toString() { return "more"; } } Ct.INSTANCE = new Ct(); class At extends St { constructor(t2) { super(7), this.type = t2; } execute(t2) { t2.type = this.type; } updateHashCode(t2) { t2.update(this.actionType, this.type); } equals(t2) { return this === t2 || t2 instanceof At && this.type === t2.type; } toString() { return "type(" + this.type + ")"; } } class Nt extends St { constructor(t2) { super(5), this.mode = t2; } execute(t2) { t2.pushMode(this.mode); } updateHashCode(t2) { t2.update(this.actionType, this.mode); } equals(t2) { return this === t2 || t2 instanceof Nt && this.mode === t2.mode; } toString() { return "pushMode(" + this.mode + ")"; } } class kt extends St { constructor() { super(4); } execute(t2) { t2.popMode(); } toString() { return "popMode"; } } kt.INSTANCE = new kt(); class It extends St { constructor(t2) { super(2), this.mode = t2; } execute(t2) { t2.setMode(this.mode); } updateHashCode(t2) { t2.update(this.actionType, this.mode); } equals(t2) { return this === t2 || t2 instanceof It && this.mode === t2.mode; } toString() { return "mode(" + this.mode + ")"; } } function yt(t2, e2) { const n2 = []; return n2[t2 - 1] = e2, n2.map(function(t3) { return e2; }); } class Lt { constructor(t2) { null == t2 && (t2 = Tt.defaultOptions), this.deserializationOptions = t2, this.stateFactories = null, this.actionFactories = null; } deserialize(t2) { const e2 = this.reset(t2); this.checkVersion(e2), e2 && this.skipUUID(); const n2 = this.readATN(); this.readStates(n2, e2), this.readRules(n2, e2), this.readModes(n2); const s2 = []; return this.readSets(n2, s2, this.readInt.bind(this)), e2 && this.readSets(n2, s2, this.readInt32.bind(this)), this.readEdges(n2, s2), this.readDecisions(n2), this.readLexerActions(n2, e2), this.markPrecedenceDecisions(n2), this.verifyATN(n2), this.deserializationOptions.generateRuleBypassTransitions && 1 === n2.grammarType && (this.generateRuleBypassTransitions(n2), this.verifyATN(n2)), n2; } reset(t2) { if (3 === (t2.charCodeAt ? t2.charCodeAt(0) : t2[0])) { const e2 = function(t3) { const e3 = t3.charCodeAt(0); return e3 > 1 ? e3 - 2 : e3 + 65534; }, n2 = t2.split("").map(e2); return n2[0] = t2.charCodeAt(0), this.data = n2, this.pos = 0, true; } return this.data = t2, this.pos = 0, false; } skipUUID() { let t2 = 0; for (; t2++ < 8; ) this.readInt(); } checkVersion(t2) { const e2 = this.readInt(); if (!t2 && 4 !== e2) throw "Could not deserialize ATN with version " + e2 + " (expected 4)."; } readATN() { const t2 = this.readInt(), e2 = this.readInt(); return new $(t2, e2); } readStates(t2, e2) { let n2, s2, i2; const r2 = [], o2 = [], a2 = this.readInt(); for (let n3 = 0;