1import { 2 IcosahedralSymmetry, 3 ZomicEventHandler, 4 ZomicStatement, 5 ZomicVirtualMachine 6} from "./chunk-CXLFZQHL.js"; 7import { 8 Axis, 9 Symmetry, 10 java, 11 javaemul 12} from "./chunk-5PFIPZES.js"; 13import "./chunk-JSBRDJBE.js"; 14
vendor: 162,223 bytes, lines 15-4007
15// node_modules/antlr4/dist/antlr4.web.mjs 16var t = { 92: () => { 17} }; 18var e = {}; 19function n(s2) { 20 var i2 = e[s2]; 21 if (void 0 !== i2) return i2.exports; 22 var r2 = e[s2] = { exports: {} }; 23 return t[s2](r2, r2.exports, n), r2.exports; 24} 25n.d = (t2, e2) => { 26 for (var s2 in e2) n.o(e2, s2) && !n.o(t2, s2) && Object.defineProperty(t2, s2, { enumerable: true, get: e2[s2] }); 27}, n.o = (t2, e2) => Object.prototype.hasOwnProperty.call(t2, e2); 28var s = {}; 29(() => { 30 n.d(s, { dx: () => $, q2: () => Lt, FO: () => Ce, xf: () => Ie, Gy: () => ve, s4: () => Pt, c7: () => be, _7: () => le, tx: () => Ae, gp: () => me, cK: () => Ot, zs: () => Te, AV: () => Ie, Xp: () => m2, VS: () => E2, ul: () => W, hW: () => Ut, x1: () => Xt, z5: () => ee, oN: () => de, TB: () => pe, u1: () => ge, _b: () => Fe, $F: () => se, _T: () => Be, db: () => ie, Zx: () => te, _x: () => Ft, r8: () => M2, JI: () => w2, TP: () => P2, WU: () => t2, Nj: () => c2, ZP: () => We }); 31 class t2 { 32 constructor() { 33 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; 34 } 35 getTokenSource() { 36 return this.source[0]; 37 } 38 getInputStream() { 39 return this.source[1]; 40 } 41 get text() { 42 return this._text; 43 } 44 set text(t3) { 45 this._text = t3; 46 } 47 } 48 function e2(t3, e3) { 49 if (!Array.isArray(t3) || !Array.isArray(e3)) return false; 50 if (t3 === e3) return true; 51 if (t3.length !== e3.length) return false; 52 for (let n2 = 0; n2 < t3.length; n2++) if (!(t3[n2] === e3[n2] || t3[n2].equals && t3[n2].equals(e3[n2]))) return false; 53 return true; 54 } 55 t2.INVALID_TYPE = 0, t2.EPSILON = -2, t2.MIN_USER_TOKEN_TYPE = 1, t2.EOF = -1, t2.DEFAULT_CHANNEL = 0, t2.HIDDEN_CHANNEL = 1; 56 const i2 = Math.round(Math.random() * Math.pow(2, 32)); 57 function r2(t3) { 58 if (!t3) return 0; 59 const e3 = typeof t3, n2 = "string" === e3 ? t3 : !("object" !== e3 || !t3.toString) && t3.toString(); 60 if (!n2) return 0; 61 let s2, r3; 62 const o3 = 3 & n2.length, a3 = n2.length - o3; 63 let l3 = i2; 64 const h3 = 3432918353, c3 = 461845907; 65 let u3 = 0; 66 for (; u3 < a3; ) r3 = 255 & n2.charCodeAt(u3) | (255 & n2.charCodeAt(++u3)) << 8 | (255 & n2.charCodeAt(++u3)) << 16 | (255 & n2.charCodeAt(++u3)) << 24, ++u3, r3 = (65535 & r3) * h3 + (((r3 >>> 16) * h3 & 65535) << 16) & 4294967295, r3 = r3 << 15 | r3 >>> 17, r3 = (65535 & r3) * c3 + (((r3 >>> 16) * c3 & 65535) << 16) & 4294967295, l3 ^= r3, l3 = l3 << 13 | l3 >>> 19, s2 = 5 * (65535 & l3) + ((5 * (l3 >>> 16) & 65535) << 16) & 4294967295, l3 = 27492 + (65535 & s2) + ((58964 + (s2 >>> 16) & 65535) << 16); 67 switch (r3 = 0, o3) { 68 case 3: 69 r3 ^= (255 & n2.charCodeAt(u3 + 2)) << 16; 70 case 2: 71 r3 ^= (255 & n2.charCodeAt(u3 + 1)) << 8; 72 case 1: 73 r3 ^= 255 & n2.charCodeAt(u3), r3 = (65535 & r3) * h3 + (((r3 >>> 16) * h3 & 65535) << 16) & 4294967295, r3 = r3 << 15 | r3 >>> 17, r3 = (65535 & r3) * c3 + (((r3 >>> 16) * c3 & 65535) << 16) & 4294967295, l3 ^= r3; 74 } 75 return l3 ^= n2.length, l3 ^= l3 >>> 16, l3 = 2246822507 * (65535 & l3) + ((2246822507 * (l3 >>> 16) & 65535) << 16) & 4294967295, l3 ^= l3 >>> 13, l3 = 3266489909 * (65535 & l3) + ((3266489909 * (l3 >>> 16) & 65535) << 16) & 4294967295, l3 ^= l3 >>> 16, l3 >>> 0; 76 } 77 class o2 { 78 constructor() { 79 this.count = 0, this.hash = 0; 80 } 81 update() { 82 for (let t3 = 0; t3 < arguments.length; t3++) { 83 const e3 = arguments[t3]; 84 if (null != e3) if (Array.isArray(e3)) this.update.apply(this, e3); 85 else { 86 let t4 = 0; 87 switch (typeof e3) { 88 case "undefined": 89 case "function": 90 continue; 91 case "number": 92 case "boolean": 93 t4 = e3; 94 break; 95 case "string": 96 t4 = r2(e3); 97 break; 98 default: 99 e3.updateHashCode ? e3.updateHashCode(this) : console.log("No updateHashCode for " + e3.toString()); 100 continue; 101 } 102 t4 *= 3432918353, t4 = t4 << 15 | t4 >>> 17, t4 *= 461845907, this.count = this.count + 1; 103 let n2 = this.hash ^ t4; 104 n2 = n2 << 13 | n2 >>> 19, n2 = 5 * n2 + 3864292196, this.hash = n2; 105 } 106 } 107 } 108 finish() { 109 let t3 = this.hash ^ 4 * this.count; 110 return t3 ^= t3 >>> 16, t3 *= 2246822507, t3 ^= t3 >>> 13, t3 *= 3266489909, t3 ^= t3 >>> 16, t3; 111 } 112 static hashStuff() { 113 const t3 = new o2(); 114 return t3.update.apply(t3, arguments), t3.finish(); 115 } 116 } 117 function a2(t3) { 118 return t3 ? "string" == typeof t3 ? r2(t3) : t3.hashCode() : -1; 119 } 120 function l2(t3, e3) { 121 return t3 ? t3.equals(e3) : t3 === e3; 122 } 123 function h2(t3) { 124 return null === t3 ? "null" : t3; 125 } 126 function c2(t3) { 127 return Array.isArray(t3) ? "[" + t3.map(h2).join(", ") + "]" : "null"; 128 } 129 const u2 = "h-"; 130 class d2 { 131 constructor(t3, e3) { 132 this.data = {}, this.hashFunction = t3 || a2, this.equalsFunction = e3 || l2; 133 } 134 add(t3) { 135 const e3 = u2 + this.hashFunction(t3); 136 if (e3 in this.data) { 137 const n2 = this.data[e3]; 138 for (let e4 = 0; e4 < n2.length; e4++) if (this.equalsFunction(t3, n2[e4])) return n2[e4]; 139 return n2.push(t3), t3; 140 } 141 return this.data[e3] = [t3], t3; 142 } 143 has(t3) { 144 return null != this.get(t3); 145 } 146 get(t3) { 147 const e3 = u2 + this.hashFunction(t3); 148 if (e3 in this.data) { 149 const n2 = this.data[e3]; 150 for (let e4 = 0; e4 < n2.length; e4++) if (this.equalsFunction(t3, n2[e4])) return n2[e4]; 151 } 152 return null; 153 } 154 values() { 155 return Object.keys(this.data).filter(((t3) => t3.startsWith(u2))).flatMap(((t3) => this.data[t3]), this); 156 } 157 toString() { 158 return c2(this.values()); 159 } 160 get length() { 161 return Object.keys(this.data).filter(((t3) => t3.startsWith(u2))).map(((t3) => this.data[t3].length), this).reduce(((t3, e3) => t3 + e3), 0); 162 } 163 } 164 class p2 { 165 hashCode() { 166 const t3 = new o2(); 167 return this.updateHashCode(t3), t3.finish(); 168 } 169 evaluate(t3, e3) { 170 } 171 evalPrecedence(t3, e3) { 172 return this; 173 } 174 static andContext(t3, e3) { 175 if (null === t3 || t3 === p2.NONE) return e3; 176 if (null === e3 || e3 === p2.NONE) return t3; 177 const n2 = new g2(t3, e3); 178 return 1 === n2.opnds.length ? n2.opnds[0] : n2; 179 } 180 static orContext(t3, e3) { 181 if (null === t3) return e3; 182 if (null === e3) return t3; 183 if (t3 === p2.NONE || e3 === p2.NONE) return p2.NONE; 184 const n2 = new f2(t3, e3); 185 return 1 === n2.opnds.length ? n2.opnds[0] : n2; 186 } 187 } 188 class g2 extends p2 { 189 constructor(t3, e3) { 190 super(); 191 const n2 = new d2(); 192 t3 instanceof g2 ? t3.opnds.map((function(t4) { 193 n2.add(t4); 194 })) : n2.add(t3), e3 instanceof g2 ? e3.opnds.map((function(t4) { 195 n2.add(t4); 196 })) : n2.add(e3); 197 const s2 = x2(n2); 198 if (s2.length > 0) { 199 let t4 = null; 200 s2.map((function(e4) { 201 (null === t4 || e4.precedence < t4.precedence) && (t4 = e4); 202 })), n2.add(t4); 203 } 204 this.opnds = Array.from(n2.values()); 205 } 206 equals(t3) { 207 return this === t3 || t3 instanceof g2 && e2(this.opnds, t3.opnds); 208 } 209 updateHashCode(t3) { 210 t3.update(this.opnds, "AND"); 211 } 212 evaluate(t3, e3) { 213 for (let n2 = 0; n2 < this.opnds.length; n2++) if (!this.opnds[n2].evaluate(t3, e3)) return false; 214 return true; 215 } 216 evalPrecedence(t3, e3) { 217 let n2 = false; 218 const s2 = []; 219 for (let i4 = 0; i4 < this.opnds.length; i4++) { 220 const r3 = this.opnds[i4], o3 = r3.evalPrecedence(t3, e3); 221 if (n2 |= o3 !== r3, null === o3) return null; 222 o3 !== p2.NONE && s2.push(o3); 223 } 224 if (!n2) return this; 225 if (0 === s2.length) return p2.NONE; 226 let i3 = null; 227 return s2.map((function(t4) { 228 i3 = null === i3 ? t4 : p2.andContext(i3, t4); 229 })), i3; 230 } 231 toString() { 232 const t3 = this.opnds.map(((t4) => t4.toString())); 233 return (t3.length > 3 ? t3.slice(3) : t3).join("&&"); 234 } 235 } 236 class f2 extends p2 { 237 constructor(t3, e3) { 238 super(); 239 const n2 = new d2(); 240 t3 instanceof f2 ? t3.opnds.map((function(t4) { 241 n2.add(t4); 242 })) : n2.add(t3), e3 instanceof f2 ? e3.opnds.map((function(t4) { 243 n2.add(t4); 244 })) : n2.add(e3); 245 const s2 = x2(n2); 246 if (s2.length > 0) { 247 const t4 = s2.sort((function(t5, e5) { 248 return t5.compareTo(e5); 249 })), e4 = t4[t4.length - 1]; 250 n2.add(e4); 251 } 252 this.opnds = Array.from(n2.values()); 253 } 254 equals(t3) { 255 return this === t3 || t3 instanceof f2 && e2(this.opnds, t3.opnds); 256 } 257 updateHashCode(t3) { 258 t3.update(this.opnds, "OR"); 259 } 260 evaluate(t3, e3) { 261 for (let n2 = 0; n2 < this.opnds.length; n2++) if (this.opnds[n2].evaluate(t3, e3)) return true; 262 return false; 263 } 264 evalPrecedence(t3, e3) { 265 let n2 = false; 266 const s2 = []; 267 for (let i3 = 0; i3 < this.opnds.length; i3++) { 268 const r3 = this.opnds[i3], o3 = r3.evalPrecedence(t3, e3); 269 if (n2 |= o3 !== r3, o3 === p2.NONE) return p2.NONE; 270 null !== o3 && s2.push(o3); 271 } 272 if (!n2) return this; 273 if (0 === s2.length) return null; 274 return s2.map((function(t4) { 275 return t4; 276 })), null; 277 } 278 toString() { 279 const t3 = this.opnds.map(((t4) => t4.toString())); 280 return (t3.length > 3 ? t3.slice(3) : t3).join("||"); 281 } 282 } 283 function x2(t3) { 284 const e3 = []; 285 return t3.values().map((function(t4) { 286 t4 instanceof p2.PrecedencePredicate && e3.push(t4); 287 })), e3; 288 } 289 function T2(t3, e3) { 290 if (null === t3) { 291 const t4 = { state: null, alt: null, context: null, semanticContext: null }; 292 return e3 && (t4.reachesIntoOuterContext = 0), t4; 293 } 294 { 295 const n2 = {}; 296 return n2.state = t3.state || null, n2.alt = void 0 === t3.alt ? null : t3.alt, n2.context = t3.context || null, n2.semanticContext = t3.semanticContext || null, e3 && (n2.reachesIntoOuterContext = t3.reachesIntoOuterContext || 0, n2.precedenceFilterSuppressed = t3.precedenceFilterSuppressed || false), n2; 297 } 298 } 299 class S2 { 300 constructor(t3, e3) { 301 this.checkContext(t3, e3), t3 = T2(t3), e3 = T2(e3, true), this.state = null !== t3.state ? t3.state : e3.state, this.alt = null !== t3.alt ? t3.alt : e3.alt, this.context = null !== t3.context ? t3.context : e3.context, this.semanticContext = null !== t3.semanticContext ? t3.semanticContext : null !== e3.semanticContext ? e3.semanticContext : p2.NONE, this.reachesIntoOuterContext = e3.reachesIntoOuterContext, this.precedenceFilterSuppressed = e3.precedenceFilterSuppressed; 302 } 303 checkContext(t3, e3) { 304 null !== t3.context && void 0 !== t3.context || null !== e3 && null !== e3.context && void 0 !== e3.context || (this.context = null); 305 } 306 hashCode() { 307 const t3 = new o2(); 308 return this.updateHashCode(t3), t3.finish(); 309 } 310 updateHashCode(t3) { 311 t3.update(this.state.stateNumber, this.alt, this.context, this.semanticContext); 312 } 313 equals(t3) { 314 return this === t3 || t3 instanceof S2 && this.state.stateNumber === t3.state.stateNumber && this.alt === t3.alt && (null === this.context ? null === t3.context : this.context.equals(t3.context)) && this.semanticContext.equals(t3.semanticContext) && this.precedenceFilterSuppressed === t3.precedenceFilterSuppressed; 315 } 316 hashCodeForConfigSet() { 317 const t3 = new o2(); 318 return t3.update(this.state.stateNumber, this.alt, this.semanticContext), t3.finish(); 319 } 320 equalsForConfigSet(t3) { 321 return this === t3 || t3 instanceof S2 && this.state.stateNumber === t3.state.stateNumber && this.alt === t3.alt && this.semanticContext.equals(t3.semanticContext); 322 } 323 toString() { 324 return "(" + this.state + "," + this.alt + (null !== this.context ? ",[" + this.context.toString() + "]" : "") + (this.semanticContext !== p2.NONE ? "," + this.semanticContext.toString() : "") + (this.reachesIntoOuterContext > 0 ? ",up=" + this.reachesIntoOuterContext : "") + ")"; 325 } 326 } 327 class m2 { 328 constructor(t3, e3) { 329 this.start = t3, this.stop = e3; 330 } 331 clone() { 332 return new m2(this.start, this.stop); 333 } 334 contains(t3) { 335 return t3 >= this.start && t3 < this.stop; 336 } 337 toString() { 338 return this.start === this.stop - 1 ? this.start.toString() : this.start.toString() + ".." + (this.stop - 1).toString(); 339 } 340 get length() { 341 return this.stop - this.start; 342 } 343 } 344 m2.INVALID_INTERVAL = new m2(-1, -2); 345 class E2 { 346 constructor() { 347 this.intervals = null, this.readOnly = false; 348 } 349 first(e3) { 350 return null === this.intervals || 0 === this.intervals.length ? t2.INVALID_TYPE : this.intervals[0].start; 351 } 352 addOne(t3) { 353 this.addInterval(new m2(t3, t3 + 1)); 354 } 355 addRange(t3, e3) { 356 this.addInterval(new m2(t3, e3 + 1)); 357 } 358 addInterval(t3) { 359 if (null === this.intervals) this.intervals = [], this.intervals.push(t3.clone()); 360 else { 361 for (let e3 = 0; e3 < this.intervals.length; e3++) { 362 const n2 = this.intervals[e3]; 363 if (t3.stop < n2.start) return void this.intervals.splice(e3, 0, t3); 364 if (t3.stop === n2.start) return void (this.intervals[e3] = new m2(t3.start, n2.stop)); 365 if (t3.start <= n2.stop) return this.intervals[e3] = new m2(Math.min(n2.start, t3.start), Math.max(n2.stop, t3.stop)), void this.reduce(e3); 366 } 367 this.intervals.push(t3.clone()); 368 } 369 } 370 addSet(t3) { 371 return null !== t3.intervals && t3.intervals.forEach(((t4) => this.addInterval(t4)), this), this; 372 } 373 reduce(t3) { 374 if (t3 < this.intervals.length - 1) { 375 const e3 = this.intervals[t3], n2 = this.intervals[t3 + 1]; 376 e3.stop >= n2.stop ? (this.intervals.splice(t3 + 1, 1), this.reduce(t3)) : e3.stop >= n2.start && (this.intervals[t3] = new m2(e3.start, n2.stop), this.intervals.splice(t3 + 1, 1)); 377 } 378 } 379 complement(t3, e3) { 380 const n2 = new E2(); 381 return n2.addInterval(new m2(t3, e3 + 1)), null !== this.intervals && this.intervals.forEach(((t4) => n2.removeRange(t4))), n2; 382 } 383 contains(t3) { 384 if (null === this.intervals) return false; 385 for (let e3 = 0; e3 < this.intervals.length; e3++) if (this.intervals[e3].contains(t3)) return true; 386 return false; 387 } 388 removeRange(t3) { 389 if (t3.start === t3.stop - 1) this.removeOne(t3.start); 390 else if (null !== this.intervals) { 391 let e3 = 0; 392 for (let n2 = 0; n2 < this.intervals.length; n2++) { 393 const n3 = this.intervals[e3]; 394 if (t3.stop <= n3.start) return; 395 if (t3.start > n3.start && t3.stop < n3.stop) { 396 this.intervals[e3] = new m2(n3.start, t3.start); 397 const s2 = new m2(t3.stop, n3.stop); 398 return void this.intervals.splice(e3, 0, s2); 399 } 400 t3.start <= n3.start && t3.stop >= n3.stop ? (this.intervals.splice(e3, 1), e3 -= 1) : t3.start < n3.stop ? this.intervals[e3] = new m2(n3.start, t3.start) : t3.stop < n3.stop && (this.intervals[e3] = new m2(t3.stop, n3.stop)), e3 += 1; 401 } 402 } 403 } 404 removeOne(t3) { 405 if (null !== this.intervals) for (let e3 = 0; e3 < this.intervals.length; e3++) { 406 const n2 = this.intervals[e3]; 407 if (t3 < n2.start) return; 408 if (t3 === n2.start && t3 === n2.stop - 1) return void this.intervals.splice(e3, 1); 409 if (t3 === n2.start) return void (this.intervals[e3] = new m2(n2.start + 1, n2.stop)); 410 if (t3 === n2.stop - 1) return void (this.intervals[e3] = new m2(n2.start, n2.stop - 1)); 411 if (t3 < n2.stop - 1) { 412 const s2 = new m2(n2.start, t3); 413 return n2.start = t3 + 1, void this.intervals.splice(e3, 0, s2); 414 } 415 } 416 } 417 toString(t3, e3, n2) { 418 return t3 = t3 || null, e3 = e3 || null, n2 = n2 || false, null === this.intervals ? "{}" : null !== t3 || null !== e3 ? this.toTokenString(t3, e3) : n2 ? this.toCharString() : this.toIndexString(); 419 } 420 toCharString() { 421 const e3 = []; 422 for (let n2 = 0; n2 < this.intervals.length; n2++) { 423 const s2 = this.intervals[n2]; 424 s2.stop === s2.start + 1 ? s2.start === t2.EOF ? e3.push("<EOF>") : e3.push("'" + String.fromCharCode(s2.start) + "'") : e3.push("'" + String.fromCharCode(s2.start) + "'..'" + String.fromCharCode(s2.stop - 1) + "'"); 425 } 426 return e3.length > 1 ? "{" + e3.join(", ") + "}" : e3[0]; 427 } 428 toIndexString() { 429 const e3 = []; 430 for (let n2 = 0; n2 < this.intervals.length; n2++) { 431 const s2 = this.intervals[n2]; 432 s2.stop === s2.start + 1 ? s2.start === t2.EOF ? e3.push("<EOF>") : e3.push(s2.start.toString()) : e3.push(s2.start.toString() + ".." + (s2.stop - 1).toString()); 433 } 434 return e3.length > 1 ? "{" + e3.join(", ") + "}" : e3[0]; 435 } 436 toTokenString(t3, e3) { 437 const n2 = []; 438 for (let s2 = 0; s2 < this.intervals.length; s2++) { 439 const i3 = this.intervals[s2]; 440 for (let s3 = i3.start; s3 < i3.stop; s3++) n2.push(this.elementName(t3, e3, s3)); 441 } 442 return n2.length > 1 ? "{" + n2.join(", ") + "}" : n2[0]; 443 } 444 elementName(e3, n2, s2) { 445 return s2 === t2.EOF ? "<EOF>" : s2 === t2.EPSILON ? "<EPSILON>" : e3[s2] || n2[s2]; 446 } 447 get length() { 448 return this.intervals.map(((t3) => t3.length)).reduce(((t3, e3) => t3 + e3)); 449 } 450 } 451 class _2 { 452 constructor() { 453 this.atn = null, this.stateNumber = _2.INVALID_STATE_NUMBER, this.stateType = null, this.ruleIndex = 0, this.epsilonOnlyTransitions = false, this.transitions = [], this.nextTokenWithinRule = null; 454 } 455 toString() { 456 return this.stateNumber; 457 } 458 equals(t3) { 459 return t3 instanceof _2 && this.stateNumber === t3.stateNumber; 460 } 461 isNonGreedyExitState() { 462 return false; 463 } 464 addTransition(t3, e3) { 465 void 0 === e3 && (e3 = -1), 0 === this.transitions.length ? this.epsilonOnlyTransitions = t3.isEpsilon : this.epsilonOnlyTransitions !== t3.isEpsilon && (this.epsilonOnlyTransitions = false), -1 === e3 ? this.transitions.push(t3) : this.transitions.splice(e3, 1, t3); 466 } 467 } 468 _2.INVALID_TYPE = 0, _2.BASIC = 1, _2.RULE_START = 2, _2.BLOCK_START = 3, _2.PLUS_BLOCK_START = 4, _2.STAR_BLOCK_START = 5, _2.TOKEN_START = 6, _2.RULE_STOP = 7, _2.BLOCK_END = 8, _2.STAR_LOOP_BACK = 9, _2.STAR_LOOP_ENTRY = 10, _2.PLUS_LOOP_BACK = 11, _2.LOOP_END = 12, _2.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"], _2.INVALID_STATE_NUMBER = -1; 469 class A2 extends _2 { 470 constructor() { 471 return super(), this.stateType = _2.RULE_STOP, this; 472 } 473 } 474 class C2 { 475 constructor(t3) { 476 if (null == t3) throw "target cannot be null."; 477 this.target = t3, this.isEpsilon = false, this.label = null; 478 } 479 } 480 C2.EPSILON = 1, C2.RANGE = 2, C2.RULE = 3, C2.PREDICATE = 4, C2.ATOM = 5, C2.ACTION = 6, C2.SET = 7, C2.NOT_SET = 8, C2.WILDCARD = 9, C2.PRECEDENCE = 10, C2.serializationNames = ["INVALID", "EPSILON", "RANGE", "RULE", "PREDICATE", "ATOM", "ACTION", "SET", "NOT_SET", "WILDCARD", "PRECEDENCE"], C2.serializationTypes = { EpsilonTransition: C2.EPSILON, RangeTransition: C2.RANGE, RuleTransition: C2.RULE, PredicateTransition: C2.PREDICATE, AtomTransition: C2.ATOM, ActionTransition: C2.ACTION, SetTransition: C2.SET, NotSetTransition: C2.NOT_SET, WildcardTransition: C2.WILDCARD, PrecedencePredicateTransition: C2.PRECEDENCE }; 481 class N2 extends C2 { 482 constructor(t3, e3, n2, s2) { 483 super(t3), this.ruleIndex = e3, this.precedence = n2, this.followState = s2, this.serializationType = C2.RULE, this.isEpsilon = true; 484 } 485 matches(t3, e3, n2) { 486 return false; 487 } 488 } 489 class y2 extends C2 { 490 constructor(e3, n2) { 491 super(e3), this.serializationType = C2.SET, null != n2 ? this.label = n2 : (this.label = new E2(), this.label.addOne(t2.INVALID_TYPE)); 492 } 493 matches(t3, e3, n2) { 494 return this.label.contains(t3); 495 } 496 toString() { 497 return this.label.toString(); 498 } 499 } 500 class I2 extends y2 { 501 constructor(t3, e3) { 502 super(t3, e3), this.serializationType = C2.NOT_SET; 503 } 504 matches(t3, e3, n2) { 505 return t3 >= e3 && t3 <= n2 && !super.matches(t3, e3, n2); 506 } 507 toString() { 508 return "~" + super.toString(); 509 } 510 } 511 class k2 extends C2 { 512 constructor(t3) { 513 super(t3), this.serializationType = C2.WILDCARD; 514 } 515 matches(t3, e3, n2) { 516 return t3 >= e3 && t3 <= n2; 517 } 518 toString() { 519 return "."; 520 } 521 } 522 class L2 extends C2 { 523 constructor(t3) { 524 super(t3); 525 } 526 } 527 class O2 { 528 } 529 class v2 extends O2 { 530 } 531 class R2 extends v2 { 532 } 533 class w2 extends R2 { 534 get ruleContext() { 535 throw new Error("missing interface implementation"); 536 } 537 } 538 class P2 extends R2 { 539 } 540 class b2 extends P2 { 541 } 542 const D2 = { toStringTree: function(t3, e3, n2) { 543 e3 = e3 || null, null !== (n2 = n2 || null) && (e3 = n2.ruleNames); 544 let s2 = D2.getNodeText(t3, e3); 545 s2 = (function(t4, e4) { 546 return t4 = t4.replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r"); 547 })(s2); 548 const i3 = t3.getChildCount(); 549 if (0 === i3) return s2; 550 let r3 = "(" + s2 + " "; 551 i3 > 0 && (s2 = D2.toStringTree(t3.getChild(0), e3), r3 = r3.concat(s2)); 552 for (let n3 = 1; n3 < i3; n3++) s2 = D2.toStringTree(t3.getChild(n3), e3), r3 = r3.concat(" " + s2); 553 return r3 = r3.concat(")"), r3; 554 }, getNodeText: function(e3, n2, s2) { 555 if (n2 = n2 || null, null !== (s2 = s2 || null) && (n2 = s2.ruleNames), null !== n2) { 556 if (e3 instanceof w2) { 557 const t3 = e3.ruleContext.getAltNumber(); 558 return 0 != t3 ? n2[e3.ruleIndex] + ":" + t3 : n2[e3.ruleIndex]; 559 } 560 if (e3 instanceof b2) return e3.toString(); 561 if (e3 instanceof P2 && null !== e3.symbol) return e3.symbol.text; 562 } 563 const i3 = e3.getPayload(); 564 return i3 instanceof t2 ? i3.text : e3.getPayload().toString(); 565 }, getChildren: function(t3) { 566 const e3 = []; 567 for (let n2 = 0; n2 < t3.getChildCount(); n2++) e3.push(t3.getChild(n2)); 568 return e3; 569 }, getAncestors: function(t3) { 570 let e3 = []; 571 for (t3 = t3.getParent(); null !== t3; ) e3 = [t3].concat(e3), t3 = t3.getParent(); 572 return e3; 573 }, findAllTokenNodes: function(t3, e3) { 574 return D2.findAllNodes(t3, e3, true); 575 }, findAllRuleNodes: function(t3, e3) { 576 return D2.findAllNodes(t3, e3, false); 577 }, findAllNodes: function(t3, e3, n2) { 578 const s2 = []; 579 return D2._findAllNodes(t3, e3, n2, s2), s2; 580 }, _findAllNodes: function(t3, e3, n2, s2) { 581 n2 && t3 instanceof P2 ? t3.symbol.type === e3 && s2.push(t3) : !n2 && t3 instanceof w2 && t3.ruleIndex === e3 && s2.push(t3); 582 for (let i3 = 0; i3 < t3.getChildCount(); i3++) D2._findAllNodes(t3.getChild(i3), e3, n2, s2); 583 }, descendants: function(t3) { 584 let e3 = [t3]; 585 for (let n2 = 0; n2 < t3.getChildCount(); n2++) e3 = e3.concat(D2.descendants(t3.getChild(n2))); 586 return e3; 587 } }, F2 = D2; 588 class M2 extends w2 { 589 constructor(t3, e3) { 590 super(), this.parentCtx = t3 || null, this.invokingState = e3 || -1; 591 } 592 depth() { 593 let t3 = 0, e3 = this; 594 for (; null !== e3; ) e3 = e3.parentCtx, t3 += 1; 595 return t3; 596 } 597 isEmpty() { 598 return -1 === this.invokingState; 599 } 600 getSourceInterval() { 601 return m2.INVALID_INTERVAL; 602 } 603 get ruleContext() { 604 return this; 605 } 606 getPayload() { 607 return this; 608 } 609 getText() { 610 return 0 === this.getChildCount() ? "" : this.children.map((function(t3) { 611 return t3.getText(); 612 })).join(""); 613 } 614 getAltNumber() { 615 return 0; 616 } 617 setAltNumber(t3) { 618 } 619 getChild(t3) { 620 return null; 621 } 622 getChildCount() { 623 return 0; 624 } 625 accept(t3) { 626 return t3.visitChildren(this); 627 } 628 toStringTree(t3, e3) { 629 return F2.toStringTree(this, t3, e3); 630 } 631 toString(t3, e3) { 632 t3 = t3 || null, e3 = e3 || null; 633 let n2 = this, s2 = "["; 634 for (; null !== n2 && n2 !== e3; ) { 635 if (null === t3) n2.isEmpty() || (s2 += n2.invokingState); 636 else { 637 const e4 = n2.ruleIndex; 638 s2 += e4 >= 0 && e4 < t3.length ? t3[e4] : "" + e4; 639 } 640 null === n2.parentCtx || null === t3 && n2.parentCtx.isEmpty() || (s2 += " "), n2 = n2.parentCtx; 641 } 642 return s2 += "]", s2; 643 } 644 } 645 class U { 646 constructor(t3) { 647 this.cachedHashCode = t3; 648 } 649 isEmpty() { 650 return this === U.EMPTY; 651 } 652 hasEmptyPath() { 653 return this.getReturnState(this.length - 1) === U.EMPTY_RETURN_STATE; 654 } 655 hashCode() { 656 return this.cachedHashCode; 657 } 658 updateHashCode(t3) { 659 t3.update(this.cachedHashCode); 660 } 661 } 662 U.EMPTY = null, U.EMPTY_RETURN_STATE = 2147483647, U.globalNodeCount = 1, U.id = U.globalNodeCount, U.trace_atn_sim = false; 663 class B extends U { 664 constructor(t3, e3) { 665 const n2 = new o2(); 666 return n2.update(t3, e3), super(n2.finish()), this.parents = t3, this.returnStates = e3, this; 667 } 668 isEmpty() { 669 return this.returnStates[0] === U.EMPTY_RETURN_STATE; 670 } 671 getParent(t3) { 672 return this.parents[t3]; 673 } 674 getReturnState(t3) { 675 return this.returnStates[t3]; 676 } 677 equals(t3) { 678 return this === t3 || t3 instanceof B && this.hashCode() === t3.hashCode() && e2(this.returnStates, t3.returnStates) && e2(this.parents, t3.parents); 679 } 680 toString() { 681 if (this.isEmpty()) return "[]"; 682 { 683 let t3 = "["; 684 for (let e3 = 0; e3 < this.returnStates.length; e3++) e3 > 0 && (t3 += ", "), this.returnStates[e3] !== U.EMPTY_RETURN_STATE ? (t3 += this.returnStates[e3], null !== this.parents[e3] ? t3 = t3 + " " + this.parents[e3] : t3 += "null") : t3 += "$"; 685 return t3 + "]"; 686 } 687 } 688 get length() { 689 return this.returnStates.length; 690 } 691 } 692 class V extends U { 693 constructor(t3, e3) { 694 let n2 = 0; 695 const s2 = new o2(); 696 null !== t3 ? s2.update(t3, e3) : s2.update(1), n2 = s2.finish(), super(n2), this.parentCtx = t3, this.returnState = e3; 697 } 698 getParent(t3) { 699 return this.parentCtx; 700 } 701 getReturnState(t3) { 702 return this.returnState; 703 } 704 equals(t3) { 705 return this === t3 || t3 instanceof V && this.hashCode() === t3.hashCode() && this.returnState === t3.returnState && (null == this.parentCtx ? null == t3.parentCtx : this.parentCtx.equals(t3.parentCtx)); 706 } 707 toString() { 708 const t3 = null === this.parentCtx ? "" : this.parentCtx.toString(); 709 return 0 === t3.length ? this.returnState === U.EMPTY_RETURN_STATE ? "$" : "" + this.returnState : this.returnState + " " + t3; 710 } 711 get length() { 712 return 1; 713 } 714 static create(t3, e3) { 715 return e3 === U.EMPTY_RETURN_STATE && null === t3 ? U.EMPTY : new V(t3, e3); 716 } 717 } 718 class z extends V { 719 constructor() { 720 super(null, U.EMPTY_RETURN_STATE); 721 } 722 isEmpty() { 723 return true; 724 } 725 getParent(t3) { 726 return null; 727 } 728 getReturnState(t3) { 729 return this.returnState; 730 } 731 equals(t3) { 732 return this === t3; 733 } 734 toString() { 735 return "$"; 736 } 737 } 738 U.EMPTY = new z(); 739 const q = "h-"; 740 class H { 741 constructor(t3, e3) { 742 this.data = {}, this.hashFunction = t3 || a2, this.equalsFunction = e3 || l2; 743 } 744 set(t3, e3) { 745 const n2 = q + this.hashFunction(t3); 746 if (n2 in this.data) { 747 const s2 = this.data[n2]; 748 for (let n3 = 0; n3 < s2.length; n3++) { 749 const i3 = s2[n3]; 750 if (this.equalsFunction(t3, i3.key)) { 751 const t4 = i3.value; 752 return i3.value = e3, t4; 753 } 754 } 755 return s2.push({ key: t3, value: e3 }), e3; 756 } 757 return this.data[n2] = [{ key: t3, value: e3 }], e3; 758 } 759 containsKey(t3) { 760 const e3 = q + this.hashFunction(t3); 761 if (e3 in this.data) { 762 const n2 = this.data[e3]; 763 for (let e4 = 0; e4 < n2.length; e4++) { 764 const s2 = n2[e4]; 765 if (this.equalsFunction(t3, s2.key)) return true; 766 } 767 } 768 return false; 769 } 770 get(t3) { 771 const e3 = q + this.hashFunction(t3); 772 if (e3 in this.data) { 773 const n2 = this.data[e3]; 774 for (let e4 = 0; e4 < n2.length; e4++) { 775 const s2 = n2[e4]; 776 if (this.equalsFunction(t3, s2.key)) return s2.value; 777 } 778 } 779 return null; 780 } 781 entries() { 782 return Object.keys(this.data).filter(((t3) => t3.startsWith(q))).flatMap(((t3) => this.data[t3]), this); 783 } 784 getKeys() { 785 return this.entries().map(((t3) => t3.key)); 786 } 787 getValues() { 788 return this.entries().map(((t3) => t3.value)); 789 } 790 toString() { 791 return "[" + this.entries().map(((t3) => "{" + t3.key + ":" + t3.value + "}")).join(", ") + "]"; 792 } 793 get length() { 794 return Object.keys(this.data).filter(((t3) => t3.startsWith(q))).map(((t3) => this.data[t3].length), this).reduce(((t3, e3) => t3 + e3), 0); 795 } 796 } 797 function K(t3, e3) { 798 if (null == e3 && (e3 = M2.EMPTY), null === e3.parentCtx || e3 === M2.EMPTY) return U.EMPTY; 799 const n2 = K(t3, e3.parentCtx), s2 = t3.states[e3.invokingState].transitions[0]; 800 return V.create(n2, s2.followState.stateNumber); 801 } 802 function Y(t3, e3, n2) { 803 if (t3.isEmpty()) return t3; 804 let s2 = n2.get(t3) || null; 805 if (null !== s2) return s2; 806 if (s2 = e3.get(t3), null !== s2) return n2.set(t3, s2), s2; 807 let i3 = false, r3 = []; 808 for (let s3 = 0; s3 < r3.length; s3++) { 809 const o4 = Y(t3.getParent(s3), e3, n2); 810 if (i3 || o4 !== t3.getParent(s3)) { 811 if (!i3) { 812 r3 = []; 813 for (let e4 = 0; e4 < t3.length; e4++) r3[e4] = t3.getParent(e4); 814 i3 = true; 815 } 816 r3[s3] = o4; 817 } 818 } 819 if (!i3) return e3.add(t3), n2.set(t3, t3), t3; 820 let o3 = null; 821 return o3 = 0 === r3.length ? U.EMPTY : 1 === r3.length ? V.create(r3[0], t3.getReturnState(0)) : new B(r3, t3.returnStates), e3.add(o3), n2.set(o3, o3), n2.set(t3, o3), o3; 822 } 823 function G(t3, e3, n2, s2) { 824 if (t3 === e3) return t3; 825 if (t3 instanceof V && e3 instanceof V) return (function(t4, e4, n3, s3) { 826 if (null !== s3) { 827 let n4 = s3.get(t4, e4); 828 if (null !== n4) return n4; 829 if (n4 = s3.get(e4, t4), null !== n4) return n4; 830 } 831 const i3 = (function(t5, e5, n4) { 832 if (n4) { 833 if (t5 === U.EMPTY) return U.EMPTY; 834 if (e5 === U.EMPTY) return U.EMPTY; 835 } else { 836 if (t5 === U.EMPTY && e5 === U.EMPTY) return U.EMPTY; 837 if (t5 === U.EMPTY) { 838 const t6 = [e5.returnState, U.EMPTY_RETURN_STATE], n5 = [e5.parentCtx, null]; 839 return new B(n5, t6); 840 } 841 if (e5 === U.EMPTY) { 842 const e6 = [t5.returnState, U.EMPTY_RETURN_STATE], n5 = [t5.parentCtx, null]; 843 return new B(n5, e6); 844 } 845 } 846 return null; 847 })(t4, e4, n3); 848 if (null !== i3) return null !== s3 && s3.set(t4, e4, i3), i3; 849 if (t4.returnState === e4.returnState) { 850 const i4 = G(t4.parentCtx, e4.parentCtx, n3, s3); 851 if (i4 === t4.parentCtx) return t4; 852 if (i4 === e4.parentCtx) return e4; 853 const r3 = V.create(i4, t4.returnState); 854 return null !== s3 && s3.set(t4, e4, r3), r3; 855 } 856 { 857 let n4 = null; 858 if ((t4 === e4 || null !== t4.parentCtx && t4.parentCtx === e4.parentCtx) && (n4 = t4.parentCtx), null !== n4) { 859 const i5 = [t4.returnState, e4.returnState]; 860 t4.returnState > e4.returnState && (i5[0] = e4.returnState, i5[1] = t4.returnState); 861 const r4 = new B([n4, n4], i5); 862 return null !== s3 && s3.set(t4, e4, r4), r4; 863 } 864 const i4 = [t4.returnState, e4.returnState]; 865 let r3 = [t4.parentCtx, e4.parentCtx]; 866 t4.returnState > e4.returnState && (i4[0] = e4.returnState, i4[1] = t4.returnState, r3 = [e4.parentCtx, t4.parentCtx]); 867 const o3 = new B(r3, i4); 868 return null !== s3 && s3.set(t4, e4, o3), o3; 869 } 870 })(t3, e3, n2, s2); 871 if (n2) { 872 if (t3 instanceof z) return t3; 873 if (e3 instanceof z) return e3; 874 } 875 return t3 instanceof V && (t3 = new B([t3.getParent()], [t3.returnState])), e3 instanceof V && (e3 = new B([e3.getParent()], [e3.returnState])), (function(t4, e4, n3, s3) { 876 if (null !== s3) { 877 let n4 = s3.get(t4, e4); 878 if (null !== n4) return U.trace_atn_sim && console.log("mergeArrays a=" + t4 + ",b=" + e4 + " -> previous"), n4; 879 if (n4 = s3.get(e4, t4), null !== n4) return U.trace_atn_sim && console.log("mergeArrays a=" + t4 + ",b=" + e4 + " -> previous"), n4; 880 } 881 let i3 = 0, r3 = 0, o3 = 0, a3 = new Array(t4.returnStates.length + e4.returnStates.length).fill(0), l3 = new Array(t4.returnStates.length + e4.returnStates.length).fill(null); 882 for (; i3 < t4.returnStates.length && r3 < e4.returnStates.length; ) { 883 const h4 = t4.parents[i3], c3 = e4.parents[r3]; 884 if (t4.returnStates[i3] === e4.returnStates[r3]) { 885 const e5 = t4.returnStates[i3]; 886 e5 === U.EMPTY_RETURN_STATE && null === h4 && null === c3 || null !== h4 && null !== c3 && h4 === c3 ? (l3[o3] = h4, a3[o3] = e5) : (l3[o3] = G(h4, c3, n3, s3), a3[o3] = e5), i3 += 1, r3 += 1; 887 } else t4.returnStates[i3] < e4.returnStates[r3] ? (l3[o3] = h4, a3[o3] = t4.returnStates[i3], i3 += 1) : (l3[o3] = c3, a3[o3] = e4.returnStates[r3], r3 += 1); 888 o3 += 1; 889 } 890 if (i3 < t4.returnStates.length) for (let e5 = i3; e5 < t4.returnStates.length; e5++) l3[o3] = t4.parents[e5], a3[o3] = t4.returnStates[e5], o3 += 1; 891 else for (let t5 = r3; t5 < e4.returnStates.length; t5++) l3[o3] = e4.parents[t5], a3[o3] = e4.returnStates[t5], o3 += 1; 892 if (o3 < l3.length) { 893 if (1 === o3) { 894 const n4 = V.create(l3[0], a3[0]); 895 return null !== s3 && s3.set(t4, e4, n4), n4; 896 } 897 l3 = l3.slice(0, o3), a3 = a3.slice(0, o3); 898 } 899 const h3 = new B(l3, a3); 900 return h3.equals(t4) ? (null !== s3 && s3.set(t4, e4, t4), U.trace_atn_sim && console.log("mergeArrays a=" + t4 + ",b=" + e4 + " -> a"), t4) : h3.equals(e4) ? (null !== s3 && s3.set(t4, e4, e4), U.trace_atn_sim && console.log("mergeArrays a=" + t4 + ",b=" + e4 + " -> b"), e4) : ((function(t5) { 901 const e5 = new H(); 902 for (let n4 = 0; n4 < t5.length; n4++) { 903 const s4 = t5[n4]; 904 e5.containsKey(s4) || e5.set(s4, s4); 905 } 906 for (let n4 = 0; n4 < t5.length; n4++) t5[n4] = e5.get(t5[n4]); 907 })(l3), null !== s3 && s3.set(t4, e4, h3), U.trace_atn_sim && console.log("mergeArrays a=" + t4 + ",b=" + e4 + " -> " + h3), h3); 908 })(t3, e3, n2, s2); 909 } 910 class j { 911 constructor() { 912 this.data = []; 913 } 914 add(t3) { 915 this.data[t3] = true; 916 } 917 or(t3) { 918 Object.keys(t3.data).map(((t4) => this.add(t4)), this); 919 } 920 remove(t3) { 921 delete this.data[t3]; 922 } 923 has(t3) { 924 return true === this.data[t3]; 925 } 926 values() { 927 return Object.keys(this.data); 928 } 929 minValue() { 930 return Math.min.apply(null, this.values()); 931 } 932 hashCode() { 933 return o2.hashStuff(this.values()); 934 } 935 equals(t3) { 936 return t3 instanceof j && e2(this.data, t3.data); 937 } 938 toString() { 939 return "{" + this.values().join(", ") + "}"; 940 } 941 get length() { 942 return this.values().length; 943 } 944 } 945 class W { 946 constructor(t3) { 947 this.atn = t3; 948 } 949 getDecisionLookahead(t3) { 950 if (null === t3) return null; 951 const e3 = t3.transitions.length, n2 = []; 952 for (let s2 = 0; s2 < e3; s2++) { 953 n2[s2] = new E2(); 954 const e4 = new d2(), i3 = false; 955 this._LOOK(t3.transition(s2).target, null, U.EMPTY, n2[s2], e4, new j(), i3, false), (0 === n2[s2].length || n2[s2].contains(W.HIT_PRED)) && (n2[s2] = null); 956 } 957 return n2; 958 } 959 LOOK(t3, e3, n2) { 960 const s2 = new E2(), i3 = null !== (n2 = n2 || null) ? K(t3.atn, n2) : null; 961 return this._LOOK(t3, e3, i3, s2, new d2(), new j(), true, true), s2; 962 } 963 _LOOK(e3, n2, s2, i3, r3, o3, a3, l3) { 964 const h3 = new S2({ state: e3, alt: 0, context: s2 }, null); 965 if (!r3.has(h3)) { 966 if (r3.add(h3), e3 === n2) { 967 if (null === s2) return void i3.addOne(t2.EPSILON); 968 if (s2.isEmpty() && l3) return void i3.addOne(t2.EOF); 969 } 970 if (e3 instanceof A2) { 971 if (null === s2) return void i3.addOne(t2.EPSILON); 972 if (s2.isEmpty() && l3) return void i3.addOne(t2.EOF); 973 if (s2 !== U.EMPTY) { 974 const t3 = o3.has(e3.ruleIndex); 975 try { 976 o3.remove(e3.ruleIndex); 977 for (let t4 = 0; t4 < s2.length; t4++) { 978 const e4 = this.atn.states[s2.getReturnState(t4)]; 979 this._LOOK(e4, n2, s2.getParent(t4), i3, r3, o3, a3, l3); 980 } 981 } finally { 982 t3 && o3.add(e3.ruleIndex); 983 } 984 return; 985 } 986 } 987 for (let h4 = 0; h4 < e3.transitions.length; h4++) { 988 const c3 = e3.transitions[h4]; 989 if (c3.constructor === N2) { 990 if (o3.has(c3.target.ruleIndex)) continue; 991 const t3 = V.create(s2, c3.followState.stateNumber); 992 try { 993 o3.add(c3.target.ruleIndex), this._LOOK(c3.target, n2, t3, i3, r3, o3, a3, l3); 994 } finally { 995 o3.remove(c3.target.ruleIndex); 996 } 997 } else if (c3 instanceof L2) a3 ? this._LOOK(c3.target, n2, s2, i3, r3, o3, a3, l3) : i3.addOne(W.HIT_PRED); 998 else if (c3.isEpsilon) this._LOOK(c3.target, n2, s2, i3, r3, o3, a3, l3); 999 else if (c3.constructor === k2) i3.addRange(t2.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType); 1000 else { 1001 let e4 = c3.label; 1002 null !== e4 && (c3 instanceof I2 && (e4 = e4.complement(t2.MIN_USER_TOKEN_TYPE, this.atn.maxTokenType)), i3.addSet(e4)); 1003 } 1004 } 1005 } 1006 } 1007 } 1008 W.HIT_PRED = t2.INVALID_TYPE; 1009 class $ { 1010 constructor(t3, e3) { 1011 this.grammarType = t3, this.maxTokenType = e3, this.states = [], this.decisionToState = [], this.ruleToStartState = [], this.ruleToStopState = null, this.modeNameToStartState = {}, this.ruleToTokenType = null, this.lexerActions = null, this.modeToStartState = []; 1012 } 1013 nextTokensInContext(t3, e3) { 1014 return new W(this).LOOK(t3, null, e3); 1015 } 1016 nextTokensNoContext(t3) { 1017 return null !== t3.nextTokenWithinRule || (t3.nextTokenWithinRule = this.nextTokensInContext(t3, null), t3.nextTokenWithinRule.readOnly = true), t3.nextTokenWithinRule; 1018 } 1019 nextTokens(t3, e3) { 1020 return void 0 === e3 ? this.nextTokensNoContext(t3) : this.nextTokensInContext(t3, e3); 1021 } 1022 addState(t3) { 1023 null !== t3 && (t3.atn = this, t3.stateNumber = this.states.length), this.states.push(t3); 1024 } 1025 removeState(t3) { 1026 this.states[t3.stateNumber] = null; 1027 } 1028 defineDecisionState(t3) { 1029 return this.decisionToState.push(t3), t3.decision = this.decisionToState.length - 1, t3.decision; 1030 } 1031 getDecisionState(t3) { 1032 return 0 === this.decisionToState.length ? null : this.decisionToState[t3]; 1033 } 1034 getExpectedTokens(e3, n2) { 1035 if (e3 < 0 || e3 >= this.states.length) throw "Invalid state number."; 1036 const s2 = this.states[e3]; 1037 let i3 = this.nextTokens(s2); 1038 if (!i3.contains(t2.EPSILON)) return i3; 1039 const r3 = new E2(); 1040 for (r3.addSet(i3), r3.removeOne(t2.EPSILON); null !== n2 && n2.invokingState >= 0 && i3.contains(t2.EPSILON); ) { 1041 const e4 = this.states[n2.invokingState].transitions[0]; 1042 i3 = this.nextTokens(e4.followState), r3.addSet(i3), r3.removeOne(t2.EPSILON), n2 = n2.parentCtx; 1043 } 1044 return i3.contains(t2.EPSILON) && r3.addOne(t2.EOF), r3; 1045 } 1046 } 1047 $.INVALID_ALT_NUMBER = 0; 1048 class X extends _2 { 1049 constructor() { 1050 super(), this.stateType = _2.BASIC; 1051 } 1052 } 1053 class J extends _2 { 1054 constructor() { 1055 return super(), this.decision = -1, this.nonGreedy = false, this; 1056 } 1057 } 1058 class Z extends J { 1059 constructor() { 1060 return super(), this.endState = null, this; 1061 } 1062 } 1063 class Q extends _2 { 1064 constructor() { 1065 return super(), this.stateType = _2.BLOCK_END, this.startState = null, this; 1066 } 1067 } 1068 class tt extends _2 { 1069 constructor() { 1070 return super(), this.stateType = _2.LOOP_END, this.loopBackState = null, this; 1071 } 1072 } 1073 class et extends _2 { 1074 constructor() { 1075 return super(), this.stateType = _2.RULE_START, this.stopState = null, this.isPrecedenceRule = false, this; 1076 } 1077 } 1078 class nt extends J { 1079 constructor() { 1080 return super(), this.stateType = _2.TOKEN_START, this; 1081 } 1082 } 1083 class st extends J { 1084 constructor() { 1085 return super(), this.stateType = _2.PLUS_LOOP_BACK, this; 1086 } 1087 } 1088 class it extends _2 { 1089 constructor() { 1090 return super(), this.stateType = _2.STAR_LOOP_BACK, this; 1091 } 1092 } 1093 class rt extends J { 1094 constructor() { 1095 return super(), this.stateType = _2.STAR_LOOP_ENTRY, this.loopBackState = null, this.isPrecedenceDecision = null, this; 1096 } 1097 } 1098 class ot extends Z { 1099 constructor() { 1100 return super(), this.stateType = _2.PLUS_BLOCK_START, this.loopBackState = null, this; 1101 } 1102 } 1103 class at extends Z { 1104 constructor() { 1105 return super(), this.stateType = _2.STAR_BLOCK_START, this; 1106 } 1107 } 1108 class lt extends Z { 1109 constructor() { 1110 return super(), this.stateType = _2.BLOCK_START, this; 1111 } 1112 } 1113 class ht extends C2 { 1114 constructor(t3, e3) { 1115 super(t3), this.label_ = e3, this.label = this.makeLabel(), this.serializationType = C2.ATOM; 1116 } 1117 makeLabel() { 1118 const t3 = new E2(); 1119 return t3.addOne(this.label_), t3; 1120 } 1121 matches(t3, e3, n2) { 1122 return this.label_ === t3; 1123 } 1124 toString() { 1125 return this.label_; 1126 } 1127 } 1128 class ct extends C2 { 1129 constructor(t3, e3, n2) { 1130 super(t3), this.serializationType = C2.RANGE, this.start = e3, this.stop = n2, this.label = this.makeLabel(); 1131 } 1132 makeLabel() { 1133 const t3 = new E2(); 1134 return t3.addRange(this.start, this.stop), t3; 1135 } 1136 matches(t3, e3, n2) { 1137 return t3 >= this.start && t3 <= this.stop; 1138 } 1139 toString() { 1140 return "'" + String.fromCharCode(this.start) + "'..'" + String.fromCharCode(this.stop) + "'"; 1141 } 1142 } 1143 class ut extends C2 { 1144 constructor(t3, e3, n2, s2) { 1145 super(t3), this.serializationType = C2.ACTION, this.ruleIndex = e3, this.actionIndex = void 0 === n2 ? -1 : n2, this.isCtxDependent = void 0 !== s2 && s2, this.isEpsilon = true; 1146 } 1147 matches(t3, e3, n2) { 1148 return false; 1149 } 1150 toString() { 1151 return "action_" + this.ruleIndex + ":" + this.actionIndex; 1152 } 1153 } 1154 class dt extends C2 { 1155 constructor(t3, e3) { 1156 super(t3), this.serializationType = C2.EPSILON, this.isEpsilon = true, this.outermostPrecedenceReturn = e3; 1157 } 1158 matches(t3, e3, n2) { 1159 return false; 1160 } 1161 toString() { 1162 return "epsilon"; 1163 } 1164 } 1165 class pt extends p2 { 1166 constructor(t3, e3, n2) { 1167 super(), this.ruleIndex = void 0 === t3 ? -1 : t3, this.predIndex = void 0 === e3 ? -1 : e3, this.isCtxDependent = void 0 !== n2 && n2; 1168 } 1169 evaluate(t3, e3) { 1170 const n2 = this.isCtxDependent ? e3 : null; 1171 return t3.sempred(n2, this.ruleIndex, this.predIndex); 1172 } 1173 updateHashCode(t3) { 1174 t3.update(this.ruleIndex, this.predIndex, this.isCtxDependent); 1175 } 1176 equals(t3) { 1177 return this === t3 || t3 instanceof pt && this.ruleIndex === t3.ruleIndex && this.predIndex === t3.predIndex && this.isCtxDependent === t3.isCtxDependent; 1178 } 1179 toString() { 1180 return "{" + this.ruleIndex + ":" + this.predIndex + "}?"; 1181 } 1182 } 1183 p2.NONE = new pt(); 1184 class gt extends L2 { 1185 constructor(t3, e3, n2, s2) { 1186 super(t3), this.serializationType = C2.PREDICATE, this.ruleIndex = e3, this.predIndex = n2, this.isCtxDependent = s2, this.isEpsilon = true; 1187 } 1188 matches(t3, e3, n2) { 1189 return false; 1190 } 1191 getPredicate() { 1192 return new pt(this.ruleIndex, this.predIndex, this.isCtxDependent); 1193 } 1194 toString() { 1195 return "pred_" + this.ruleIndex + ":" + this.predIndex; 1196 } 1197 } 1198 class ft extends p2 { 1199 constructor(t3) { 1200 super(), this.precedence = void 0 === t3 ? 0 : t3; 1201 } 1202 evaluate(t3, e3) { 1203 return t3.precpred(e3, this.precedence); 1204 } 1205 evalPrecedence(t3, e3) { 1206 return t3.precpred(e3, this.precedence) ? p2.NONE : null; 1207 } 1208 compareTo(t3) { 1209 return this.precedence - t3.precedence; 1210 } 1211 updateHashCode(t3) { 1212 t3.update(this.precedence); 1213 } 1214 equals(t3) { 1215 return this === t3 || t3 instanceof ft && this.precedence === t3.precedence; 1216 } 1217 toString() { 1218 return "{" + this.precedence + ">=prec}?"; 1219 } 1220 } 1221 p2.PrecedencePredicate = ft; 1222 class xt extends L2 { 1223 constructor(t3, e3) { 1224 super(t3), this.serializationType = C2.PRECEDENCE, this.precedence = e3, this.isEpsilon = true; 1225 } 1226 matches(t3, e3, n2) { 1227 return false; 1228 } 1229 getPredicate() { 1230 return new ft(this.precedence); 1231 } 1232 toString() { 1233 return this.precedence + " >= _p"; 1234 } 1235 } 1236 class Tt { 1237 constructor(t3) { 1238 void 0 === t3 && (t3 = null), this.readOnly = false, this.verifyATN = null === t3 || t3.verifyATN, this.generateRuleBypassTransitions = null !== t3 && t3.generateRuleBypassTransitions; 1239 } 1240 } 1241 Tt.defaultOptions = new Tt(), Tt.defaultOptions.readOnly = true; 1242 class St { 1243 constructor(t3) { 1244 this.actionType = t3, this.isPositionDependent = false; 1245 } 1246 hashCode() { 1247 const t3 = new o2(); 1248 return this.updateHashCode(t3), t3.finish(); 1249 } 1250 updateHashCode(t3) { 1251 t3.update(this.actionType); 1252 } 1253 equals(t3) { 1254 return this === t3; 1255 } 1256 } 1257 class mt extends St { 1258 constructor() { 1259 super(6); 1260 } 1261 execute(t3) { 1262 t3.skip(); 1263 } 1264 toString() { 1265 return "skip"; 1266 } 1267 } 1268 mt.INSTANCE = new mt(); 1269 class Et extends St { 1270 constructor(t3) { 1271 super(0), this.channel = t3; 1272 } 1273 execute(t3) { 1274 t3._channel = this.channel; 1275 } 1276 updateHashCode(t3) { 1277 t3.update(this.actionType, this.channel); 1278 } 1279 equals(t3) { 1280 return this === t3 || t3 instanceof Et && this.channel === t3.channel; 1281 } 1282 toString() { 1283 return "channel(" + this.channel + ")"; 1284 } 1285 } 1286 class _t extends St { 1287 constructor(t3, e3) { 1288 super(1), this.ruleIndex = t3, this.actionIndex = e3, this.isPositionDependent = true; 1289 } 1290 execute(t3) { 1291 t3.action(null, this.ruleIndex, this.actionIndex); 1292 } 1293 updateHashCode(t3) { 1294 t3.update(this.actionType, this.ruleIndex, this.actionIndex); 1295 } 1296 equals(t3) { 1297 return this === t3 || t3 instanceof _t && this.ruleIndex === t3.ruleIndex && this.actionIndex === t3.actionIndex; 1298 } 1299 } 1300 class At extends St { 1301 constructor() { 1302 super(3); 1303 } 1304 execute(t3) { 1305 t3.more(); 1306 } 1307 toString() { 1308 return "more"; 1309 } 1310 } 1311 At.INSTANCE = new At(); 1312 class Ct extends St { 1313 constructor(t3) { 1314 super(7), this.type = t3; 1315 } 1316 execute(t3) { 1317 t3.type = this.type; 1318 } 1319 updateHashCode(t3) { 1320 t3.update(this.actionType, this.type); 1321 } 1322 equals(t3) { 1323 return this === t3 || t3 instanceof Ct && this.type === t3.type; 1324 } 1325 toString() { 1326 return "type(" + this.type + ")"; 1327 } 1328 } 1329 class Nt extends St { 1330 constructor(t3) { 1331 super(5), this.mode = t3; 1332 } 1333 execute(t3) { 1334 t3.pushMode(this.mode); 1335 } 1336 updateHashCode(t3) { 1337 t3.update(this.actionType, this.mode); 1338 } 1339 equals(t3) { 1340 return this === t3 || t3 instanceof Nt && this.mode === t3.mode; 1341 } 1342 toString() { 1343 return "pushMode(" + this.mode + ")"; 1344 } 1345 } 1346 class yt extends St { 1347 constructor() { 1348 super(4); 1349 } 1350 execute(t3) { 1351 t3.popMode(); 1352 } 1353 toString() { 1354 return "popMode"; 1355 } 1356 } 1357 yt.INSTANCE = new yt(); 1358 class It extends St { 1359 constructor(t3) { 1360 super(2), this.mode = t3; 1361 } 1362 execute(t3) { 1363 t3.mode(this.mode); 1364 } 1365 updateHashCode(t3) { 1366 t3.update(this.actionType, this.mode); 1367 } 1368 equals(t3) { 1369 return this === t3 || t3 instanceof It && this.mode === t3.mode; 1370 } 1371 toString() { 1372 return "mode(" + this.mode + ")"; 1373 } 1374 } 1375 function kt(t3, e3) { 1376 const n2 = []; 1377 return n2[t3 - 1] = e3, n2.map((function(t4) { 1378 return e3; 1379 })); 1380 } 1381 class Lt { 1382 constructor(t3) { 1383 null == t3 && (t3 = Tt.defaultOptions), this.deserializationOptions = t3, this.stateFactories = null, this.actionFactories = null; 1384 } 1385 deserialize(t3) { 1386 const e3 = this.reset(t3); 1387 this.checkVersion(e3), e3 && this.skipUUID(); 1388 const n2 = this.readATN(); 1389 this.readStates(n2, e3), this.readRules(n2, e3), this.readModes(n2); 1390 const s2 = []; 1391 return this.readSets(n2, s2, this.readInt.bind(this)), e3 && this.readSets(n2, s2, this.readInt32.bind(this)), this.readEdges(n2, s2), this.readDecisions(n2), this.readLexerActions(n2, e3), this.markPrecedenceDecisions(n2), this.verifyATN(n2), this.deserializationOptions.generateRuleBypassTransitions && 1 === n2.grammarType && (this.generateRuleBypassTransitions(n2), this.verifyATN(n2)), n2; 1392 } 1393 reset(t3) { 1394 if (3 === (t3.charCodeAt ? t3.charCodeAt(0) : t3[0])) { 1395 const e3 = function(t4) { 1396 const e4 = t4.charCodeAt(0); 1397 return e4 > 1 ? e4 - 2 : e4 + 65534; 1398 }, n2 = t3.split("").map(e3); 1399 return n2[0] = t3.charCodeAt(0), this.data = n2, this.pos = 0, true; 1400 } 1401 return this.data = t3, this.pos = 0, false; 1402 } 1403 skipUUID() { 1404 let t3 = 0; 1405 for (; t3++ < 8; ) this.readInt(); 1406 } 1407 checkVersion(t3) { 1408 const e3 = this.readInt(); 1409 if (!t3 && 4 !== e3) throw "Could not deserialize ATN with version " + e3 + " (expected 4)."; 1410 } 1411 readATN() { 1412 const t3 = this.readInt(), e3 = this.readInt(); 1413 return new $(t3, e3); 1414 } 1415 readStates(t3, e3) { 1416 let n2, s2, i3; 1417 const r3 = [], o3 = [], a3 = this.readInt(); 1418 for (let n3 = 0; n3 < a3; n3++) { 1419 const n4 = this.readInt(); 1420 if (n4 === _2.INVALID_TYPE) { 1421 t3.addState(null); 1422 continue; 1423 } 1424 let s3 = this.readInt(); 1425 e3 && 65535 === s3 && (s3 = -1); 1426 const i4 = this.stateFactory(n4, s3); 1427 if (n4 === _2.LOOP_END) { 1428 const t4 = this.readInt(); 1429 r3.push([i4, t4]); 1430 } else if (i4 instanceof Z) { 1431 const t4 = this.readInt(); 1432 o3.push([i4, t4]); 1433 } 1434 t3.addState(i4); 1435 } 1436 for (n2 = 0; n2 < r3.length; n2++) s2 = r3[n2], s2[0].loopBackState = t3.states[s2[1]]; 1437 for (n2 = 0; n2 < o3.length; n2++) s2 = o3[n2], s2[0].endState = t3.states[s2[1]]; 1438 let l3 = this.readInt(); 1439 for (n2 = 0; n2 < l3; n2++) i3 = this.readInt(), t3.states[i3].nonGreedy = true; 1440 let h3 = this.readInt(); 1441 for (n2 = 0; n2 < h3; n2++) i3 = this.readInt(), t3.states[i3].isPrecedenceRule = true; 1442 } 1443 readRules(e3, n2) { 1444 let s2; 1445 const i3 = this.readInt(); 1446 for (0 === e3.grammarType && (e3.ruleToTokenType = kt(i3, 0)), e3.ruleToStartState = kt(i3, 0), s2 = 0; s2 < i3; s2++) { 1447 const i4 = this.readInt(); 1448 if (e3.ruleToStartState[s2] = e3.states[i4], 0 === e3.grammarType) { 1449 let i5 = this.readInt(); 1450 n2 && 65535 === i5 && (i5 = t2.EOF), e3.ruleToTokenType[s2] = i5; 1451 } 1452 } 1453 for (e3.ruleToStopState = kt(i3, 0), s2 = 0; s2 < e3.states.length; s2++) { 1454 const t3 = e3.states[s2]; 1455 t3 instanceof A2 && (e3.ruleToStopState[t3.ruleIndex] = t3, e3.ruleToStartState[t3.ruleIndex].stopState = t3); 1456 } 1457 } 1458 readModes(t3) { 1459 const e3 = this.readInt(); 1460 for (let n2 = 0; n2 < e3; n2++) { 1461 let e4 = this.readInt(); 1462 t3.modeToStartState.push(t3.states[e4]); 1463 } 1464 } 1465 readSets(t3, e3, n2) { 1466 const s2 = this.readInt(); 1467 for (let t4 = 0; t4 < s2; t4++) { 1468 const t5 = new E2(); 1469 e3.push(t5); 1470 const s3 = this.readInt(); 1471 0 !== this.readInt() && t5.addOne(-1); 1472 for (let e4 = 0; e4 < s3; e4++) { 1473 const e5 = n2(), s4 = n2(); 1474 t5.addRange(e5, s4); 1475 } 1476 } 1477 } 1478 readEdges(t3, e3) { 1479 let n2, s2, i3, r3, o3; 1480 const a3 = this.readInt(); 1481 for (n2 = 0; n2 < a3; n2++) { 1482 const n3 = this.readInt(), s3 = this.readInt(), i4 = this.readInt(), o4 = this.readInt(), a4 = this.readInt(), l3 = this.readInt(); 1483 r3 = this.edgeFactory(t3, i4, n3, s3, o4, a4, l3, e3), t3.states[n3].addTransition(r3); 1484 } 1485 for (n2 = 0; n2 < t3.states.length; n2++) for (i3 = t3.states[n2], s2 = 0; s2 < i3.transitions.length; s2++) { 1486 const e4 = i3.transitions[s2]; 1487 if (!(e4 instanceof N2)) continue; 1488 let n3 = -1; 1489 t3.ruleToStartState[e4.target.ruleIndex].isPrecedenceRule && 0 === e4.precedence && (n3 = e4.target.ruleIndex), r3 = new dt(e4.followState, n3), t3.ruleToStopState[e4.target.ruleIndex].addTransition(r3); 1490 } 1491 for (n2 = 0; n2 < t3.states.length; n2++) { 1492 if (i3 = t3.states[n2], i3 instanceof Z) { 1493 if (null === i3.endState) throw "IllegalState"; 1494 if (null !== i3.endState.startState) throw "IllegalState"; 1495 i3.endState.startState = i3; 1496 } 1497 if (i3 instanceof st) for (s2 = 0; s2 < i3.transitions.length; s2++) o3 = i3.transitions[s2].target, o3 instanceof ot && (o3.loopBackState = i3); 1498 else if (i3 instanceof it) for (s2 = 0; s2 < i3.transitions.length; s2++) o3 = i3.transitions[s2].target, o3 instanceof rt && (o3.loopBackState = i3); 1499 } 1500 } 1501 readDecisions(t3) { 1502 const e3 = this.readInt(); 1503 for (let n2 = 0; n2 < e3; n2++) { 1504 const e4 = this.readInt(), s2 = t3.states[e4]; 1505 t3.decisionToState.push(s2), s2.decision = n2; 1506 } 1507 } 1508 readLexerActions(t3, e3) { 1509 if (0 === t3.grammarType) { 1510 const n2 = this.readInt(); 1511 t3.lexerActions = kt(n2, null); 1512 for (let s2 = 0; s2 < n2; s2++) { 1513 const n3 = this.readInt(); 1514 let i3 = this.readInt(); 1515 e3 && 65535 === i3 && (i3 = -1); 1516 let r3 = this.readInt(); 1517 e3 && 65535 === r3 && (r3 = -1), t3.lexerActions[s2] = this.lexerActionFactory(n3, i3, r3); 1518 } 1519 } 1520 } 1521 generateRuleBypassTransitions(t3) { 1522 let e3; 1523 const n2 = t3.ruleToStartState.length; 1524 for (e3 = 0; e3 < n2; e3++) t3.ruleToTokenType[e3] = t3.maxTokenType + e3 + 1; 1525 for (e3 = 0; e3 < n2; e3++) this.generateRuleBypassTransition(t3, e3); 1526 } 1527 generateRuleBypassTransition(t3, e3) { 1528 let n2, s2; 1529 const i3 = new lt(); 1530 i3.ruleIndex = e3, t3.addState(i3); 1531 const r3 = new Q(); 1532 r3.ruleIndex = e3, t3.addState(r3), i3.endState = r3, t3.defineDecisionState(i3), r3.startState = i3; 1533 let o3 = null, a3 = null; 1534 if (t3.ruleToStartState[e3].isPrecedenceRule) { 1535 for (a3 = null, n2 = 0; n2 < t3.states.length; n2++) if (s2 = t3.states[n2], this.stateIsEndStateFor(s2, e3)) { 1536 a3 = s2, o3 = s2.loopBackState.transitions[0]; 1537 break; 1538 } 1539 if (null === o3) throw "Couldn't identify final state of the precedence rule prefix section."; 1540 } else a3 = t3.ruleToStopState[e3]; 1541 for (n2 = 0; n2 < t3.states.length; n2++) { 1542 s2 = t3.states[n2]; 1543 for (let t4 = 0; t4 < s2.transitions.length; t4++) { 1544 const e4 = s2.transitions[t4]; 1545 e4 !== o3 && e4.target === a3 && (e4.target = r3); 1546 } 1547 } 1548 const l3 = t3.ruleToStartState[e3], h3 = l3.transitions.length; 1549 for (; h3 > 0; ) i3.addTransition(l3.transitions[h3 - 1]), l3.transitions = l3.transitions.slice(-1); 1550 t3.ruleToStartState[e3].addTransition(new dt(i3)), r3.addTransition(new dt(a3)); 1551 const c3 = new X(); 1552 t3.addState(c3), c3.addTransition(new ht(r3, t3.ruleToTokenType[e3])), i3.addTransition(new dt(c3)); 1553 } 1554 stateIsEndStateFor(t3, e3) { 1555 if (t3.ruleIndex !== e3) return null; 1556 if (!(t3 instanceof rt)) return null; 1557 const n2 = t3.transitions[t3.transitions.length - 1].target; 1558 return n2 instanceof tt && n2.epsilonOnlyTransitions && n2.transitions[0].target instanceof A2 ? t3 : null; 1559 } 1560 markPrecedenceDecisions(t3) { 1561 for (let e3 = 0; e3 < t3.states.length; e3++) { 1562 const n2 = t3.states[e3]; 1563 if (n2 instanceof rt && t3.ruleToStartState[n2.ruleIndex].isPrecedenceRule) { 1564 const t4 = n2.transitions[n2.transitions.length - 1].target; 1565 t4 instanceof tt && t4.epsilonOnlyTransitions && t4.transitions[0].target instanceof A2 && (n2.isPrecedenceDecision = true); 1566 } 1567 } 1568 } 1569 verifyATN(t3) { 1570 if (this.deserializationOptions.verifyATN) for (let e3 = 0; e3 < t3.states.length; e3++) { 1571 const n2 = t3.states[e3]; 1572 if (null !== n2) if (this.checkCondition(n2.epsilonOnlyTransitions || n2.transitions.length <= 1), n2 instanceof ot) this.checkCondition(null !== n2.loopBackState); 1573 else if (n2 instanceof rt) if (this.checkCondition(null !== n2.loopBackState), this.checkCondition(2 === n2.transitions.length), n2.transitions[0].target instanceof at) this.checkCondition(n2.transitions[1].target instanceof tt), this.checkCondition(!n2.nonGreedy); 1574 else { 1575 if (!(n2.transitions[0].target instanceof tt)) throw "IllegalState"; 1576 this.checkCondition(n2.transitions[1].target instanceof at), this.checkCondition(n2.nonGreedy); 1577 } 1578 else n2 instanceof it ? (this.checkCondition(1 === n2.transitions.length), this.checkCondition(n2.transitions[0].target instanceof rt)) : n2 instanceof tt ? this.checkCondition(null !== n2.loopBackState) : n2 instanceof et ? this.checkCondition(null !== n2.stopState) : n2 instanceof Z ? this.checkCondition(null !== n2.endState) : n2 instanceof Q ? this.checkCondition(null !== n2.startState) : n2 instanceof J ? this.checkCondition(n2.transitions.length <= 1 || n2.decision >= 0) : this.checkCondition(n2.transitions.length <= 1 || n2 instanceof A2); 1579 } 1580 } 1581 checkCondition(t3, e3) { 1582 if (!t3) throw null == e3 && (e3 = "IllegalState"), e3; 1583 } 1584 readInt() { 1585 return this.data[this.pos++]; 1586 } 1587 readInt32() { 1588 return this.readInt() | this.readInt() << 16; 1589 } 1590 edgeFactory(e3, n2, s2, i3, r3, o3, a3, l3) { 1591 const h3 = e3.states[i3]; 1592 switch (n2) { 1593 case C2.EPSILON: 1594 return new dt(h3); 1595 case C2.RANGE: 1596 return new ct(h3, 0 !== a3 ? t2.EOF : r3, o3); 1597 case C2.RULE: 1598 return new N2(e3.states[r3], o3, a3, h3); 1599 case C2.PREDICATE: 1600 return new gt(h3, r3, o3, 0 !== a3); 1601 case C2.PRECEDENCE: 1602 return new xt(h3, r3); 1603 case C2.ATOM: 1604 return new ht(h3, 0 !== a3 ? t2.EOF : r3); 1605 case C2.ACTION: 1606 return new ut(h3, r3, o3, 0 !== a3); 1607 case C2.SET: 1608 return new y2(h3, l3[r3]); 1609 case C2.NOT_SET: 1610 return new I2(h3, l3[r3]); 1611 case C2.WILDCARD: 1612 return new k2(h3); 1613 default: 1614 throw "The specified transition type: " + n2 + " is not valid."; 1615 } 1616 } 1617 stateFactory(t3, e3) { 1618 if (null === this.stateFactories) { 1619 const t4 = []; 1620 t4[_2.INVALID_TYPE] = null, t4[_2.BASIC] = () => new X(), t4[_2.RULE_START] = () => new et(), t4[_2.BLOCK_START] = () => new lt(), t4[_2.PLUS_BLOCK_START] = () => new ot(), t4[_2.STAR_BLOCK_START] = () => new at(), t4[_2.TOKEN_START] = () => new nt(), t4[_2.RULE_STOP] = () => new A2(), t4[_2.BLOCK_END] = () => new Q(), t4[_2.STAR_LOOP_BACK] = () => new it(), t4[_2.STAR_LOOP_ENTRY] = () => new rt(), t4[_2.PLUS_LOOP_BACK] = () => new st(), t4[_2.LOOP_END] = () => new tt(), this.stateFactories = t4; 1621 } 1622 if (t3 > this.stateFactories.length || null === this.stateFactories[t3]) throw "The specified state type " + t3 + " is not valid."; 1623 { 1624 const n2 = this.stateFactories[t3](); 1625 if (null !== n2) return n2.ruleIndex = e3, n2; 1626 } 1627 } 1628 lexerActionFactory(t3, e3, n2) { 1629 if (null === this.actionFactories) { 1630 const t4 = []; 1631 t4[0] = (t5, e4) => new Et(t5), t4[1] = (t5, e4) => new _t(t5, e4), t4[2] = (t5, e4) => new It(t5), t4[3] = (t5, e4) => At.INSTANCE, t4[4] = (t5, e4) => yt.INSTANCE, t4[5] = (t5, e4) => new Nt(t5), t4[6] = (t5, e4) => mt.INSTANCE, t4[7] = (t5, e4) => new Ct(t5), this.actionFactories = t4; 1632 } 1633 if (t3 > this.actionFactories.length || null === this.actionFactories[t3]) throw "The specified lexer action type " + t3 + " is not valid."; 1634 return this.actionFactories[t3](e3, n2); 1635 } 1636 } 1637 class Ot { 1638 syntaxError(t3, e3, n2, s2, i3, r3) { 1639 } 1640 reportAmbiguity(t3, e3, n2, s2, i3, r3, o3) { 1641 } 1642 reportAttemptingFullContext(t3, e3, n2, s2, i3, r3) { 1643 } 1644 reportContextSensitivity(t3, e3, n2, s2, i3, r3) { 1645 } 1646 } 1647 class vt extends Ot { 1648 constructor() { 1649 super(); 1650 } 1651 syntaxError(t3, e3, n2, s2, i3, r3) { 1652 console.error("line " + n2 + ":" + s2 + " " + i3); 1653 } 1654 } 1655 vt.INSTANCE = new vt(); 1656 class Rt extends Ot { 1657 constructor(t3) { 1658 if (super(), null === t3) throw "delegates"; 1659 return this.delegates = t3, this; 1660 } 1661 syntaxError(t3, e3, n2, s2, i3, r3) { 1662 this.delegates.map(((o3) => o3.syntaxError(t3, e3, n2, s2, i3, r3))); 1663 } 1664 reportAmbiguity(t3, e3, n2, s2, i3, r3, o3) { 1665 this.delegates.map(((a3) => a3.reportAmbiguity(t3, e3, n2, s2, i3, r3, o3))); 1666 } 1667 reportAttemptingFullContext(t3, e3, n2, s2, i3, r3) { 1668 this.delegates.map(((o3) => o3.reportAttemptingFullContext(t3, e3, n2, s2, i3, r3))); 1669 } 1670 reportContextSensitivity(t3, e3, n2, s2, i3, r3) { 1671 this.delegates.map(((o3) => o3.reportContextSensitivity(t3, e3, n2, s2, i3, r3))); 1672 } 1673 } 1674 class wt { 1675 constructor() { 1676 this._listeners = [vt.INSTANCE], this._interp = null, this._stateNumber = -1; 1677 } 1678 checkVersion(t3) { 1679 const e3 = "4.13.1"; 1680 e3 !== t3 && console.log("ANTLR runtime and generated code versions disagree: " + e3 + "!=" + t3); 1681 } 1682 addErrorListener(t3) { 1683 this._listeners.push(t3); 1684 } 1685 removeErrorListeners() { 1686 this._listeners = []; 1687 } 1688 getLiteralNames() { 1689 return Object.getPrototypeOf(this).constructor.literalNames || []; 1690 } 1691 getSymbolicNames() { 1692 return Object.getPrototypeOf(this).constructor.symbolicNames || []; 1693 } 1694 getTokenNames() { 1695 if (!this.tokenNames) { 1696 const t3 = this.getLiteralNames(), e3 = this.getSymbolicNames(), n2 = t3.length > e3.length ? t3.length : e3.length; 1697 this.tokenNames = []; 1698 for (let s2 = 0; s2 < n2; s2++) this.tokenNames[s2] = t3[s2] || e3[s2] || "<INVALID"; 1699 } 1700 return this.tokenNames; 1701 } 1702 getTokenTypeMap() { 1703 const e3 = this.getTokenNames(); 1704 if (null === e3) throw "The current recognizer does not provide a list of token names."; 1705 let n2 = this.tokenTypeMapCache[e3]; 1706 return void 0 === n2 && (n2 = e3.reduce((function(t3, e4, n3) { 1707 t3[e4] = n3; 1708 })), n2.EOF = t2.EOF, this.tokenTypeMapCache[e3] = n2), n2; 1709 } 1710 getRuleIndexMap() { 1711 const t3 = this.ruleNames; 1712 if (null === t3) throw "The current recognizer does not provide a list of rule names."; 1713 let e3 = this.ruleIndexMapCache[t3]; 1714 return void 0 === e3 && (e3 = t3.reduce((function(t4, e4, n2) { 1715 t4[e4] = n2; 1716 })), this.ruleIndexMapCache[t3] = e3), e3; 1717 } 1718 getTokenType(e3) { 1719 const n2 = this.getTokenTypeMap()[e3]; 1720 return void 0 !== n2 ? n2 : t2.INVALID_TYPE; 1721 } 1722 getErrorHeader(t3) { 1723 return "line " + t3.getOffendingToken().line + ":" + t3.getOffendingToken().column; 1724 } 1725 getTokenErrorDisplay(e3) { 1726 if (null === e3) return "<no token>"; 1727 let n2 = e3.text; 1728 return null === n2 && (n2 = e3.type === t2.EOF ? "<EOF>" : "<" + e3.type + ">"), n2 = n2.replace("\n", "\\n").replace("\r", "\\r").replace(" ", "\\t"), "'" + n2 + "'"; 1729 } 1730 getErrorListenerDispatch() { 1731 return new Rt(this._listeners); 1732 } 1733 sempred(t3, e3, n2) { 1734 return true; 1735 } 1736 precpred(t3, e3) { 1737 return true; 1738 } 1739 get atn() { 1740 return this._interp.atn; 1741 } 1742 get state() { 1743 return this._stateNumber; 1744 } 1745 set state(t3) { 1746 this._stateNumber = t3; 1747 } 1748 } 1749 wt.tokenTypeMapCache = {}, wt.ruleIndexMapCache = {}; 1750 class Pt extends t2 { 1751 constructor(e3, n2, s2, i3, r3) { 1752 super(), this.source = void 0 !== e3 ? e3 : Pt.EMPTY_SOURCE, this.type = void 0 !== n2 ? n2 : null, this.channel = void 0 !== s2 ? s2 : t2.DEFAULT_CHANNEL, this.start = void 0 !== i3 ? i3 : -1, this.stop = void 0 !== r3 ? r3 : -1, this.tokenIndex = -1, null !== this.source[0] ? (this.line = e3[0].line, this.column = e3[0].column) : this.column = -1; 1753 } 1754 clone() { 1755 const t3 = new Pt(this.source, this.type, this.channel, this.start, this.stop); 1756 return t3.tokenIndex = this.tokenIndex, t3.line = this.line, t3.column = this.column, t3.text = this.text, t3; 1757 } 1758 cloneWithType(e3) { 1759 const n2 = new Pt(this.source, e3, this.channel, this.start, this.stop); 1760 return n2.tokenIndex = this.tokenIndex, n2.line = this.line, n2.column = this.column, e3 === t2.EOF && (n2.text = ""), n2; 1761 } 1762 toString() { 1763 let t3 = this.text; 1764 return t3 = null !== t3 ? t3.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") : "<no text>", "[@" + this.tokenIndex + "," + this.start + ":" + this.stop + "='" + t3 + "',<" + this.type + ">" + (this.channel > 0 ? ",channel=" + this.channel : "") + "," + this.line + ":" + this.column + "]"; 1765 } 1766 get text() { 1767 if (null !== this._text) return this._text; 1768 const t3 = this.getInputStream(); 1769 if (null === t3) return null; 1770 const e3 = t3.size; 1771 return this.start < e3 && this.stop < e3 ? t3.getText(this.start, this.stop) : "<EOF>"; 1772 } 1773 set text(t3) { 1774 this._text = t3; 1775 } 1776 } 1777 Pt.EMPTY_SOURCE = [null, null]; 1778 class bt { 1779 } 1780 class Dt extends bt { 1781 constructor(t3) { 1782 super(), this.copyText = void 0 !== t3 && t3; 1783 } 1784 create(t3, e3, n2, s2, i3, r3, o3, a3) { 1785 const l3 = new Pt(t3, e3, s2, i3, r3); 1786 return l3.line = o3, l3.column = a3, null !== n2 ? l3.text = n2 : this.copyText && null !== t3[1] && (l3.text = t3[1].getText(i3, r3)), l3; 1787 } 1788 createThin(t3, e3) { 1789 const n2 = new Pt(null, t3); 1790 return n2.text = e3, n2; 1791 } 1792 } 1793 Dt.DEFAULT = new Dt(); 1794 class Ft extends Error { 1795 constructor(t3) { 1796 super(t3.message), Error.captureStackTrace && Error.captureStackTrace(this, Ft), this.message = t3.message, this.recognizer = t3.recognizer, this.input = t3.input, this.ctx = t3.ctx, this.offendingToken = null, this.offendingState = -1, null !== this.recognizer && (this.offendingState = this.recognizer.state); 1797 } 1798 getExpectedTokens() { 1799 return null !== this.recognizer ? this.recognizer.atn.getExpectedTokens(this.offendingState, this.ctx) : null; 1800 } 1801 toString() { 1802 return this.message; 1803 } 1804 } 1805 class Mt extends Ft { 1806 constructor(t3, e3, n2, s2) { 1807 super({ message: "", recognizer: t3, input: e3, ctx: null }), this.startIndex = n2, this.deadEndConfigs = s2; 1808 } 1809 toString() { 1810 let t3 = ""; 1811 return this.startIndex >= 0 && this.startIndex < this.input.size && (t3 = this.input.getText(new m2(this.startIndex, this.startIndex))), "LexerNoViableAltException" + t3; 1812 } 1813 } 1814 class Ut extends wt { 1815 constructor(e3) { 1816 super(), this._input = e3, this._factory = Dt.DEFAULT, this._tokenFactorySourcePair = [this, e3], this._interp = null, this._token = null, this._tokenStartCharIndex = -1, this._tokenStartLine = -1, this._tokenStartColumn = -1, this._hitEOF = false, this._channel = t2.DEFAULT_CHANNEL, this._type = t2.INVALID_TYPE, this._modeStack = [], this._mode = Ut.DEFAULT_MODE, this._text = null; 1817 } 1818 reset() { 1819 null !== this._input && this._input.seek(0), this._token = null, this._type = t2.INVALID_TYPE, this._channel = t2.DEFAULT_CHANNEL, this._tokenStartCharIndex = -1, this._tokenStartColumn = -1, this._tokenStartLine = -1, this._text = null, this._hitEOF = false, this._mode = Ut.DEFAULT_MODE, this._modeStack = [], this._interp.reset(); 1820 } 1821 nextToken() { 1822 if (null === this._input) throw "nextToken requires a non-null input stream."; 1823 const e3 = this._input.mark(); 1824 try { 1825 for (; ; ) { 1826 if (this._hitEOF) return this.emitEOF(), this._token; 1827 this._token = null, this._channel = t2.DEFAULT_CHANNEL, this._tokenStartCharIndex = this._input.index, this._tokenStartColumn = this._interp.column, this._tokenStartLine = this._interp.line, this._text = null; 1828 let e4 = false; 1829 for (; ; ) { 1830 this._type = t2.INVALID_TYPE; 1831 let n2 = Ut.SKIP; 1832 try { 1833 n2 = this._interp.match(this._input, this._mode); 1834 } catch (t3) { 1835 if (!(t3 instanceof Ft)) throw console.log(t3.stack), t3; 1836 this.notifyListeners(t3), this.recover(t3); 1837 } 1838 if (this._input.LA(1) === t2.EOF && (this._hitEOF = true), this._type === t2.INVALID_TYPE && (this._type = n2), this._type === Ut.SKIP) { 1839 e4 = true; 1840 break; 1841 } 1842 if (this._type !== Ut.MORE) break; 1843 } 1844 if (!e4) return null === this._token && this.emit(), this._token; 1845 } 1846 } finally { 1847 this._input.release(e3); 1848 } 1849 } 1850 skip() { 1851 this._type = Ut.SKIP; 1852 } 1853 more() { 1854 this._type = Ut.MORE; 1855 } 1856 mode(t3) { 1857 this._mode = t3; 1858 } 1859 pushMode(t3) { 1860 this._interp.debug && console.log("pushMode " + t3), this._modeStack.push(this._mode), this.mode(t3); 1861 } 1862 popMode() { 1863 if (0 === this._modeStack.length) throw "Empty Stack"; 1864 return this._interp.debug && console.log("popMode back to " + this._modeStack.slice(0, -1)), this.mode(this._modeStack.pop()), this._mode; 1865 } 1866 emitToken(t3) { 1867 this._token = t3; 1868 } 1869 emit() { 1870 const t3 = this._factory.create(this._tokenFactorySourcePair, this._type, this._text, this._channel, this._tokenStartCharIndex, this.getCharIndex() - 1, this._tokenStartLine, this._tokenStartColumn); 1871 return this.emitToken(t3), t3; 1872 } 1873 emitEOF() { 1874 const e3 = this.column, n2 = this.line, s2 = this._factory.create(this._tokenFactorySourcePair, t2.EOF, null, t2.DEFAULT_CHANNEL, this._input.index, this._input.index - 1, n2, e3); 1875 return this.emitToken(s2), s2; 1876 } 1877 getCharIndex() { 1878 return this._input.index; 1879 } 1880 getAllTokens() { 1881 const e3 = []; 1882 let n2 = this.nextToken(); 1883 for (; n2.type !== t2.EOF; ) e3.push(n2), n2 = this.nextToken(); 1884 return e3; 1885 } 1886 notifyListeners(t3) { 1887 const e3 = this._tokenStartCharIndex, n2 = this._input.index, s2 = this._input.getText(e3, n2), i3 = "token recognition error at: '" + this.getErrorDisplay(s2) + "'"; 1888 this.getErrorListenerDispatch().syntaxError(this, null, this._tokenStartLine, this._tokenStartColumn, i3, t3); 1889 } 1890 getErrorDisplay(t3) { 1891 const e3 = []; 1892 for (let n2 = 0; n2 < t3.length; n2++) e3.push(t3[n2]); 1893 return e3.join(""); 1894 } 1895 getErrorDisplayForChar(e3) { 1896 return e3.charCodeAt(0) === t2.EOF ? "<EOF>" : "\n" === e3 ? "\\n" : " " === e3 ? "\\t" : "\r" === e3 ? "\\r" : e3; 1897 } 1898 getCharErrorDisplay(t3) { 1899 return "'" + this.getErrorDisplayForChar(t3) + "'"; 1900 } 1901 recover(e3) { 1902 this._input.LA(1) !== t2.EOF && (e3 instanceof Mt ? this._interp.consume(this._input) : this._input.consume()); 1903 } 1904 get inputStream() { 1905 return this._input; 1906 } 1907 set inputStream(t3) { 1908 this._input = null, this._tokenFactorySourcePair = [this, this._input], this.reset(), this._input = t3, this._tokenFactorySourcePair = [this, this._input]; 1909 } 1910 get sourceName() { 1911 return this._input.sourceName; 1912 } 1913 get type() { 1914 return this._type; 1915 } 1916 set type(t3) { 1917 this._type = t3; 1918 } 1919 get line() { 1920 return this._interp.line; 1921 } 1922 set line(t3) { 1923 this._interp.line = t3; 1924 } 1925 get column() { 1926 return this._interp.column; 1927 } 1928 set column(t3) { 1929 this._interp.column = t3; 1930 } 1931 get text() { 1932 return null !== this._text ? this._text : this._interp.getText(this._input); 1933 } 1934 set text(t3) { 1935 this._text = t3; 1936 } 1937 } 1938 function Bt(t3) { 1939 return t3.hashCodeForConfigSet(); 1940 } 1941 function Vt(t3, e3) { 1942 return t3 === e3 || null !== t3 && null !== e3 && t3.equalsForConfigSet(e3); 1943 } 1944 Ut.DEFAULT_MODE = 0, Ut.MORE = -2, Ut.SKIP = -3, Ut.DEFAULT_TOKEN_CHANNEL = t2.DEFAULT_CHANNEL, Ut.HIDDEN = t2.HIDDEN_CHANNEL, Ut.MIN_CHAR_VALUE = 0, Ut.MAX_CHAR_VALUE = 1114111; 1945 class zt { 1946 constructor(t3) { 1947 this.configLookup = new d2(Bt, Vt), this.fullCtx = void 0 === t3 || t3, this.readOnly = false, this.configs = [], this.uniqueAlt = 0, this.conflictingAlts = null, this.hasSemanticContext = false, this.dipsIntoOuterContext = false, this.cachedHashCode = -1; 1948 } 1949 add(t3, e3) { 1950 if (void 0 === e3 && (e3 = null), this.readOnly) throw "This set is readonly"; 1951 t3.semanticContext !== p2.NONE && (this.hasSemanticContext = true), t3.reachesIntoOuterContext > 0 && (this.dipsIntoOuterContext = true); 1952 const n2 = this.configLookup.add(t3); 1953 if (n2 === t3) return this.cachedHashCode = -1, this.configs.push(t3), true; 1954 const s2 = !this.fullCtx, i3 = G(n2.context, t3.context, s2, e3); 1955 return n2.reachesIntoOuterContext = Math.max(n2.reachesIntoOuterContext, t3.reachesIntoOuterContext), t3.precedenceFilterSuppressed && (n2.precedenceFilterSuppressed = true), n2.context = i3, true; 1956 } 1957 getStates() { 1958 const t3 = new d2(); 1959 for (let e3 = 0; e3 < this.configs.length; e3++) t3.add(this.configs[e3].state); 1960 return t3; 1961 } 1962 getPredicates() { 1963 const t3 = []; 1964 for (let e3 = 0; e3 < this.configs.length; e3++) { 1965 const n2 = this.configs[e3].semanticContext; 1966 n2 !== p2.NONE && t3.push(n2.semanticContext); 1967 } 1968 return t3; 1969 } 1970 optimizeConfigs(t3) { 1971 if (this.readOnly) throw "This set is readonly"; 1972 if (0 !== this.configLookup.length) for (let e3 = 0; e3 < this.configs.length; e3++) { 1973 const n2 = this.configs[e3]; 1974 n2.context = t3.getCachedContext(n2.context); 1975 } 1976 } 1977 addAll(t3) { 1978 for (let e3 = 0; e3 < t3.length; e3++) this.add(t3[e3]); 1979 return false; 1980 } 1981 equals(t3) { 1982 return this === t3 || t3 instanceof zt && e2(this.configs, t3.configs) && this.fullCtx === t3.fullCtx && this.uniqueAlt === t3.uniqueAlt && this.conflictingAlts === t3.conflictingAlts && this.hasSemanticContext === t3.hasSemanticContext && this.dipsIntoOuterContext === t3.dipsIntoOuterContext; 1983 } 1984 hashCode() { 1985 const t3 = new o2(); 1986 return t3.update(this.configs), t3.finish(); 1987 } 1988 updateHashCode(t3) { 1989 this.readOnly ? (-1 === this.cachedHashCode && (this.cachedHashCode = this.hashCode()), t3.update(this.cachedHashCode)) : t3.update(this.hashCode()); 1990 } 1991 isEmpty() { 1992 return 0 === this.configs.length; 1993 } 1994 contains(t3) { 1995 if (null === this.configLookup) throw "This method is not implemented for readonly sets."; 1996 return this.configLookup.contains(t3); 1997 } 1998 containsFast(t3) { 1999 if (null === this.configLookup) throw "This method is not implemented for readonly sets."; 2000 return this.configLookup.containsFast(t3); 2001 } 2002 clear() { 2003 if (this.readOnly) throw "This set is readonly"; 2004 this.configs = [], this.cachedHashCode = -1, this.configLookup = new d2(); 2005 } 2006 setReadonly(t3) { 2007 this.readOnly = t3, t3 && (this.configLookup = null); 2008 } 2009 toString() { 2010 return c2(this.configs) + (this.hasSemanticContext ? ",hasSemanticContext=" + this.hasSemanticContext : "") + (this.uniqueAlt !== $.INVALID_ALT_NUMBER ? ",uniqueAlt=" + this.uniqueAlt : "") + (null !== this.conflictingAlts ? ",conflictingAlts=" + this.conflictingAlts : "") + (this.dipsIntoOuterContext ? ",dipsIntoOuterContext" : ""); 2011 } 2012 get items() { 2013 return this.configs; 2014 } 2015 get length() { 2016 return this.configs.length; 2017 } 2018 } 2019 class qt { 2020 constructor(t3, e3) { 2021 return null === t3 && (t3 = -1), null === e3 && (e3 = new zt()), this.stateNumber = t3, this.configs = e3, this.edges = null, this.isAcceptState = false, this.prediction = 0, this.lexerActionExecutor = null, this.requiresFullContext = false, this.predicates = null, this; 2022 } 2023 getAltSet() { 2024 const t3 = new d2(); 2025 if (null !== this.configs) for (let e3 = 0; e3 < this.configs.length; e3++) { 2026 const n2 = this.configs[e3]; 2027 t3.add(n2.alt); 2028 } 2029 return 0 === t3.length ? null : t3; 2030 } 2031 equals(t3) { 2032 return this === t3 || t3 instanceof qt && this.configs.equals(t3.configs); 2033 } 2034 toString() { 2035 let t3 = this.stateNumber + ":" + this.configs; 2036 return this.isAcceptState && (t3 += "=>", null !== this.predicates ? t3 += this.predicates : t3 += this.prediction), t3; 2037 } 2038 hashCode() { 2039 const t3 = new o2(); 2040 return t3.update(this.configs), t3.finish(); 2041 } 2042 } 2043 class Ht { 2044 constructor(t3, e3) { 2045 return this.atn = t3, this.sharedContextCache = e3, this; 2046 } 2047 getCachedContext(t3) { 2048 if (null === this.sharedContextCache) return t3; 2049 const e3 = new H(); 2050 return Y(t3, this.sharedContextCache, e3); 2051 } 2052 } 2053 Ht.ERROR = new qt(2147483647, new zt()); 2054 class Kt extends zt { 2055 constructor() { 2056 super(), this.configLookup = new d2(); 2057 } 2058 } 2059 class Yt extends S2 { 2060 constructor(t3, e3) { 2061 super(t3, e3); 2062 const n2 = t3.lexerActionExecutor || null; 2063 return this.lexerActionExecutor = n2 || (null !== e3 ? e3.lexerActionExecutor : null), this.passedThroughNonGreedyDecision = null !== e3 && this.checkNonGreedyDecision(e3, this.state), this.hashCodeForConfigSet = Yt.prototype.hashCode, this.equalsForConfigSet = Yt.prototype.equals, this; 2064 } 2065 updateHashCode(t3) { 2066 t3.update(this.state.stateNumber, this.alt, this.context, this.semanticContext, this.passedThroughNonGreedyDecision, this.lexerActionExecutor); 2067 } 2068 equals(t3) { 2069 return this === t3 || t3 instanceof Yt && this.passedThroughNonGreedyDecision === t3.passedThroughNonGreedyDecision && (this.lexerActionExecutor ? this.lexerActionExecutor.equals(t3.lexerActionExecutor) : !t3.lexerActionExecutor) && super.equals(t3); 2070 } 2071 checkNonGreedyDecision(t3, e3) { 2072 return t3.passedThroughNonGreedyDecision || e3 instanceof J && e3.nonGreedy; 2073 } 2074 } 2075 class Gt extends St { 2076 constructor(t3, e3) { 2077 super(e3.actionType), this.offset = t3, this.action = e3, this.isPositionDependent = true; 2078 } 2079 execute(t3) { 2080 this.action.execute(t3); 2081 } 2082 updateHashCode(t3) { 2083 t3.update(this.actionType, this.offset, this.action); 2084 } 2085 equals(t3) { 2086 return this === t3 || t3 instanceof Gt && this.offset === t3.offset && this.action === t3.action; 2087 } 2088 } 2089 class jt { 2090 constructor(t3) { 2091 return this.lexerActions = null === t3 ? [] : t3, this.cachedHashCode = o2.hashStuff(t3), this; 2092 } 2093 fixOffsetBeforeMatch(t3) { 2094 let e3 = null; 2095 for (let n2 = 0; n2 < this.lexerActions.length; n2++) !this.lexerActions[n2].isPositionDependent || this.lexerActions[n2] instanceof Gt || (null === e3 && (e3 = this.lexerActions.concat([])), e3[n2] = new Gt(t3, this.lexerActions[n2])); 2096 return null === e3 ? this : new jt(e3); 2097 } 2098 execute(t3, e3, n2) { 2099 let s2 = false; 2100 const i3 = e3.index; 2101 try { 2102 for (let r3 = 0; r3 < this.lexerActions.length; r3++) { 2103 let o3 = this.lexerActions[r3]; 2104 if (o3 instanceof Gt) { 2105 const t4 = o3.offset; 2106 e3.seek(n2 + t4), o3 = o3.action, s2 = n2 + t4 !== i3; 2107 } else o3.isPositionDependent && (e3.seek(i3), s2 = false); 2108 o3.execute(t3); 2109 } 2110 } finally { 2111 s2 && e3.seek(i3); 2112 } 2113 } 2114 hashCode() { 2115 return this.cachedHashCode; 2116 } 2117 updateHashCode(t3) { 2118 t3.update(this.cachedHashCode); 2119 } 2120 equals(t3) { 2121 if (this === t3) return true; 2122 if (t3 instanceof jt) { 2123 if (this.cachedHashCode != t3.cachedHashCode) return false; 2124 if (this.lexerActions.length != t3.lexerActions.length) return false; 2125 { 2126 const e3 = this.lexerActions.length; 2127 for (let n2 = 0; n2 < e3; ++n2) if (!this.lexerActions[n2].equals(t3.lexerActions[n2])) return false; 2128 return true; 2129 } 2130 } 2131 return false; 2132 } 2133 static append(t3, e3) { 2134 if (null === t3) return new jt([e3]); 2135 const n2 = t3.lexerActions.concat([e3]); 2136 return new jt(n2); 2137 } 2138 } 2139 function Wt(t3) { 2140 t3.index = -1, t3.line = 0, t3.column = -1, t3.dfaState = null; 2141 } 2142 class $t { 2143 constructor() { 2144 Wt(this); 2145 } 2146 reset() { 2147 Wt(this); 2148 } 2149 } 2150 class Xt extends Ht { 2151 constructor(t3, e3, n2, s2) { 2152 super(e3, s2), this.decisionToDFA = n2, this.recog = t3, this.startIndex = -1, this.line = 1, this.column = 0, this.mode = Ut.DEFAULT_MODE, this.prevAccept = new $t(); 2153 } 2154 copyState(t3) { 2155 this.column = t3.column, this.line = t3.line, this.mode = t3.mode, this.startIndex = t3.startIndex; 2156 } 2157 match(t3, e3) { 2158 this.mode = e3; 2159 const n2 = t3.mark(); 2160 try { 2161 this.startIndex = t3.index, this.prevAccept.reset(); 2162 const n3 = this.decisionToDFA[e3]; 2163 return null === n3.s0 ? this.matchATN(t3) : this.execATN(t3, n3.s0); 2164 } finally { 2165 t3.release(n2); 2166 } 2167 } 2168 reset() { 2169 this.prevAccept.reset(), this.startIndex = -1, this.line = 1, this.column = 0, this.mode = Ut.DEFAULT_MODE; 2170 } 2171 matchATN(t3) { 2172 const e3 = this.atn.modeToStartState[this.mode]; 2173 Xt.debug && console.log("matchATN mode " + this.mode + " start: " + e3); 2174 const n2 = this.mode, s2 = this.computeStartState(t3, e3), i3 = s2.hasSemanticContext; 2175 s2.hasSemanticContext = false; 2176 const r3 = this.addDFAState(s2); 2177 i3 || (this.decisionToDFA[this.mode].s0 = r3); 2178 const o3 = this.execATN(t3, r3); 2179 return Xt.debug && console.log("DFA after matchATN: " + this.decisionToDFA[n2].toLexerString()), o3; 2180 } 2181 execATN(e3, n2) { 2182 Xt.debug && console.log("start state closure=" + n2.configs), n2.isAcceptState && this.captureSimState(this.prevAccept, e3, n2); 2183 let s2 = e3.LA(1), i3 = n2; 2184 for (; ; ) { 2185 Xt.debug && console.log("execATN loop starting closure: " + i3.configs); 2186 let n3 = this.getExistingTargetState(i3, s2); 2187 if (null === n3 && (n3 = this.computeTargetState(e3, i3, s2)), n3 === Ht.ERROR) break; 2188 if (s2 !== t2.EOF && this.consume(e3), n3.isAcceptState && (this.captureSimState(this.prevAccept, e3, n3), s2 === t2.EOF)) break; 2189 s2 = e3.LA(1), i3 = n3; 2190 } 2191 return this.failOrAccept(this.prevAccept, e3, i3.configs, s2); 2192 } 2193 getExistingTargetState(t3, e3) { 2194 if (null === t3.edges || e3 < Xt.MIN_DFA_EDGE || e3 > Xt.MAX_DFA_EDGE) return null; 2195 let n2 = t3.edges[e3 - Xt.MIN_DFA_EDGE]; 2196 return void 0 === n2 && (n2 = null), Xt.debug && null !== n2 && console.log("reuse state " + t3.stateNumber + " edge to " + n2.stateNumber), n2; 2197 } 2198 computeTargetState(t3, e3, n2) { 2199 const s2 = new Kt(); 2200 return this.getReachableConfigSet(t3, e3.configs, s2, n2), 0 === s2.items.length ? (s2.hasSemanticContext || this.addDFAEdge(e3, n2, Ht.ERROR), Ht.ERROR) : this.addDFAEdge(e3, n2, null, s2); 2201 } 2202 failOrAccept(e3, n2, s2, i3) { 2203 if (null !== this.prevAccept.dfaState) { 2204 const t3 = e3.dfaState.lexerActionExecutor; 2205 return this.accept(n2, t3, this.startIndex, e3.index, e3.line, e3.column), e3.dfaState.prediction; 2206 } 2207 if (i3 === t2.EOF && n2.index === this.startIndex) return t2.EOF; 2208 throw new Mt(this.recog, n2, this.startIndex, s2); 2209 } 2210 getReachableConfigSet(e3, n2, s2, i3) { 2211 let r3 = $.INVALID_ALT_NUMBER; 2212 for (let o3 = 0; o3 < n2.items.length; o3++) { 2213 const a3 = n2.items[o3], l3 = a3.alt === r3; 2214 if (!l3 || !a3.passedThroughNonGreedyDecision) { 2215 Xt.debug && console.log("testing %s at %s\n", this.getTokenName(i3), a3.toString(this.recog, true)); 2216 for (let n3 = 0; n3 < a3.state.transitions.length; n3++) { 2217 const o4 = a3.state.transitions[n3], h3 = this.getReachableTarget(o4, i3); 2218 if (null !== h3) { 2219 let n4 = a3.lexerActionExecutor; 2220 null !== n4 && (n4 = n4.fixOffsetBeforeMatch(e3.index - this.startIndex)); 2221 const o5 = i3 === t2.EOF, c3 = new Yt({ state: h3, lexerActionExecutor: n4 }, a3); 2222 this.closure(e3, c3, s2, l3, true, o5) && (r3 = a3.alt); 2223 } 2224 } 2225 } 2226 } 2227 } 2228 accept(t3, e3, n2, s2, i3, r3) { 2229 Xt.debug && console.log("ACTION %s\n", e3), t3.seek(s2), this.line = i3, this.column = r3, null !== e3 && null !== this.recog && e3.execute(this.recog, t3, n2); 2230 } 2231 getReachableTarget(t3, e3) { 2232 return t3.matches(e3, 0, Ut.MAX_CHAR_VALUE) ? t3.target : null; 2233 } 2234 computeStartState(t3, e3) { 2235 const n2 = U.EMPTY, s2 = new Kt(); 2236 for (let i3 = 0; i3 < e3.transitions.length; i3++) { 2237 const r3 = e3.transitions[i3].target, o3 = new Yt({ state: r3, alt: i3 + 1, context: n2 }, null); 2238 this.closure(t3, o3, s2, false, false, false); 2239 } 2240 return s2; 2241 } 2242 closure(t3, e3, n2, s2, i3, r3) { 2243 let o3 = null; 2244 if (Xt.debug && console.log("closure(" + e3.toString(this.recog, true) + ")"), e3.state instanceof A2) { 2245 if (Xt.debug && (null !== this.recog ? console.log("closure at %s rule stop %s\n", this.recog.ruleNames[e3.state.ruleIndex], e3) : console.log("closure at rule stop %s\n", e3)), null === e3.context || e3.context.hasEmptyPath()) { 2246 if (null === e3.context || e3.context.isEmpty()) return n2.add(e3), true; 2247 n2.add(new Yt({ state: e3.state, context: U.EMPTY }, e3)), s2 = true; 2248 } 2249 if (null !== e3.context && !e3.context.isEmpty()) { 2250 for (let a3 = 0; a3 < e3.context.length; a3++) if (e3.context.getReturnState(a3) !== U.EMPTY_RETURN_STATE) { 2251 const l3 = e3.context.getParent(a3), h3 = this.atn.states[e3.context.getReturnState(a3)]; 2252 o3 = new Yt({ state: h3, context: l3 }, e3), s2 = this.closure(t3, o3, n2, s2, i3, r3); 2253 } 2254 } 2255 return s2; 2256 } 2257 e3.state.epsilonOnlyTransitions || s2 && e3.passedThroughNonGreedyDecision || n2.add(e3); 2258 for (let a3 = 0; a3 < e3.state.transitions.length; a3++) { 2259 const l3 = e3.state.transitions[a3]; 2260 o3 = this.getEpsilonTarget(t3, e3, l3, n2, i3, r3), null !== o3 && (s2 = this.closure(t3, o3, n2, s2, i3, r3)); 2261 } 2262 return s2; 2263 } 2264 getEpsilonTarget(e3, n2, s2, i3, r3, o3) { 2265 let a3 = null; 2266 if (s2.serializationType === C2.RULE) { 2267 const t3 = V.create(n2.context, s2.followState.stateNumber); 2268 a3 = new Yt({ state: s2.target, context: t3 }, n2); 2269 } else { 2270 if (s2.serializationType === C2.PRECEDENCE) throw "Precedence predicates are not supported in lexers."; 2271 if (s2.serializationType === C2.PREDICATE) Xt.debug && console.log("EVAL rule " + s2.ruleIndex + ":" + s2.predIndex), i3.hasSemanticContext = true, this.evaluatePredicate(e3, s2.ruleIndex, s2.predIndex, r3) && (a3 = new Yt({ state: s2.target }, n2)); 2272 else if (s2.serializationType === C2.ACTION) if (null === n2.context || n2.context.hasEmptyPath()) { 2273 const t3 = jt.append(n2.lexerActionExecutor, this.atn.lexerActions[s2.actionIndex]); 2274 a3 = new Yt({ state: s2.target, lexerActionExecutor: t3 }, n2); 2275 } else a3 = new Yt({ state: s2.target }, n2); 2276 else s2.serializationType === C2.EPSILON ? a3 = new Yt({ state: s2.target }, n2) : s2.serializationType !== C2.ATOM && s2.serializationType !== C2.RANGE && s2.serializationType !== C2.SET || o3 && s2.matches(t2.EOF, 0, Ut.MAX_CHAR_VALUE) && (a3 = new Yt({ state: s2.target }, n2)); 2277 } 2278 return a3; 2279 } 2280 evaluatePredicate(t3, e3, n2, s2) { 2281 if (null === this.recog) return true; 2282 if (!s2) return this.recog.sempred(null, e3, n2); 2283 const i3 = this.column, r3 = this.line, o3 = t3.index, a3 = t3.mark(); 2284 try { 2285 return this.consume(t3), this.recog.sempred(null, e3, n2); 2286 } finally { 2287 this.column = i3, this.line = r3, t3.seek(o3), t3.release(a3); 2288 } 2289 } 2290 captureSimState(t3, e3, n2) { 2291 t3.index = e3.index, t3.line = this.line, t3.column = this.column, t3.dfaState = n2; 2292 } 2293 addDFAEdge(t3, e3, n2, s2) { 2294 if (void 0 === n2 && (n2 = null), void 0 === s2 && (s2 = null), null === n2 && null !== s2) { 2295 const t4 = s2.hasSemanticContext; 2296 if (s2.hasSemanticContext = false, n2 = this.addDFAState(s2), t4) return n2; 2297 } 2298 return e3 < Xt.MIN_DFA_EDGE || e3 > Xt.MAX_DFA_EDGE || (Xt.debug && console.log("EDGE " + t3 + " -> " + n2 + " upon " + e3), null === t3.edges && (t3.edges = []), t3.edges[e3 - Xt.MIN_DFA_EDGE] = n2), n2; 2299 } 2300 addDFAState(t3) { 2301 const e3 = new qt(null, t3); 2302 let n2 = null; 2303 for (let e4 = 0; e4 < t3.items.length; e4++) { 2304 const s3 = t3.items[e4]; 2305 if (s3.state instanceof A2) { 2306 n2 = s3; 2307 break; 2308 } 2309 } 2310 null !== n2 && (e3.isAcceptState = true, e3.lexerActionExecutor = n2.lexerActionExecutor, e3.prediction = this.atn.ruleToTokenType[n2.state.ruleIndex]); 2311 const s2 = this.decisionToDFA[this.mode], i3 = s2.states.get(e3); 2312 if (null !== i3) return i3; 2313 const r3 = e3; 2314 return r3.stateNumber = s2.states.length, t3.setReadonly(true), r3.configs = t3, s2.states.add(r3), r3; 2315 } 2316 getDFA(t3) { 2317 return this.decisionToDFA[t3]; 2318 } 2319 getText(t3) { 2320 return t3.getText(this.startIndex, t3.index - 1); 2321 } 2322 consume(t3) { 2323 t3.LA(1) === "\n".charCodeAt(0) ? (this.line += 1, this.column = 0) : this.column += 1, t3.consume(); 2324 } 2325 getTokenName(t3) { 2326 return -1 === t3 ? "EOF" : "'" + String.fromCharCode(t3) + "'"; 2327 } 2328 } 2329 Xt.debug = false, Xt.dfa_debug = false, Xt.MIN_DFA_EDGE = 0, Xt.MAX_DFA_EDGE = 127; 2330 class Jt { 2331 constructor(t3, e3) { 2332 this.alt = e3, this.pred = t3; 2333 } 2334 toString() { 2335 return "(" + this.pred + ", " + this.alt + ")"; 2336 } 2337 } 2338 class Zt { 2339 constructor() { 2340 this.data = {}; 2341 } 2342 get(t3) { 2343 return this.data["k-" + t3] || null; 2344 } 2345 set(t3, e3) { 2346 this.data["k-" + t3] = e3; 2347 } 2348 values() { 2349 return Object.keys(this.data).filter(((t3) => t3.startsWith("k-"))).map(((t3) => this.data[t3]), this); 2350 } 2351 } 2352 const Qt = { SLL: 0, LL: 1, LL_EXACT_AMBIG_DETECTION: 2, hasSLLConflictTerminatingPrediction: function(t3, e3) { 2353 if (Qt.allConfigsInRuleStopStates(e3)) return true; 2354 if (t3 === Qt.SLL && e3.hasSemanticContext) { 2355 const t4 = new zt(); 2356 for (let n3 = 0; n3 < e3.items.length; n3++) { 2357 let s2 = e3.items[n3]; 2358 s2 = new S2({ semanticContext: p2.NONE }, s2), t4.add(s2); 2359 } 2360 e3 = t4; 2361 } 2362 const n2 = Qt.getConflictingAltSubsets(e3); 2363 return Qt.hasConflictingAltSet(n2) && !Qt.hasStateAssociatedWithOneAlt(e3); 2364 }, hasConfigInRuleStopState: function(t3) { 2365 for (let e3 = 0; e3 < t3.items.length; e3++) if (t3.items[e3].state instanceof A2) return true; 2366 return false; 2367 }, allConfigsInRuleStopStates: function(t3) { 2368 for (let e3 = 0; e3 < t3.items.length; e3++) if (!(t3.items[e3].state instanceof A2)) return false; 2369 return true; 2370 }, resolvesToJustOneViableAlt: function(t3) { 2371 return Qt.getSingleViableAlt(t3); 2372 }, allSubsetsConflict: function(t3) { 2373 return !Qt.hasNonConflictingAltSet(t3); 2374 }, hasNonConflictingAltSet: function(t3) { 2375 for (let e3 = 0; e3 < t3.length; e3++) if (1 === t3[e3].length) return true; 2376 return false; 2377 }, hasConflictingAltSet: function(t3) { 2378 for (let e3 = 0; e3 < t3.length; e3++) if (t3[e3].length > 1) return true; 2379 return false; 2380 }, allSubsetsEqual: function(t3) { 2381 let e3 = null; 2382 for (let n2 = 0; n2 < t3.length; n2++) { 2383 const s2 = t3[n2]; 2384 if (null === e3) e3 = s2; 2385 else if (s2 !== e3) return false; 2386 } 2387 return true; 2388 }, getUniqueAlt: function(t3) { 2389 const e3 = Qt.getAlts(t3); 2390 return 1 === e3.length ? e3.minValue() : $.INVALID_ALT_NUMBER; 2391 }, getAlts: function(t3) { 2392 const e3 = new j(); 2393 return t3.map((function(t4) { 2394 e3.or(t4); 2395 })), e3; 2396 }, getConflictingAltSubsets: function(t3) { 2397 const e3 = new H(); 2398 return e3.hashFunction = function(t4) { 2399 o2.hashStuff(t4.state.stateNumber, t4.context); 2400 }, e3.equalsFunction = function(t4, e4) { 2401 return t4.state.stateNumber === e4.state.stateNumber && t4.context.equals(e4.context); 2402 }, t3.items.map((function(t4) { 2403 let n2 = e3.get(t4); 2404 null === n2 && (n2 = new j(), e3.set(t4, n2)), n2.add(t4.alt); 2405 })), e3.getValues(); 2406 }, getStateToAltMap: function(t3) { 2407 const e3 = new Zt(); 2408 return t3.items.map((function(t4) { 2409 let n2 = e3.get(t4.state); 2410 null === n2 && (n2 = new j(), e3.set(t4.state, n2)), n2.add(t4.alt); 2411 })), e3; 2412 }, hasStateAssociatedWithOneAlt: function(t3) { 2413 const e3 = Qt.getStateToAltMap(t3).values(); 2414 for (let t4 = 0; t4 < e3.length; t4++) if (1 === e3[t4].length) return true; 2415 return false; 2416 }, getSingleViableAlt: function(t3) { 2417 let e3 = null; 2418 for (let n2 = 0; n2 < t3.length; n2++) { 2419 const s2 = t3[n2].minValue(); 2420 if (null === e3) e3 = s2; 2421 else if (e3 !== s2) return $.INVALID_ALT_NUMBER; 2422 } 2423 return e3; 2424 } }, te = Qt; 2425 class ee extends Ft { 2426 constructor(t3, e3, n2, s2, i3, r3) { 2427 r3 = r3 || t3._ctx, s2 = s2 || t3.getCurrentToken(), n2 = n2 || t3.getCurrentToken(), e3 = e3 || t3.getInputStream(), super({ message: "", recognizer: t3, input: e3, ctx: r3 }), this.deadEndConfigs = i3, this.startToken = n2, this.offendingToken = s2; 2428 } 2429 } 2430 class ne { 2431 constructor(t3) { 2432 this.defaultMapCtor = t3 || H, this.cacheMap = new this.defaultMapCtor(); 2433 } 2434 get(t3, e3) { 2435 const n2 = this.cacheMap.get(t3) || null; 2436 return null === n2 ? null : n2.get(e3) || null; 2437 } 2438 set(t3, e3, n2) { 2439 let s2 = this.cacheMap.get(t3) || null; 2440 null === s2 && (s2 = new this.defaultMapCtor(), this.cacheMap.set(t3, s2)), s2.set(e3, n2); 2441 } 2442 } 2443 class se extends Ht { 2444 constructor(t3, e3, n2, s2) { 2445 super(e3, s2), this.parser = t3, this.decisionToDFA = n2, this.predictionMode = te.LL, this._input = null, this._startIndex = 0, this._outerContext = null, this._dfa = null, this.mergeCache = null, this.debug = false, this.debug_closure = false, this.debug_add = false, this.trace_atn_sim = false, this.dfa_debug = false, this.retry_debug = false; 2446 } 2447 reset() { 2448 } 2449 adaptivePredict(t3, e3, n2) { 2450 (this.debug || this.trace_atn_sim) && console.log("adaptivePredict decision " + e3 + " exec LA(1)==" + this.getLookaheadName(t3) + " line " + t3.LT(1).line + ":" + t3.LT(1).column), this._input = t3, this._startIndex = t3.index, this._outerContext = n2; 2451 const s2 = this.decisionToDFA[e3]; 2452 this._dfa = s2; 2453 const i3 = t3.mark(), r3 = t3.index; 2454 try { 2455 let e4; 2456 if (e4 = s2.precedenceDfa ? s2.getPrecedenceStartState(this.parser.getPrecedence()) : s2.s0, null === e4) { 2457 null === n2 && (n2 = M2.EMPTY), this.debug && console.log("predictATN decision " + s2.decision + " exec LA(1)==" + this.getLookaheadName(t3) + ", outerContext=" + n2.toString(this.parser.ruleNames)); 2458 const i5 = false; 2459 let r4 = this.computeStartState(s2.atnStartState, M2.EMPTY, i5); 2460 s2.precedenceDfa ? (s2.s0.configs = r4, r4 = this.applyPrecedenceFilter(r4), e4 = this.addDFAState(s2, new qt(null, r4)), s2.setPrecedenceStartState(this.parser.getPrecedence(), e4)) : (e4 = this.addDFAState(s2, new qt(null, r4)), s2.s0 = e4); 2461 } 2462 const i4 = this.execATN(s2, e4, t3, r3, n2); 2463 return this.debug && console.log("DFA after predictATN: " + s2.toString(this.parser.literalNames, this.parser.symbolicNames)), i4; 2464 } finally { 2465 this._dfa = null, this.mergeCache = null, t3.seek(r3), t3.release(i3); 2466 } 2467 } 2468 execATN(e3, n2, s2, i3, r3) { 2469 let o3; 2470 (this.debug || this.trace_atn_sim) && console.log("execATN decision " + e3.decision + ", DFA state " + n2 + ", LA(1)==" + this.getLookaheadName(s2) + " line " + s2.LT(1).line + ":" + s2.LT(1).column); 2471 let a3 = n2; 2472 this.debug && console.log("s0 = " + n2); 2473 let l3 = s2.LA(1); 2474 for (; ; ) { 2475 let n3 = this.getExistingTargetState(a3, l3); 2476 if (null === n3 && (n3 = this.computeTargetState(e3, a3, l3)), n3 === Ht.ERROR) { 2477 const t3 = this.noViableAlt(s2, r3, a3.configs, i3); 2478 if (s2.seek(i3), o3 = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(a3.configs, r3), o3 !== $.INVALID_ALT_NUMBER) return o3; 2479 throw t3; 2480 } 2481 if (n3.requiresFullContext && this.predictionMode !== te.SLL) { 2482 let t3 = null; 2483 if (null !== n3.predicates) { 2484 this.debug && console.log("DFA state has preds in DFA sim LL failover"); 2485 const e4 = s2.index; 2486 if (e4 !== i3 && s2.seek(i3), t3 = this.evalSemanticContext(n3.predicates, r3, true), 1 === t3.length) return this.debug && console.log("Full LL avoided"), t3.minValue(); 2487 e4 !== i3 && s2.seek(e4); 2488 } 2489 this.dfa_debug && console.log("ctx sensitive state " + r3 + " in " + n3); 2490 const a4 = true, l4 = this.computeStartState(e3.atnStartState, r3, a4); 2491 return this.reportAttemptingFullContext(e3, t3, n3.configs, i3, s2.index), o3 = this.execATNWithFullContext(e3, n3, l4, s2, i3, r3), o3; 2492 } 2493 if (n3.isAcceptState) { 2494 if (null === n3.predicates) return n3.prediction; 2495 const t3 = s2.index; 2496 s2.seek(i3); 2497 const o4 = this.evalSemanticContext(n3.predicates, r3, true); 2498 if (0 === o4.length) throw this.noViableAlt(s2, r3, n3.configs, i3); 2499 return 1 === o4.length || this.reportAmbiguity(e3, n3, i3, t3, false, o4, n3.configs), o4.minValue(); 2500 } 2501 a3 = n3, l3 !== t2.EOF && (s2.consume(), l3 = s2.LA(1)); 2502 } 2503 } 2504 getExistingTargetState(t3, e3) { 2505 const n2 = t3.edges; 2506 return null === n2 ? null : n2[e3 + 1] || null; 2507 } 2508 computeTargetState(t3, e3, n2) { 2509 const s2 = this.computeReachSet(e3.configs, n2, false); 2510 if (null === s2) return this.addDFAEdge(t3, e3, n2, Ht.ERROR), Ht.ERROR; 2511 let i3 = new qt(null, s2); 2512 const r3 = this.getUniqueAlt(s2); 2513 if (this.debug) { 2514 const t4 = te.getConflictingAltSubsets(s2); 2515 console.log("SLL altSubSets=" + c2(t4) + ", configs=" + s2 + ", predict=" + r3 + ", allSubsetsConflict=" + te.allSubsetsConflict(t4) + ", conflictingAlts=" + this.getConflictingAlts(s2)); 2516 } 2517 return r3 !== $.INVALID_ALT_NUMBER ? (i3.isAcceptState = true, i3.configs.uniqueAlt = r3, i3.prediction = r3) : te.hasSLLConflictTerminatingPrediction(this.predictionMode, s2) && (i3.configs.conflictingAlts = this.getConflictingAlts(s2), i3.requiresFullContext = true, i3.isAcceptState = true, i3.prediction = i3.configs.conflictingAlts.minValue()), i3.isAcceptState && i3.configs.hasSemanticContext && (this.predicateDFAState(i3, this.atn.getDecisionState(t3.decision)), null !== i3.predicates && (i3.prediction = $.INVALID_ALT_NUMBER)), i3 = this.addDFAEdge(t3, e3, n2, i3), i3; 2518 } 2519 predicateDFAState(t3, e3) { 2520 const n2 = e3.transitions.length, s2 = this.getConflictingAltsOrUniqueAlt(t3.configs), i3 = this.getPredsForAmbigAlts(s2, t3.configs, n2); 2521 null !== i3 ? (t3.predicates = this.getPredicatePredictions(s2, i3), t3.prediction = $.INVALID_ALT_NUMBER) : t3.prediction = s2.minValue(); 2522 } 2523 execATNWithFullContext(e3, n2, s2, i3, r3, o3) { 2524 (this.debug || this.trace_atn_sim) && console.log("execATNWithFullContext " + s2); 2525 let a3, l3 = false, h3 = s2; 2526 i3.seek(r3); 2527 let c3 = i3.LA(1), u3 = -1; 2528 for (; ; ) { 2529 if (a3 = this.computeReachSet(h3, c3, true), null === a3) { 2530 const t3 = this.noViableAlt(i3, o3, h3, r3); 2531 i3.seek(r3); 2532 const e5 = this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(h3, o3); 2533 if (e5 !== $.INVALID_ALT_NUMBER) return e5; 2534 throw t3; 2535 } 2536 const e4 = te.getConflictingAltSubsets(a3); 2537 if (this.debug && console.log("LL altSubSets=" + e4 + ", predict=" + te.getUniqueAlt(e4) + ", resolvesToJustOneViableAlt=" + te.resolvesToJustOneViableAlt(e4)), a3.uniqueAlt = this.getUniqueAlt(a3), a3.uniqueAlt !== $.INVALID_ALT_NUMBER) { 2538 u3 = a3.uniqueAlt; 2539 break; 2540 } 2541 if (this.predictionMode !== te.LL_EXACT_AMBIG_DETECTION) { 2542 if (u3 = te.resolvesToJustOneViableAlt(e4), u3 !== $.INVALID_ALT_NUMBER) break; 2543 } else if (te.allSubsetsConflict(e4) && te.allSubsetsEqual(e4)) { 2544 l3 = true, u3 = te.getSingleViableAlt(e4); 2545 break; 2546 } 2547 h3 = a3, c3 !== t2.EOF && (i3.consume(), c3 = i3.LA(1)); 2548 } 2549 return a3.uniqueAlt !== $.INVALID_ALT_NUMBER ? (this.reportContextSensitivity(e3, u3, a3, r3, i3.index), u3) : (this.reportAmbiguity(e3, n2, r3, i3.index, l3, null, a3), u3); 2550 } 2551 computeReachSet(e3, n2, s2) { 2552 this.debug && console.log("in computeReachSet, starting closure: " + e3), null === this.mergeCache && (this.mergeCache = new ne()); 2553 const i3 = new zt(s2); 2554 let r3 = null; 2555 for (let o4 = 0; o4 < e3.items.length; o4++) { 2556 const a3 = e3.items[o4]; 2557 if (this.debug && console.log("testing " + this.getTokenName(n2) + " at " + a3), a3.state instanceof A2) (s2 || n2 === t2.EOF) && (null === r3 && (r3 = []), r3.push(a3), this.debug_add && console.log("added " + a3 + " to skippedStopStates")); 2558 else for (let t3 = 0; t3 < a3.state.transitions.length; t3++) { 2559 const e4 = a3.state.transitions[t3], s3 = this.getReachableTarget(e4, n2); 2560 if (null !== s3) { 2561 const t4 = new S2({ state: s3 }, a3); 2562 i3.add(t4, this.mergeCache), this.debug_add && console.log("added " + t4 + " to intermediate"); 2563 } 2564 } 2565 } 2566 let o3 = null; 2567 if (null === r3 && n2 !== t2.EOF && (1 === i3.items.length || this.getUniqueAlt(i3) !== $.INVALID_ALT_NUMBER) && (o3 = i3), null === o3) { 2568 o3 = new zt(s2); 2569 const e4 = new d2(), r4 = n2 === t2.EOF; 2570 for (let t3 = 0; t3 < i3.items.length; t3++) this.closure(i3.items[t3], o3, e4, false, s2, r4); 2571 } 2572 if (n2 === t2.EOF && (o3 = this.removeAllConfigsNotInRuleStopState(o3, o3 === i3)), !(null === r3 || s2 && te.hasConfigInRuleStopState(o3))) for (let t3 = 0; t3 < r3.length; t3++) o3.add(r3[t3], this.mergeCache); 2573 return this.trace_atn_sim && console.log("computeReachSet " + e3 + " -> " + o3), 0 === o3.items.length ? null : o3; 2574 } 2575 removeAllConfigsNotInRuleStopState(e3, n2) { 2576 if (te.allConfigsInRuleStopStates(e3)) return e3; 2577 const s2 = new zt(e3.fullCtx); 2578 for (let i3 = 0; i3 < e3.items.length; i3++) { 2579 const r3 = e3.items[i3]; 2580 if (r3.state instanceof A2) s2.add(r3, this.mergeCache); 2581 else if (n2 && r3.state.epsilonOnlyTransitions && this.atn.nextTokens(r3.state).contains(t2.EPSILON)) { 2582 const t3 = this.atn.ruleToStopState[r3.state.ruleIndex]; 2583 s2.add(new S2({ state: t3 }, r3), this.mergeCache); 2584 } 2585 } 2586 return s2; 2587 } 2588 computeStartState(t3, e3, n2) { 2589 const s2 = K(this.atn, e3), i3 = new zt(n2); 2590 this.trace_atn_sim && console.log("computeStartState from ATN state " + t3 + " initialContext=" + s2.toString(this.parser)); 2591 for (let e4 = 0; e4 < t3.transitions.length; e4++) { 2592 const r3 = t3.transitions[e4].target, o3 = new S2({ state: r3, alt: e4 + 1, context: s2 }, null), a3 = new d2(); 2593 this.closure(o3, i3, a3, true, n2, false); 2594 } 2595 return i3; 2596 } 2597 applyPrecedenceFilter(t3) { 2598 let e3; 2599 const n2 = [], s2 = new zt(t3.fullCtx); 2600 for (let i3 = 0; i3 < t3.items.length; i3++) { 2601 if (e3 = t3.items[i3], 1 !== e3.alt) continue; 2602 const r3 = e3.semanticContext.evalPrecedence(this.parser, this._outerContext); 2603 null !== r3 && (n2[e3.state.stateNumber] = e3.context, r3 !== e3.semanticContext ? s2.add(new S2({ semanticContext: r3 }, e3), this.mergeCache) : s2.add(e3, this.mergeCache)); 2604 } 2605 for (let i3 = 0; i3 < t3.items.length; i3++) if (e3 = t3.items[i3], 1 !== e3.alt) { 2606 if (!e3.precedenceFilterSuppressed) { 2607 const t4 = n2[e3.state.stateNumber] || null; 2608 if (null !== t4 && t4.equals(e3.context)) continue; 2609 } 2610 s2.add(e3, this.mergeCache); 2611 } 2612 return s2; 2613 } 2614 getReachableTarget(t3, e3) { 2615 return t3.matches(e3, 0, this.atn.maxTokenType) ? t3.target : null; 2616 } 2617 getPredsForAmbigAlts(t3, e3, n2) { 2618 let s2 = []; 2619 for (let n3 = 0; n3 < e3.items.length; n3++) { 2620 const i4 = e3.items[n3]; 2621 t3.has(i4.alt) && (s2[i4.alt] = p2.orContext(s2[i4.alt] || null, i4.semanticContext)); 2622 } 2623 let i3 = 0; 2624 for (let t4 = 1; t4 < n2 + 1; t4++) { 2625 const e4 = s2[t4] || null; 2626 null === e4 ? s2[t4] = p2.NONE : e4 !== p2.NONE && (i3 += 1); 2627 } 2628 return 0 === i3 && (s2 = null), this.debug && console.log("getPredsForAmbigAlts result " + c2(s2)), s2; 2629 } 2630 getPredicatePredictions(t3, e3) { 2631 const n2 = []; 2632 let s2 = false; 2633 for (let i3 = 1; i3 < e3.length; i3++) { 2634 const r3 = e3[i3]; 2635 null !== t3 && t3.has(i3) && n2.push(new Jt(r3, i3)), r3 !== p2.NONE && (s2 = true); 2636 } 2637 return s2 ? n2 : null; 2638 } 2639 getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(t3, e3) { 2640 const n2 = this.splitAccordingToSemanticValidity(t3, e3), s2 = n2[0], i3 = n2[1]; 2641 let r3 = this.getAltThatFinishedDecisionEntryRule(s2); 2642 return r3 !== $.INVALID_ALT_NUMBER || i3.items.length > 0 && (r3 = this.getAltThatFinishedDecisionEntryRule(i3), r3 !== $.INVALID_ALT_NUMBER) ? r3 : $.INVALID_ALT_NUMBER; 2643 } 2644 getAltThatFinishedDecisionEntryRule(t3) { 2645 const e3 = []; 2646 for (let n2 = 0; n2 < t3.items.length; n2++) { 2647 const s2 = t3.items[n2]; 2648 (s2.reachesIntoOuterContext > 0 || s2.state instanceof A2 && s2.context.hasEmptyPath()) && e3.indexOf(s2.alt) < 0 && e3.push(s2.alt); 2649 } 2650 return 0 === e3.length ? $.INVALID_ALT_NUMBER : Math.min.apply(null, e3); 2651 } 2652 splitAccordingToSemanticValidity(t3, e3) { 2653 const n2 = new zt(t3.fullCtx), s2 = new zt(t3.fullCtx); 2654 for (let i3 = 0; i3 < t3.items.length; i3++) { 2655 const r3 = t3.items[i3]; 2656 r3.semanticContext !== p2.NONE ? r3.semanticContext.evaluate(this.parser, e3) ? n2.add(r3) : s2.add(r3) : n2.add(r3); 2657 } 2658 return [n2, s2]; 2659 } 2660 evalSemanticContext(t3, e3, n2) { 2661 const s2 = new j(); 2662 for (let i3 = 0; i3 < t3.length; i3++) { 2663 const r3 = t3[i3]; 2664 if (r3.pred === p2.NONE) { 2665 if (s2.add(r3.alt), !n2) break; 2666 continue; 2667 } 2668 const o3 = r3.pred.evaluate(this.parser, e3); 2669 if ((this.debug || this.dfa_debug) && console.log("eval pred " + r3 + "=" + o3), o3 && ((this.debug || this.dfa_debug) && console.log("PREDICT " + r3.alt), s2.add(r3.alt), !n2)) break; 2670 } 2671 return s2; 2672 } 2673 closure(t3, e3, n2, s2, i3, r3) { 2674 this.closureCheckingStopState(t3, e3, n2, s2, i3, 0, r3); 2675 } 2676 closureCheckingStopState(t3, e3, n2, s2, i3, r3, o3) { 2677 if ((this.trace_atn_sim || this.debug_closure) && console.log("closure(" + t3.toString(this.parser, true) + ")"), t3.state instanceof A2) { 2678 if (!t3.context.isEmpty()) { 2679 for (let a3 = 0; a3 < t3.context.length; a3++) { 2680 if (t3.context.getReturnState(a3) === U.EMPTY_RETURN_STATE) { 2681 if (i3) { 2682 e3.add(new S2({ state: t3.state, context: U.EMPTY }, t3), this.mergeCache); 2683 continue; 2684 } 2685 this.debug && console.log("FALLING off rule " + this.getRuleName(t3.state.ruleIndex)), this.closure_(t3, e3, n2, s2, i3, r3, o3); 2686 continue; 2687 } 2688 const l3 = this.atn.states[t3.context.getReturnState(a3)], h3 = t3.context.getParent(a3), c3 = { state: l3, alt: t3.alt, context: h3, semanticContext: t3.semanticContext }, u3 = new S2(c3, null); 2689 u3.reachesIntoOuterContext = t3.reachesIntoOuterContext, this.closureCheckingStopState(u3, e3, n2, s2, i3, r3 - 1, o3); 2690 } 2691 return; 2692 } 2693 if (i3) return void e3.add(t3, this.mergeCache); 2694 this.debug && console.log("FALLING off rule " + this.getRuleName(t3.state.ruleIndex)); 2695 } 2696 this.closure_(t3, e3, n2, s2, i3, r3, o3); 2697 } 2698 closure_(t3, e3, n2, s2, i3, r3, o3) { 2699 const a3 = t3.state; 2700 a3.epsilonOnlyTransitions || e3.add(t3, this.mergeCache); 2701 for (let l3 = 0; l3 < a3.transitions.length; l3++) { 2702 if (0 === l3 && this.canDropLoopEntryEdgeInLeftRecursiveRule(t3)) continue; 2703 const h3 = a3.transitions[l3], c3 = s2 && !(h3 instanceof ut), u3 = this.getEpsilonTarget(t3, h3, c3, 0 === r3, i3, o3); 2704 if (null !== u3) { 2705 let s3 = r3; 2706 if (t3.state instanceof A2) { 2707 if (null !== this._dfa && this._dfa.precedenceDfa && h3.outermostPrecedenceReturn === this._dfa.atnStartState.ruleIndex && (u3.precedenceFilterSuppressed = true), u3.reachesIntoOuterContext += 1, n2.add(u3) !== u3) continue; 2708 e3.dipsIntoOuterContext = true, s3 -= 1, this.debug && console.log("dips into outer ctx: " + u3); 2709 } else { 2710 if (!h3.isEpsilon && n2.add(u3) !== u3) continue; 2711 h3 instanceof N2 && s3 >= 0 && (s3 += 1); 2712 } 2713 this.closureCheckingStopState(u3, e3, n2, c3, i3, s3, o3); 2714 } 2715 } 2716 } 2717 canDropLoopEntryEdgeInLeftRecursiveRule(t3) { 2718 const e3 = t3.state; 2719 if (e3.stateType !== _2.STAR_LOOP_ENTRY) return false; 2720 if (e3.stateType !== _2.STAR_LOOP_ENTRY || !e3.isPrecedenceDecision || t3.context.isEmpty() || t3.context.hasEmptyPath()) return false; 2721 const n2 = t3.context.length; 2722 for (let s3 = 0; s3 < n2; s3++) if (this.atn.states[t3.context.getReturnState(s3)].ruleIndex !== e3.ruleIndex) return false; 2723 const s2 = e3.transitions[0].target.endState.stateNumber, i3 = this.atn.states[s2]; 2724 for (let s3 = 0; s3 < n2; s3++) { 2725 const n3 = t3.context.getReturnState(s3), r3 = this.atn.states[n3]; 2726 if (1 !== r3.transitions.length || !r3.transitions[0].isEpsilon) return false; 2727 const o3 = r3.transitions[0].target; 2728 if (!(r3.stateType === _2.BLOCK_END && o3 === e3 || r3 === i3 || o3 === i3 || o3.stateType === _2.BLOCK_END && 1 === o3.transitions.length && o3.transitions[0].isEpsilon && o3.transitions[0].target === e3)) return false; 2729 } 2730 return true; 2731 } 2732 getRuleName(t3) { 2733 return null !== this.parser && t3 >= 0 ? this.parser.ruleNames[t3] : "<rule " + t3 + ">"; 2734 } 2735 getEpsilonTarget(e3, n2, s2, i3, r3, o3) { 2736 switch (n2.serializationType) { 2737 case C2.RULE: 2738 return this.ruleTransition(e3, n2); 2739 case C2.PRECEDENCE: 2740 return this.precedenceTransition(e3, n2, s2, i3, r3); 2741 case C2.PREDICATE: 2742 return this.predTransition(e3, n2, s2, i3, r3); 2743 case C2.ACTION: 2744 return this.actionTransition(e3, n2); 2745 case C2.EPSILON: 2746 return new S2({ state: n2.target }, e3); 2747 case C2.ATOM: 2748 case C2.RANGE: 2749 case C2.SET: 2750 return o3 && n2.matches(t2.EOF, 0, 1) ? new S2({ state: n2.target }, e3) : null; 2751 default: 2752 return null; 2753 } 2754 } 2755 actionTransition(t3, e3) { 2756 if (this.debug) { 2757 const t4 = -1 === e3.actionIndex ? 65535 : e3.actionIndex; 2758 console.log("ACTION edge " + e3.ruleIndex + ":" + t4); 2759 } 2760 return new S2({ state: e3.target }, t3); 2761 } 2762 precedenceTransition(t3, e3, n2, s2, i3) { 2763 this.debug && (console.log("PRED (collectPredicates=" + n2 + ") " + e3.precedence + ">=_p, ctx dependent=true"), null !== this.parser && console.log("context surrounding pred is " + c2(this.parser.getRuleInvocationStack()))); 2764 let r3 = null; 2765 if (n2 && s2) if (i3) { 2766 const n3 = this._input.index; 2767 this._input.seek(this._startIndex); 2768 const s3 = e3.getPredicate().evaluate(this.parser, this._outerContext); 2769 this._input.seek(n3), s3 && (r3 = new S2({ state: e3.target }, t3)); 2770 } else { 2771 const n3 = p2.andContext(t3.semanticContext, e3.getPredicate()); 2772 r3 = new S2({ state: e3.target, semanticContext: n3 }, t3); 2773 } 2774 else r3 = new S2({ state: e3.target }, t3); 2775 return this.debug && console.log("config from pred transition=" + r3), r3; 2776 } 2777 predTransition(t3, e3, n2, s2, i3) { 2778 this.debug && (console.log("PRED (collectPredicates=" + n2 + ") " + e3.ruleIndex + ":" + e3.predIndex + ", ctx dependent=" + e3.isCtxDependent), null !== this.parser && console.log("context surrounding pred is " + c2(this.parser.getRuleInvocationStack()))); 2779 let r3 = null; 2780 if (n2 && (e3.isCtxDependent && s2 || !e3.isCtxDependent)) if (i3) { 2781 const n3 = this._input.index; 2782 this._input.seek(this._startIndex); 2783 const s3 = e3.getPredicate().evaluate(this.parser, this._outerContext); 2784 this._input.seek(n3), s3 && (r3 = new S2({ state: e3.target }, t3)); 2785 } else { 2786 const n3 = p2.andContext(t3.semanticContext, e3.getPredicate()); 2787 r3 = new S2({ state: e3.target, semanticContext: n3 }, t3); 2788 } 2789 else r3 = new S2({ state: e3.target }, t3); 2790 return this.debug && console.log("config from pred transition=" + r3), r3; 2791 } 2792 ruleTransition(t3, e3) { 2793 this.debug && console.log("CALL rule " + this.getRuleName(e3.target.ruleIndex) + ", ctx=" + t3.context); 2794 const n2 = e3.followState, s2 = V.create(t3.context, n2.stateNumber); 2795 return new S2({ state: e3.target, context: s2 }, t3); 2796 } 2797 getConflictingAlts(t3) { 2798 const e3 = te.getConflictingAltSubsets(t3); 2799 return te.getAlts(e3); 2800 } 2801 getConflictingAltsOrUniqueAlt(t3) { 2802 let e3 = null; 2803 return t3.uniqueAlt !== $.INVALID_ALT_NUMBER ? (e3 = new j(), e3.add(t3.uniqueAlt)) : e3 = t3.conflictingAlts, e3; 2804 } 2805 getTokenName(e3) { 2806 if (e3 === t2.EOF) return "EOF"; 2807 if (null !== this.parser && null !== this.parser.literalNames) { 2808 if (!(e3 >= this.parser.literalNames.length && e3 >= this.parser.symbolicNames.length)) return (this.parser.literalNames[e3] || this.parser.symbolicNames[e3]) + "<" + e3 + ">"; 2809 console.log(e3 + " ttype out of range: " + this.parser.literalNames), console.log("" + this.parser.getInputStream().getTokens()); 2810 } 2811 return "" + e3; 2812 } 2813 getLookaheadName(t3) { 2814 return this.getTokenName(t3.LA(1)); 2815 } 2816 dumpDeadEndConfigs(t3) { 2817 console.log("dead end configs: "); 2818 const e3 = t3.getDeadEndConfigs(); 2819 for (let t4 = 0; t4 < e3.length; t4++) { 2820 const n2 = e3[t4]; 2821 let s2 = "no edges"; 2822 if (n2.state.transitions.length > 0) { 2823 const t5 = n2.state.transitions[0]; 2824 t5 instanceof ht ? s2 = "Atom " + this.getTokenName(t5.label) : t5 instanceof y2 && (s2 = (t5 instanceof I2 ? "~" : "") + "Set " + t5.set); 2825 } 2826 console.error(n2.toString(this.parser, true) + ":" + s2); 2827 } 2828 } 2829 noViableAlt(t3, e3, n2, s2) { 2830 return new ee(this.parser, t3, t3.get(s2), t3.LT(1), n2, e3); 2831 } 2832 getUniqueAlt(t3) { 2833 let e3 = $.INVALID_ALT_NUMBER; 2834 for (let n2 = 0; n2 < t3.items.length; n2++) { 2835 const s2 = t3.items[n2]; 2836 if (e3 === $.INVALID_ALT_NUMBER) e3 = s2.alt; 2837 else if (s2.alt !== e3) return $.INVALID_ALT_NUMBER; 2838 } 2839 return e3; 2840 } 2841 addDFAEdge(t3, e3, n2, s2) { 2842 if (this.debug && console.log("EDGE " + e3 + " -> " + s2 + " upon " + this.getTokenName(n2)), null === s2) return null; 2843 if (s2 = this.addDFAState(t3, s2), null === e3 || n2 < -1 || n2 > this.atn.maxTokenType) return s2; 2844 if (null === e3.edges && (e3.edges = []), e3.edges[n2 + 1] = s2, this.debug) { 2845 const e4 = null === this.parser ? null : this.parser.literalNames, n3 = null === this.parser ? null : this.parser.symbolicNames; 2846 console.log("DFA=\n" + t3.toString(e4, n3)); 2847 } 2848 return s2; 2849 } 2850 addDFAState(t3, e3) { 2851 if (e3 === Ht.ERROR) return e3; 2852 const n2 = t3.states.get(e3); 2853 return null !== n2 ? (this.trace_atn_sim && console.log("addDFAState " + e3 + " exists"), n2) : (e3.stateNumber = t3.states.length, e3.configs.readOnly || (e3.configs.optimizeConfigs(this), e3.configs.setReadonly(true)), this.trace_atn_sim && console.log("addDFAState new " + e3), t3.states.add(e3), this.debug && console.log("adding new DFA state: " + e3), e3); 2854 } 2855 reportAttemptingFullContext(t3, e3, n2, s2, i3) { 2856 if (this.debug || this.retry_debug) { 2857 const e4 = new m2(s2, i3 + 1); 2858 console.log("reportAttemptingFullContext decision=" + t3.decision + ":" + n2 + ", input=" + this.parser.getTokenStream().getText(e4)); 2859 } 2860 null !== this.parser && this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser, t3, s2, i3, e3, n2); 2861 } 2862 reportContextSensitivity(t3, e3, n2, s2, i3) { 2863 if (this.debug || this.retry_debug) { 2864 const e4 = new m2(s2, i3 + 1); 2865 console.log("reportContextSensitivity decision=" + t3.decision + ":" + n2 + ", input=" + this.parser.getTokenStream().getText(e4)); 2866 } 2867 null !== this.parser && this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser, t3, s2, i3, e3, n2); 2868 } 2869 reportAmbiguity(t3, e3, n2, s2, i3, r3, o3) { 2870 if (this.debug || this.retry_debug) { 2871 const t4 = new m2(n2, s2 + 1); 2872 console.log("reportAmbiguity " + r3 + ":" + o3 + ", input=" + this.parser.getTokenStream().getText(t4)); 2873 } 2874 null !== this.parser && this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser, t3, n2, s2, i3, r3, o3); 2875 } 2876 } 2877 class ie { 2878 constructor() { 2879 this.cache = new H(); 2880 } 2881 add(t3) { 2882 if (t3 === U.EMPTY) return U.EMPTY; 2883 const e3 = this.cache.get(t3) || null; 2884 return null !== e3 ? e3 : (this.cache.set(t3, t3), t3); 2885 } 2886 get(t3) { 2887 return this.cache.get(t3) || null; 2888 } 2889 get length() { 2890 return this.cache.length; 2891 } 2892 } 2893 const re = { ATN: $, ATNDeserializer: Lt, LexerATNSimulator: Xt, ParserATNSimulator: se, PredictionMode: te, PredictionContextCache: ie }; 2894 class oe { 2895 constructor(t3, e3, n2) { 2896 this.dfa = t3, this.literalNames = e3 || [], this.symbolicNames = n2 || []; 2897 } 2898 toString() { 2899 if (null === this.dfa.s0) return null; 2900 let t3 = ""; 2901 const e3 = this.dfa.sortedStates(); 2902 for (let n2 = 0; n2 < e3.length; n2++) { 2903 const s2 = e3[n2]; 2904 if (null !== s2.edges) { 2905 const e4 = s2.edges.length; 2906 for (let n3 = 0; n3 < e4; n3++) { 2907 const e5 = s2.edges[n3] || null; 2908 null !== e5 && 2147483647 !== e5.stateNumber && (t3 = t3.concat(this.getStateString(s2)), t3 = t3.concat("-"), t3 = t3.concat(this.getEdgeLabel(n3)), t3 = t3.concat("->"), t3 = t3.concat(this.getStateString(e5)), t3 = t3.concat("\n")); 2909 } 2910 } 2911 } 2912 return 0 === t3.length ? null : t3; 2913 } 2914 getEdgeLabel(t3) { 2915 return 0 === t3 ? "EOF" : null !== this.literalNames || null !== this.symbolicNames ? this.literalNames[t3 - 1] || this.symbolicNames[t3 - 1] : String.fromCharCode(t3 - 1); 2916 } 2917 getStateString(t3) { 2918 const e3 = (t3.isAcceptState ? ":" : "") + "s" + t3.stateNumber + (t3.requiresFullContext ? "^" : ""); 2919 return t3.isAcceptState ? null !== t3.predicates ? e3 + "=>" + c2(t3.predicates) : e3 + "=>" + t3.prediction.toString() : e3; 2920 } 2921 } 2922 class ae extends oe { 2923 constructor(t3) { 2924 super(t3, null); 2925 } 2926 getEdgeLabel(t3) { 2927 return "'" + String.fromCharCode(t3) + "'"; 2928 } 2929 } 2930 class le { 2931 constructor(t3, e3) { 2932 if (void 0 === e3 && (e3 = 0), this.atnStartState = t3, this.decision = e3, this._states = new d2(), this.s0 = null, this.precedenceDfa = false, t3 instanceof rt && t3.isPrecedenceDecision) { 2933 this.precedenceDfa = true; 2934 const t4 = new qt(null, new zt()); 2935 t4.edges = [], t4.isAcceptState = false, t4.requiresFullContext = false, this.s0 = t4; 2936 } 2937 } 2938 getPrecedenceStartState(t3) { 2939 if (!this.precedenceDfa) throw "Only precedence DFAs may contain a precedence start state."; 2940 return t3 < 0 || t3 >= this.s0.edges.length ? null : this.s0.edges[t3] || null; 2941 } 2942 setPrecedenceStartState(t3, e3) { 2943 if (!this.precedenceDfa) throw "Only precedence DFAs may contain a precedence start state."; 2944 t3 < 0 || (this.s0.edges[t3] = e3); 2945 } 2946 setPrecedenceDfa(t3) { 2947 if (this.precedenceDfa !== t3) { 2948 if (this._states = new d2(), t3) { 2949 const t4 = new qt(null, new zt()); 2950 t4.edges = [], t4.isAcceptState = false, t4.requiresFullContext = false, this.s0 = t4; 2951 } else this.s0 = null; 2952 this.precedenceDfa = t3; 2953 } 2954 } 2955 sortedStates() { 2956 return this._states.values().sort((function(t3, e3) { 2957 return t3.stateNumber - e3.stateNumber; 2958 })); 2959 } 2960 toString(t3, e3) { 2961 return t3 = t3 || null, e3 = e3 || null, null === this.s0 ? "" : new oe(this, t3, e3).toString(); 2962 } 2963 toLexerString() { 2964 return null === this.s0 ? "" : new ae(this).toString(); 2965 } 2966 get states() { 2967 return this._states; 2968 } 2969 } 2970 const he = { DFA: le, DFASerializer: oe, LexerDFASerializer: ae, PredPrediction: Jt }, ce = { PredictionContext: U }, ue = { Interval: m2, IntervalSet: E2 }; 2971 class de { 2972 visitTerminal(t3) { 2973 } 2974 visitErrorNode(t3) { 2975 } 2976 enterEveryRule(t3) { 2977 } 2978 exitEveryRule(t3) { 2979 } 2980 } 2981 class pe { 2982 visit(t3) { 2983 return Array.isArray(t3) ? t3.map((function(t4) { 2984 return t4.accept(this); 2985 }), this) : t3.accept(this); 2986 } 2987 visitChildren(t3) { 2988 return t3.children ? this.visit(t3.children) : null; 2989 } 2990 visitTerminal(t3) { 2991 } 2992 visitErrorNode(t3) { 2993 } 2994 } 2995 class ge { 2996 walk(t3, e3) { 2997 if (e3 instanceof b2 || void 0 !== e3.isErrorNode && e3.isErrorNode()) t3.visitErrorNode(e3); 2998 else if (e3 instanceof P2) t3.visitTerminal(e3); 2999 else { 3000 this.enterRule(t3, e3); 3001 for (let n2 = 0; n2 < e3.getChildCount(); n2++) { 3002 const s2 = e3.getChild(n2); 3003 this.walk(t3, s2); 3004 } 3005 this.exitRule(t3, e3); 3006 } 3007 } 3008 enterRule(t3, e3) { 3009 const n2 = e3.ruleContext; 3010 t3.enterEveryRule(n2), n2.enterRule(t3); 3011 } 3012 exitRule(t3, e3) { 3013 const n2 = e3.ruleContext; 3014 n2.exitRule(t3), t3.exitEveryRule(n2); 3015 } 3016 } 3017 ge.DEFAULT = new ge(); 3018 const fe = { Trees: F2, RuleNode: w2, ErrorNode: b2, TerminalNode: P2, ParseTreeListener: de, ParseTreeVisitor: pe, ParseTreeWalker: ge }; 3019 class xe extends Ft { 3020 constructor(t3) { 3021 super({ message: "", recognizer: t3, input: t3.getInputStream(), ctx: t3._ctx }), this.offendingToken = t3.getCurrentToken(); 3022 } 3023 } 3024 class Te extends Ft { 3025 constructor(t3, e3, n2) { 3026 super({ message: Se(e3, n2 || null), recognizer: t3, input: t3.getInputStream(), ctx: t3._ctx }); 3027 const s2 = t3._interp.atn.states[t3.state].transitions[0]; 3028 s2 instanceof gt ? (this.ruleIndex = s2.ruleIndex, this.predicateIndex = s2.predIndex) : (this.ruleIndex = 0, this.predicateIndex = 0), this.predicate = e3, this.offendingToken = t3.getCurrentToken(); 3029 } 3030 } 3031 function Se(t3, e3) { 3032 return null !== e3 ? e3 : "failed predicate: {" + t3 + "}?"; 3033 } 3034 class me extends Ot { 3035 constructor(t3) { 3036 super(), t3 = t3 || true, this.exactOnly = t3; 3037 } 3038 reportAmbiguity(t3, e3, n2, s2, i3, r3, o3) { 3039 if (this.exactOnly && !i3) return; 3040 const a3 = "reportAmbiguity d=" + this.getDecisionDescription(t3, e3) + ": ambigAlts=" + this.getConflictingAlts(r3, o3) + ", input='" + t3.getTokenStream().getText(new m2(n2, s2)) + "'"; 3041 t3.notifyErrorListeners(a3); 3042 } 3043 reportAttemptingFullContext(t3, e3, n2, s2, i3, r3) { 3044 const o3 = "reportAttemptingFullContext d=" + this.getDecisionDescription(t3, e3) + ", input='" + t3.getTokenStream().getText(new m2(n2, s2)) + "'"; 3045 t3.notifyErrorListeners(o3); 3046 } 3047 reportContextSensitivity(t3, e3, n2, s2, i3, r3) { 3048 const o3 = "reportContextSensitivity d=" + this.getDecisionDescription(t3, e3) + ", input='" + t3.getTokenStream().getText(new m2(n2, s2)) + "'"; 3049 t3.notifyErrorListeners(o3); 3050 } 3051 getDecisionDescription(t3, e3) { 3052 const n2 = e3.decision, s2 = e3.atnStartState.ruleIndex, i3 = t3.ruleNames; 3053 if (s2 < 0 || s2 >= i3.length) return "" + n2; 3054 const r3 = i3[s2] || null; 3055 return null === r3 || 0 === r3.length ? "" + n2 : `${n2} (${r3})`; 3056 } 3057 getConflictingAlts(t3, e3) { 3058 if (null !== t3) return t3; 3059 const n2 = new j(); 3060 for (let t4 = 0; t4 < e3.items.length; t4++) n2.add(e3.items[t4].alt); 3061 return `{${n2.values().join(", ")}}`; 3062 } 3063 } 3064 class Ee extends Error { 3065 constructor() { 3066 super(), Error.captureStackTrace(this, Ee); 3067 } 3068 } 3069 class _e { 3070 reset(t3) { 3071 } 3072 recoverInline(t3) { 3073 } 3074 recover(t3, e3) { 3075 } 3076 sync(t3) { 3077 } 3078 inErrorRecoveryMode(t3) { 3079 } 3080 reportError(t3) { 3081 } 3082 } 3083 class Ae extends _e { 3084 constructor() { 3085 super(), this.errorRecoveryMode = false, this.lastErrorIndex = -1, this.lastErrorStates = null, this.nextTokensContext = null, this.nextTokenState = 0; 3086 } 3087 reset(t3) { 3088 this.endErrorCondition(t3); 3089 } 3090 beginErrorCondition(t3) { 3091 this.errorRecoveryMode = true; 3092 } 3093 inErrorRecoveryMode(t3) { 3094 return this.errorRecoveryMode; 3095 } 3096 endErrorCondition(t3) { 3097 this.errorRecoveryMode = false, this.lastErrorStates = null, this.lastErrorIndex = -1; 3098 } 3099 reportMatch(t3) { 3100 this.endErrorCondition(t3); 3101 } 3102 reportError(t3, e3) { 3103 this.inErrorRecoveryMode(t3) || (this.beginErrorCondition(t3), e3 instanceof ee ? this.reportNoViableAlternative(t3, e3) : e3 instanceof xe ? this.reportInputMismatch(t3, e3) : e3 instanceof Te ? this.reportFailedPredicate(t3, e3) : (console.log("unknown recognition error type: " + e3.constructor.name), console.log(e3.stack), t3.notifyErrorListeners(e3.getOffendingToken(), e3.getMessage(), e3))); 3104 } 3105 recover(t3, e3) { 3106 this.lastErrorIndex === t3.getInputStream().index && null !== this.lastErrorStates && this.lastErrorStates.indexOf(t3.state) >= 0 && t3.consume(), this.lastErrorIndex = t3._input.index, null === this.lastErrorStates && (this.lastErrorStates = []), this.lastErrorStates.push(t3.state); 3107 const n2 = this.getErrorRecoverySet(t3); 3108 this.consumeUntil(t3, n2); 3109 } 3110 sync(e3) { 3111 if (this.inErrorRecoveryMode(e3)) return; 3112 const n2 = e3._interp.atn.states[e3.state], s2 = e3.getTokenStream().LA(1), i3 = e3.atn.nextTokens(n2); 3113 if (i3.contains(s2)) return this.nextTokensContext = null, void (this.nextTokenState = _2.INVALID_STATE_NUMBER); 3114 if (i3.contains(t2.EPSILON)) null === this.nextTokensContext && (this.nextTokensContext = e3._ctx, this.nextTokensState = e3._stateNumber); 3115 else switch (n2.stateType) { 3116 case _2.BLOCK_START: 3117 case _2.STAR_BLOCK_START: 3118 case _2.PLUS_BLOCK_START: 3119 case _2.STAR_LOOP_ENTRY: 3120 if (null !== this.singleTokenDeletion(e3)) return; 3121 throw new xe(e3); 3122 case _2.PLUS_LOOP_BACK: 3123 case _2.STAR_LOOP_BACK: { 3124 this.reportUnwantedToken(e3); 3125 const t3 = new E2(); 3126 t3.addSet(e3.getExpectedTokens()); 3127 const n3 = t3.addSet(this.getErrorRecoverySet(e3)); 3128 this.consumeUntil(e3, n3); 3129 } 3130 } 3131 } 3132 reportNoViableAlternative(e3, n2) { 3133 const s2 = e3.getTokenStream(); 3134 let i3; 3135 i3 = null !== s2 ? n2.startToken.type === t2.EOF ? "<EOF>" : s2.getText(new m2(n2.startToken.tokenIndex, n2.offendingToken.tokenIndex)) : "<unknown input>"; 3136 const r3 = "no viable alternative at input " + this.escapeWSAndQuote(i3); 3137 e3.notifyErrorListeners(r3, n2.offendingToken, n2); 3138 } 3139 reportInputMismatch(t3, e3) { 3140 const n2 = "mismatched input " + this.getTokenErrorDisplay(e3.offendingToken) + " expecting " + e3.getExpectedTokens().toString(t3.literalNames, t3.symbolicNames); 3141 t3.notifyErrorListeners(n2, e3.offendingToken, e3); 3142 } 3143 reportFailedPredicate(t3, e3) { 3144 const n2 = "rule " + t3.ruleNames[t3._ctx.ruleIndex] + " " + e3.message; 3145 t3.notifyErrorListeners(n2, e3.offendingToken, e3); 3146 } 3147 reportUnwantedToken(t3) { 3148 if (this.inErrorRecoveryMode(t3)) return; 3149 this.beginErrorCondition(t3); 3150 const e3 = t3.getCurrentToken(), n2 = "extraneous input " + this.getTokenErrorDisplay(e3) + " expecting " + this.getExpectedTokens(t3).toString(t3.literalNames, t3.symbolicNames); 3151 t3.notifyErrorListeners(n2, e3, null); 3152 } 3153 reportMissingToken(t3) { 3154 if (this.inErrorRecoveryMode(t3)) return; 3155 this.beginErrorCondition(t3); 3156 const e3 = t3.getCurrentToken(), n2 = "missing " + this.getExpectedTokens(t3).toString(t3.literalNames, t3.symbolicNames) + " at " + this.getTokenErrorDisplay(e3); 3157 t3.notifyErrorListeners(n2, e3, null); 3158 } 3159 recoverInline(t3) { 3160 const e3 = this.singleTokenDeletion(t3); 3161 if (null !== e3) return t3.consume(), e3; 3162 if (this.singleTokenInsertion(t3)) return this.getMissingSymbol(t3); 3163 throw new xe(t3); 3164 } 3165 singleTokenInsertion(t3) { 3166 const e3 = t3.getTokenStream().LA(1), n2 = t3._interp.atn, s2 = n2.states[t3.state].transitions[0].target; 3167 return !!n2.nextTokens(s2, t3._ctx).contains(e3) && (this.reportMissingToken(t3), true); 3168 } 3169 singleTokenDeletion(t3) { 3170 const e3 = t3.getTokenStream().LA(2); 3171 if (this.getExpectedTokens(t3).contains(e3)) { 3172 this.reportUnwantedToken(t3), t3.consume(); 3173 const e4 = t3.getCurrentToken(); 3174 return this.reportMatch(t3), e4; 3175 } 3176 return null; 3177 } 3178 getMissingSymbol(e3) { 3179 const n2 = e3.getCurrentToken(), s2 = this.getExpectedTokens(e3).first(); 3180 let i3; 3181 i3 = s2 === t2.EOF ? "<missing EOF>" : "<missing " + e3.literalNames[s2] + ">"; 3182 let r3 = n2; 3183 const o3 = e3.getTokenStream().LT(-1); 3184 return r3.type === t2.EOF && null !== o3 && (r3 = o3), e3.getTokenFactory().create(r3.source, s2, i3, t2.DEFAULT_CHANNEL, -1, -1, r3.line, r3.column); 3185 } 3186 getExpectedTokens(t3) { 3187 return t3.getExpectedTokens(); 3188 } 3189 getTokenErrorDisplay(e3) { 3190 if (null === e3) return "<no token>"; 3191 let n2 = e3.text; 3192 return null === n2 && (n2 = e3.type === t2.EOF ? "<EOF>" : "<" + e3.type + ">"), this.escapeWSAndQuote(n2); 3193 } 3194 escapeWSAndQuote(t3) { 3195 return "'" + (t3 = (t3 = (t3 = t3.replace(/\n/g, "\\n")).replace(/\r/g, "\\r")).replace(/\t/g, "\\t")) + "'"; 3196 } 3197 getErrorRecoverySet(e3) { 3198 const n2 = e3._interp.atn; 3199 let s2 = e3._ctx; 3200 const i3 = new E2(); 3201 for (; null !== s2 && s2.invokingState >= 0; ) { 3202 const t3 = n2.states[s2.invokingState].transitions[0], e4 = n2.nextTokens(t3.followState); 3203 i3.addSet(e4), s2 = s2.parentCtx; 3204 } 3205 return i3.removeOne(t2.EPSILON), i3; 3206 } 3207 consumeUntil(e3, n2) { 3208 let s2 = e3.getTokenStream().LA(1); 3209 for (; s2 !== t2.EOF && !n2.contains(s2); ) e3.consume(), s2 = e3.getTokenStream().LA(1); 3210 } 3211 } 3212 class Ce extends Ae { 3213 constructor() { 3214 super(); 3215 } 3216 recover(t3, e3) { 3217 let n2 = t3._ctx; 3218 for (; null !== n2; ) n2.exception = e3, n2 = n2.parentCtx; 3219 throw new Ee(e3); 3220 } 3221 recoverInline(t3) { 3222 this.recover(t3, new xe(t3)); 3223 } 3224 sync(t3) { 3225 } 3226 } 3227 const Ne = { RecognitionException: Ft, NoViableAltException: ee, LexerNoViableAltException: Mt, InputMismatchException: xe, FailedPredicateException: Te, DiagnosticErrorListener: me, BailErrorStrategy: Ce, DefaultErrorStrategy: Ae, ErrorListener: Ot }; 3228 class ye { 3229 constructor(t3, e3) { 3230 if (this.name = "<empty>", this.strdata = t3, this.decodeToUnicodeCodePoints = e3 || false, this._index = 0, this.data = [], this.decodeToUnicodeCodePoints) for (let t4 = 0; t4 < this.strdata.length; ) { 3231 const e4 = this.strdata.codePointAt(t4); 3232 this.data.push(e4), t4 += e4 <= 65535 ? 1 : 2; 3233 } 3234 else { 3235 this.data = new Array(this.strdata.length); 3236 for (let t4 = 0; t4 < this.strdata.length; t4++) this.data[t4] = this.strdata.charCodeAt(t4); 3237 } 3238 this._size = this.data.length; 3239 } 3240 reset() { 3241 this._index = 0; 3242 } 3243 consume() { 3244 if (this._index >= this._size) throw "cannot consume EOF"; 3245 this._index += 1; 3246 } 3247 LA(e3) { 3248 if (0 === e3) return 0; 3249 e3 < 0 && (e3 += 1); 3250 const n2 = this._index + e3 - 1; 3251 return n2 < 0 || n2 >= this._size ? t2.EOF : this.data[n2]; 3252 } 3253 LT(t3) { 3254 return this.LA(t3); 3255 } 3256 mark() { 3257 return -1; 3258 } 3259 release(t3) { 3260 } 3261 seek(t3) { 3262 t3 <= this._index ? this._index = t3 : this._index = Math.min(t3, this._size); 3263 } 3264 getText(t3, e3) { 3265 if (e3 >= this._size && (e3 = this._size - 1), t3 >= this._size) return ""; 3266 if (this.decodeToUnicodeCodePoints) { 3267 let n2 = ""; 3268 for (let s2 = t3; s2 <= e3; s2++) n2 += String.fromCodePoint(this.data[s2]); 3269 return n2; 3270 } 3271 return this.strdata.slice(t3, e3 + 1); 3272 } 3273 toString() { 3274 return this.strdata; 3275 } 3276 get index() { 3277 return this._index; 3278 } 3279 get size() { 3280 return this._size; 3281 } 3282 } 3283 class Ie extends ye { 3284 constructor(t3, e3) { 3285 super(t3, e3); 3286 } 3287 } 3288 var ke = n(92); 3289 const Le = "undefined" != typeof process && null != process.versions && null != process.versions.node; 3290 class Oe extends Ie { 3291 static fromPath(t3, e3, n2) { 3292 if (!Le) throw new Error("FileStream is only available when running in Node!"); 3293 ke.readFile(t3, e3, (function(t4, e4) { 3294 let s2 = null; 3295 null !== e4 && (s2 = new ye(e4, true)), n2(t4, s2); 3296 })); 3297 } 3298 constructor(t3, e3, n2) { 3299 if (!Le) throw new Error("FileStream is only available when running in Node!"); 3300 super(ke.readFileSync(t3, e3 || "utf-8"), n2), this.fileName = t3; 3301 } 3302 } 3303 const ve = { fromString: function(t3) { 3304 return new ye(t3, true); 3305 }, fromBlob: function(t3, e3, n2, s2) { 3306 const i3 = new window.FileReader(); 3307 i3.onload = function(t4) { 3308 const e4 = new ye(t4.target.result, true); 3309 n2(e4); 3310 }, i3.onerror = s2, i3.readAsText(t3, e3); 3311 }, fromBuffer: function(t3, e3) { 3312 return new ye(t3.toString(e3), true); 3313 }, fromPath: function(t3, e3, n2) { 3314 Oe.fromPath(t3, e3, n2); 3315 }, fromPathSync: function(t3, e3) { 3316 return new Oe(t3, e3); 3317 } }, Re = { arrayToString: c2, stringToCharArray: function(t3) { 3318 let e3 = new Uint16Array(t3.length); 3319 for (let n2 = 0; n2 < t3.length; n2++) e3[n2] = t3.charCodeAt(n2); 3320 return e3; 3321 } }; 3322 class we { 3323 } 3324 class Pe extends we { 3325 constructor(t3) { 3326 super(), this.tokenSource = t3, this.tokens = [], this.index = -1, this.fetchedEOF = false; 3327 } 3328 mark() { 3329 return 0; 3330 } 3331 release(t3) { 3332 } 3333 reset() { 3334 this.seek(0); 3335 } 3336 seek(t3) { 3337 this.lazyInit(), this.index = this.adjustSeekIndex(t3); 3338 } 3339 get size() { 3340 return this.tokens.length; 3341 } 3342 get(t3) { 3343 return this.lazyInit(), this.tokens[t3]; 3344 } 3345 consume() { 3346 let e3 = false; 3347 if (e3 = this.index >= 0 && (this.fetchedEOF ? this.index < this.tokens.length - 1 : this.index < this.tokens.length), !e3 && this.LA(1) === t2.EOF) throw "cannot consume EOF"; 3348 this.sync(this.index + 1) && (this.index = this.adjustSeekIndex(this.index + 1)); 3349 } 3350 sync(t3) { 3351 const e3 = t3 - this.tokens.length + 1; 3352 return !(e3 > 0) || this.fetch(e3) >= e3; 3353 } 3354 fetch(e3) { 3355 if (this.fetchedEOF) return 0; 3356 for (let n2 = 0; n2 < e3; n2++) { 3357 const e4 = this.tokenSource.nextToken(); 3358 if (e4.tokenIndex = this.tokens.length, this.tokens.push(e4), e4.type === t2.EOF) return this.fetchedEOF = true, n2 + 1; 3359 } 3360 return e3; 3361 } 3362 getTokens(e3, n2, s2) { 3363 if (void 0 === s2 && (s2 = null), e3 < 0 || n2 < 0) return null; 3364 this.lazyInit(); 3365 const i3 = []; 3366 n2 >= this.tokens.length && (n2 = this.tokens.length - 1); 3367 for (let r3 = e3; r3 < n2; r3++) { 3368 const e4 = this.tokens[r3]; 3369 if (e4.type === t2.EOF) break; 3370 (null === s2 || s2.contains(e4.type)) && i3.push(e4); 3371 } 3372 return i3; 3373 } 3374 LA(t3) { 3375 return this.LT(t3).type; 3376 } 3377 LB(t3) { 3378 return this.index - t3 < 0 ? null : this.tokens[this.index - t3]; 3379 } 3380 LT(t3) { 3381 if (this.lazyInit(), 0 === t3) return null; 3382 if (t3 < 0) return this.LB(-t3); 3383 const e3 = this.index + t3 - 1; 3384 return this.sync(e3), e3 >= this.tokens.length ? this.tokens[this.tokens.length - 1] : this.tokens[e3]; 3385 } 3386 adjustSeekIndex(t3) { 3387 return t3; 3388 } 3389 lazyInit() { 3390 -1 === this.index && this.setup(); 3391 } 3392 setup() { 3393 this.sync(0), this.index = this.adjustSeekIndex(0); 3394 } 3395 setTokenSource(t3) { 3396 this.tokenSource = t3, this.tokens = [], this.index = -1, this.fetchedEOF = false; 3397 } 3398 nextTokenOnChannel(e3, n2) { 3399 if (this.sync(e3), e3 >= this.tokens.length) return -1; 3400 let s2 = this.tokens[e3]; 3401 for (; s2.channel !== this.channel; ) { 3402 if (s2.type === t2.EOF) return -1; 3403 e3 += 1, this.sync(e3), s2 = this.tokens[e3]; 3404 } 3405 return e3; 3406 } 3407 previousTokenOnChannel(t3, e3) { 3408 for (; t3 >= 0 && this.tokens[t3].channel !== e3; ) t3 -= 1; 3409 return t3; 3410 } 3411 getHiddenTokensToRight(t3, e3) { 3412 if (void 0 === e3 && (e3 = -1), this.lazyInit(), t3 < 0 || t3 >= this.tokens.length) throw t3 + " not in 0.." + this.tokens.length - 1; 3413 const n2 = this.nextTokenOnChannel(t3 + 1, Ut.DEFAULT_TOKEN_CHANNEL), s2 = t3 + 1, i3 = -1 === n2 ? this.tokens.length - 1 : n2; 3414 return this.filterForChannel(s2, i3, e3); 3415 } 3416 getHiddenTokensToLeft(t3, e3) { 3417 if (void 0 === e3 && (e3 = -1), this.lazyInit(), t3 < 0 || t3 >= this.tokens.length) throw t3 + " not in 0.." + this.tokens.length - 1; 3418 const n2 = this.previousTokenOnChannel(t3 - 1, Ut.DEFAULT_TOKEN_CHANNEL); 3419 if (n2 === t3 - 1) return null; 3420 const s2 = n2 + 1, i3 = t3 - 1; 3421 return this.filterForChannel(s2, i3, e3); 3422 } 3423 filterForChannel(t3, e3, n2) { 3424 const s2 = []; 3425 for (let i3 = t3; i3 < e3 + 1; i3++) { 3426 const t4 = this.tokens[i3]; 3427 -1 === n2 ? t4.channel !== Ut.DEFAULT_TOKEN_CHANNEL && s2.push(t4) : t4.channel === n2 && s2.push(t4); 3428 } 3429 return 0 === s2.length ? null : s2; 3430 } 3431 getSourceName() { 3432 return this.tokenSource.getSourceName(); 3433 } 3434 getText(e3) { 3435 this.lazyInit(), this.fill(), e3 || (e3 = new m2(0, this.tokens.length - 1)); 3436 let n2 = e3.start; 3437 n2 instanceof t2 && (n2 = n2.tokenIndex); 3438 let s2 = e3.stop; 3439 if (s2 instanceof t2 && (s2 = s2.tokenIndex), null === n2 || null === s2 || n2 < 0 || s2 < 0) return ""; 3440 s2 >= this.tokens.length && (s2 = this.tokens.length - 1); 3441 let i3 = ""; 3442 for (let e4 = n2; e4 < s2 + 1; e4++) { 3443 const n3 = this.tokens[e4]; 3444 if (n3.type === t2.EOF) break; 3445 i3 += n3.text; 3446 } 3447 return i3; 3448 } 3449 fill() { 3450 for (this.lazyInit(); 1e3 === this.fetch(1e3); ) ; 3451 } 3452 } 3453 Object.defineProperty(Pe, "size", { get: function() { 3454 return this.tokens.length; 3455 } }); 3456 class be extends Pe { 3457 constructor(e3, n2) { 3458 super(e3), this.channel = void 0 === n2 ? t2.DEFAULT_CHANNEL : n2; 3459 } 3460 adjustSeekIndex(t3) { 3461 return this.nextTokenOnChannel(t3, this.channel); 3462 } 3463 LB(t3) { 3464 if (0 === t3 || this.index - t3 < 0) return null; 3465 let e3 = this.index, n2 = 1; 3466 for (; n2 <= t3; ) e3 = this.previousTokenOnChannel(e3 - 1, this.channel), n2 += 1; 3467 return e3 < 0 ? null : this.tokens[e3]; 3468 } 3469 LT(t3) { 3470 if (this.lazyInit(), 0 === t3) return null; 3471 if (t3 < 0) return this.LB(-t3); 3472 let e3 = this.index, n2 = 1; 3473 for (; n2 < t3; ) this.sync(e3 + 1) && (e3 = this.nextTokenOnChannel(e3 + 1, this.channel)), n2 += 1; 3474 return this.tokens[e3]; 3475 } 3476 getNumberOfOnChannelTokens() { 3477 let e3 = 0; 3478 this.fill(); 3479 for (let n2 = 0; n2 < this.tokens.length; n2++) { 3480 const s2 = this.tokens[n2]; 3481 if (s2.channel === this.channel && (e3 += 1), s2.type === t2.EOF) break; 3482 } 3483 return e3; 3484 } 3485 } 3486 class De extends de { 3487 constructor(t3) { 3488 super(), this.parser = t3; 3489 } 3490 enterEveryRule(t3) { 3491 console.log("enter " + this.parser.ruleNames[t3.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); 3492 } 3493 visitTerminal(t3) { 3494 console.log("consume " + t3.symbol + " rule " + this.parser.ruleNames[this.parser._ctx.ruleIndex]); 3495 } 3496 exitEveryRule(t3) { 3497 console.log("exit " + this.parser.ruleNames[t3.ruleIndex] + ", LT(1)=" + this.parser._input.LT(1).text); 3498 } 3499 } 3500 class Fe extends wt { 3501 constructor(t3) { 3502 super(), this._input = null, this._errHandler = new Ae(), this._precedenceStack = [], this._precedenceStack.push(0), this._ctx = null, this.buildParseTrees = true, this._tracer = null, this._parseListeners = null, this._syntaxErrors = 0, this.setInputStream(t3); 3503 } 3504 reset() { 3505 null !== this._input && this._input.seek(0), this._errHandler.reset(this), this._ctx = null, this._syntaxErrors = 0, this.setTrace(false), this._precedenceStack = [], this._precedenceStack.push(0), null !== this._interp && this._interp.reset(); 3506 } 3507 match(t3) { 3508 let e3 = this.getCurrentToken(); 3509 return e3.type === t3 ? (this._errHandler.reportMatch(this), this.consume()) : (e3 = this._errHandler.recoverInline(this), this.buildParseTrees && -1 === e3.tokenIndex && this._ctx.addErrorNode(e3)), e3; 3510 } 3511 matchWildcard() { 3512 let t3 = this.getCurrentToken(); 3513 return t3.type > 0 ? (this._errHandler.reportMatch(this), this.consume()) : (t3 = this._errHandler.recoverInline(this), this.buildParseTrees && -1 === t3.tokenIndex && this._ctx.addErrorNode(t3)), t3; 3514 } 3515 getParseListeners() { 3516 return this._parseListeners || []; 3517 } 3518 addParseListener(t3) { 3519 if (null === t3) throw "listener"; 3520 null === this._parseListeners && (this._parseListeners = []), this._parseListeners.push(t3); 3521 } 3522 removeParseListener(t3) { 3523 if (null !== this._parseListeners) { 3524 const e3 = this._parseListeners.indexOf(t3); 3525 e3 >= 0 && this._parseListeners.splice(e3, 1), 0 === this._parseListeners.length && (this._parseListeners = null); 3526 } 3527 } 3528 removeParseListeners() { 3529 this._parseListeners = null; 3530 } 3531 triggerEnterRuleEvent() { 3532 if (null !== this._parseListeners) { 3533 const t3 = this._ctx; 3534 this._parseListeners.forEach((function(e3) { 3535 e3.enterEveryRule(t3), t3.enterRule(e3); 3536 })); 3537 } 3538 } 3539 triggerExitRuleEvent() { 3540 if (null !== this._parseListeners) { 3541 const t3 = this._ctx; 3542 this._parseListeners.slice(0).reverse().forEach((function(e3) { 3543 t3.exitRule(e3), e3.exitEveryRule(t3); 3544 })); 3545 } 3546 } 3547 getTokenFactory() { 3548 return this._input.tokenSource._factory; 3549 } 3550 setTokenFactory(t3) { 3551 this._input.tokenSource._factory = t3; 3552 } 3553 getATNWithBypassAlts() { 3554 const t3 = this.getSerializedATN(); 3555 if (null === t3) throw "The current parser does not support an ATN with bypass alternatives."; 3556 let e3 = this.bypassAltsAtnCache[t3]; 3557 if (null === e3) { 3558 const n2 = new Tt(); 3559 n2.generateRuleBypassTransitions = true, e3 = new Lt(n2).deserialize(t3), this.bypassAltsAtnCache[t3] = e3; 3560 } 3561 return e3; 3562 } 3563 getInputStream() { 3564 return this.getTokenStream(); 3565 } 3566 setInputStream(t3) { 3567 this.setTokenStream(t3); 3568 } 3569 getTokenStream() { 3570 return this._input; 3571 } 3572 setTokenStream(t3) { 3573 this._input = null, this.reset(), this._input = t3; 3574 } 3575 get syntaxErrorsCount() { 3576 return this._syntaxErrors; 3577 } 3578 getCurrentToken() { 3579 return this._input.LT(1); 3580 } 3581 notifyErrorListeners(t3, e3, n2) { 3582 n2 = n2 || null, null === (e3 = e3 || null) && (e3 = this.getCurrentToken()), this._syntaxErrors += 1; 3583 const s2 = e3.line, i3 = e3.column; 3584 this.getErrorListenerDispatch().syntaxError(this, e3, s2, i3, t3, n2); 3585 } 3586 consume() { 3587 const e3 = this.getCurrentToken(); 3588 e3.type !== t2.EOF && this.getInputStream().consume(); 3589 const n2 = null !== this._parseListeners && this._parseListeners.length > 0; 3590 if (this.buildParseTrees || n2) { 3591 let t3; 3592 t3 = this._errHandler.inErrorRecoveryMode(this) ? this._ctx.addErrorNode(e3) : this._ctx.addTokenNode(e3), t3.invokingState = this.state, n2 && this._parseListeners.forEach((function(e4) { 3593 t3 instanceof b2 || void 0 !== t3.isErrorNode && t3.isErrorNode() ? e4.visitErrorNode(t3) : t3 instanceof P2 && e4.visitTerminal(t3); 3594 })); 3595 } 3596 return e3; 3597 } 3598 addContextToParseTree() { 3599 null !== this._ctx.parentCtx && this._ctx.parentCtx.addChild(this._ctx); 3600 } 3601 enterRule(t3, e3, n2) { 3602 this.state = e3, this._ctx = t3, this._ctx.start = this._input.LT(1), this.buildParseTrees && this.addContextToParseTree(), this.triggerEnterRuleEvent(); 3603 } 3604 exitRule() { 3605 this._ctx.stop = this._input.LT(-1), this.triggerExitRuleEvent(), this.state = this._ctx.invokingState, this._ctx = this._ctx.parentCtx; 3606 } 3607 enterOuterAlt(t3, e3) { 3608 t3.setAltNumber(e3), this.buildParseTrees && this._ctx !== t3 && null !== this._ctx.parentCtx && (this._ctx.parentCtx.removeLastChild(), this._ctx.parentCtx.addChild(t3)), this._ctx = t3; 3609 } 3610 getPrecedence() { 3611 return 0 === this._precedenceStack.length ? -1 : this._precedenceStack[this._precedenceStack.length - 1]; 3612 } 3613 enterRecursionRule(t3, e3, n2, s2) { 3614 this.state = e3, this._precedenceStack.push(s2), this._ctx = t3, this._ctx.start = this._input.LT(1), this.triggerEnterRuleEvent(); 3615 } 3616 pushNewRecursionContext(t3, e3, n2) { 3617 const s2 = this._ctx; 3618 s2.parentCtx = t3, s2.invokingState = e3, s2.stop = this._input.LT(-1), this._ctx = t3, this._ctx.start = s2.start, this.buildParseTrees && this._ctx.addChild(s2), this.triggerEnterRuleEvent(); 3619 } 3620 unrollRecursionContexts(t3) { 3621 this._precedenceStack.pop(), this._ctx.stop = this._input.LT(-1); 3622 const e3 = this._ctx, n2 = this.getParseListeners(); 3623 if (null !== n2 && n2.length > 0) for (; this._ctx !== t3; ) this.triggerExitRuleEvent(), this._ctx = this._ctx.parentCtx; 3624 else this._ctx = t3; 3625 e3.parentCtx = t3, this.buildParseTrees && null !== t3 && t3.addChild(e3); 3626 } 3627 getInvokingContext(t3) { 3628 let e3 = this._ctx; 3629 for (; null !== e3; ) { 3630 if (e3.ruleIndex === t3) return e3; 3631 e3 = e3.parentCtx; 3632 } 3633 return null; 3634 } 3635 precpred(t3, e3) { 3636 return e3 >= this._precedenceStack[this._precedenceStack.length - 1]; 3637 } 3638 inContext(t3) { 3639 return false; 3640 } 3641 isExpectedToken(e3) { 3642 const n2 = this._interp.atn; 3643 let s2 = this._ctx; 3644 const i3 = n2.states[this.state]; 3645 let r3 = n2.nextTokens(i3); 3646 if (r3.contains(e3)) return true; 3647 if (!r3.contains(t2.EPSILON)) return false; 3648 for (; null !== s2 && s2.invokingState >= 0 && r3.contains(t2.EPSILON); ) { 3649 const t3 = n2.states[s2.invokingState].transitions[0]; 3650 if (r3 = n2.nextTokens(t3.followState), r3.contains(e3)) return true; 3651 s2 = s2.parentCtx; 3652 } 3653 return !(!r3.contains(t2.EPSILON) || e3 !== t2.EOF); 3654 } 3655 getExpectedTokens() { 3656 return this._interp.atn.getExpectedTokens(this.state, this._ctx); 3657 } 3658 getExpectedTokensWithinCurrentRule() { 3659 const t3 = this._interp.atn, e3 = t3.states[this.state]; 3660 return t3.nextTokens(e3); 3661 } 3662 getRuleIndex(t3) { 3663 const e3 = this.getRuleIndexMap()[t3]; 3664 return null !== e3 ? e3 : -1; 3665 } 3666 getRuleInvocationStack(t3) { 3667 null === (t3 = t3 || null) && (t3 = this._ctx); 3668 const e3 = []; 3669 for (; null !== t3; ) { 3670 const n2 = t3.ruleIndex; 3671 n2 < 0 ? e3.push("n/a") : e3.push(this.ruleNames[n2]), t3 = t3.parentCtx; 3672 } 3673 return e3; 3674 } 3675 getDFAStrings() { 3676 return this._interp.decisionToDFA.toString(); 3677 } 3678 dumpDFA() { 3679 let t3 = false; 3680 for (let e3 = 0; e3 < this._interp.decisionToDFA.length; e3++) { 3681 const n2 = this._interp.decisionToDFA[e3]; 3682 n2.states.length > 0 && (t3 && console.log(), this.printer.println("Decision " + n2.decision + ":"), this.printer.print(n2.toString(this.literalNames, this.symbolicNames)), t3 = true); 3683 } 3684 } 3685 getSourceName() { 3686 return this._input.sourceName; 3687 } 3688 setTrace(t3) { 3689 t3 ? (null !== this._tracer && this.removeParseListener(this._tracer), this._tracer = new De(this), this.addParseListener(this._tracer)) : (this.removeParseListener(this._tracer), this._tracer = null); 3690 } 3691 } 3692 Fe.bypassAltsAtnCache = {}; 3693 class Me extends P2 { 3694 constructor(t3) { 3695 super(), this.parentCtx = null, this.symbol = t3; 3696 } 3697 getChild(t3) { 3698 return null; 3699 } 3700 getSymbol() { 3701 return this.symbol; 3702 } 3703 getParent() { 3704 return this.parentCtx; 3705 } 3706 getPayload() { 3707 return this.symbol; 3708 } 3709 getSourceInterval() { 3710 if (null === this.symbol) return m2.INVALID_INTERVAL; 3711 const t3 = this.symbol.tokenIndex; 3712 return new m2(t3, t3); 3713 } 3714 getChildCount() { 3715 return 0; 3716 } 3717 accept(t3) { 3718 return t3.visitTerminal(this); 3719 } 3720 getText() { 3721 return this.symbol.text; 3722 } 3723 toString() { 3724 return this.symbol.type === t2.EOF ? "<EOF>" : this.symbol.text; 3725 } 3726 } 3727 class Ue extends Me { 3728 constructor(t3) { 3729 super(t3); 3730 } 3731 isErrorNode() { 3732 return true; 3733 } 3734 accept(t3) { 3735 return t3.visitErrorNode(this); 3736 } 3737 } 3738 class Be extends M2 { 3739 constructor(t3, e3) { 3740 super(t3, e3), this.children = null, this.start = null, this.stop = null, this.exception = null; 3741 } 3742 copyFrom(t3) { 3743 this.parentCtx = t3.parentCtx, this.invokingState = t3.invokingState, this.children = null, this.start = t3.start, this.stop = t3.stop, t3.children && (this.children = [], t3.children.map((function(t4) { 3744 t4 instanceof Ue && (this.children.push(t4), t4.parentCtx = this); 3745 }), this)); 3746 } 3747 enterRule(t3) { 3748 } 3749 exitRule(t3) { 3750 } 3751 addChild(t3) { 3752 return null === this.children && (this.children = []), this.children.push(t3), t3; 3753 } 3754 removeLastChild() { 3755 null !== this.children && this.children.pop(); 3756 } 3757 addTokenNode(t3) { 3758 const e3 = new Me(t3); 3759 return this.addChild(e3), e3.parentCtx = this, e3; 3760 } 3761 addErrorNode(t3) { 3762 const e3 = new Ue(t3); 3763 return this.addChild(e3), e3.parentCtx = this, e3; 3764 } 3765 getChild(t3, e3) { 3766 if (e3 = e3 || null, null === this.children || t3 < 0 || t3 >= this.children.length) return null; 3767 if (null === e3) return this.children[t3]; 3768 for (let n2 = 0; n2 < this.children.length; n2++) { 3769 const s2 = this.children[n2]; 3770 if (s2 instanceof e3) { 3771 if (0 === t3) return s2; 3772 t3 -= 1; 3773 } 3774 } 3775 return null; 3776 } 3777 getToken(t3, e3) { 3778 if (null === this.children || e3 < 0 || e3 >= this.children.length) return null; 3779 for (let n2 = 0; n2 < this.children.length; n2++) { 3780 const s2 = this.children[n2]; 3781 if (s2 instanceof P2 && s2.symbol.type === t3) { 3782 if (0 === e3) return s2; 3783 e3 -= 1; 3784 } 3785 } 3786 return null; 3787 } 3788 getTokens(t3) { 3789 if (null === this.children) return []; 3790 { 3791 const e3 = []; 3792 for (let n2 = 0; n2 < this.children.length; n2++) { 3793 const s2 = this.children[n2]; 3794 s2 instanceof P2 && s2.symbol.type === t3 && e3.push(s2); 3795 } 3796 return e3; 3797 } 3798 } 3799 getTypedRuleContext(t3, e3) { 3800 return this.getChild(e3, t3); 3801 } 3802 getTypedRuleContexts(t3) { 3803 if (null === this.children) return []; 3804 { 3805 const e3 = []; 3806 for (let n2 = 0; n2 < this.children.length; n2++) { 3807 const s2 = this.children[n2]; 3808 s2 instanceof t3 && e3.push(s2); 3809 } 3810 return e3; 3811 } 3812 } 3813 getChildCount() { 3814 return null === this.children ? 0 : this.children.length; 3815 } 3816 getSourceInterval() { 3817 return null === this.start || null === this.stop ? m2.INVALID_INTERVAL : new m2(this.start.tokenIndex, this.stop.tokenIndex); 3818 } 3819 } 3820 M2.EMPTY = new Be(); 3821 class Ve { 3822 constructor(t3) { 3823 this.tokens = t3, this.programs = /* @__PURE__ */ new Map(); 3824 } 3825 getTokenStream() { 3826 return this.tokens; 3827 } 3828 insertAfter(t3, e3) { 3829 let n2, s2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Ve.DEFAULT_PROGRAM_NAME; 3830 n2 = "number" == typeof t3 ? t3 : t3.tokenIndex; 3831 let i3 = this.getProgram(s2), r3 = new Ge(this.tokens, n2, i3.length, e3); 3832 i3.push(r3); 3833 } 3834 insertBefore(t3, e3) { 3835 let n2, s2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Ve.DEFAULT_PROGRAM_NAME; 3836 n2 = "number" == typeof t3 ? t3 : t3.tokenIndex; 3837 const i3 = this.getProgram(s2), r3 = new Ye(this.tokens, n2, i3.length, e3); 3838 i3.push(r3); 3839 } 3840 replaceSingle(t3, e3) { 3841 let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Ve.DEFAULT_PROGRAM_NAME; 3842 this.replace(t3, t3, e3, n2); 3843 } 3844 replace(t3, e3, n2) { 3845 let s2 = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : Ve.DEFAULT_PROGRAM_NAME; 3846 if ("number" != typeof t3 && (t3 = t3.tokenIndex), "number" != typeof e3 && (e3 = e3.tokenIndex), t3 > e3 || t3 < 0 || e3 < 0 || e3 >= this.tokens.size) throw new RangeError(`replace: range invalid: ${t3}..${e3}(size=${this.tokens.size})`); 3847 let i3 = this.getProgram(s2), r3 = new je(this.tokens, t3, e3, i3.length, n2); 3848 i3.push(r3); 3849 } 3850 delete(t3, e3) { 3851 let n2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : Ve.DEFAULT_PROGRAM_NAME; 3852 void 0 === e3 && (e3 = t3), this.replace(t3, e3, null, n2); 3853 } 3854 getProgram(t3) { 3855 let e3 = this.programs.get(t3); 3856 return null == e3 && (e3 = this.initializeProgram(t3)), e3; 3857 } 3858 initializeProgram(t3) { 3859 const e3 = []; 3860 return this.programs.set(t3, e3), e3; 3861 } 3862 getText(e3) { 3863 let n2, s2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : Ve.DEFAULT_PROGRAM_NAME; 3864 n2 = e3 instanceof m2 ? e3 : new m2(0, this.tokens.size - 1), "string" == typeof e3 && (s2 = e3); 3865 const i3 = this.programs.get(s2); 3866 let r3 = n2.start, o3 = n2.stop; 3867 if (o3 > this.tokens.size - 1 && (o3 = this.tokens.size - 1), r3 < 0 && (r3 = 0), null == i3 || 0 === i3.length) return this.tokens.getText(new m2(r3, o3)); 3868 let a3 = [], l3 = this.reduceToSingleOperationPerIndex(i3), h3 = r3; 3869 for (; h3 <= o3 && h3 < this.tokens.size; ) { 3870 let e4 = l3.get(h3); 3871 l3.delete(h3); 3872 let n3 = this.tokens.get(h3); 3873 null == e4 ? (n3.type !== t2.EOF && a3.push(String(n3.text)), h3++) : h3 = e4.execute(a3); 3874 } 3875 if (o3 === this.tokens.size - 1) for (const t3 of l3.values()) t3.index >= this.tokens.size - 1 && a3.push(t3.text.toString()); 3876 return a3.join(""); 3877 } 3878 reduceToSingleOperationPerIndex(t3) { 3879 for (let e4 = 0; e4 < t3.length; e4++) { 3880 let n2 = t3[e4]; 3881 if (null == n2) continue; 3882 if (!(n2 instanceof je)) continue; 3883 let s2 = n2, i3 = this.getKindOfOps(t3, Ye, e4); 3884 for (let e5 of i3) e5.index === s2.index ? (t3[e5.instructionIndex] = void 0, s2.text = e5.text.toString() + (null != s2.text ? s2.text.toString() : "")) : e5.index > s2.index && e5.index <= s2.lastIndex && (t3[e5.instructionIndex] = void 0); 3885 let r3 = this.getKindOfOps(t3, je, e4); 3886 for (let e5 of r3) { 3887 if (e5.index >= s2.index && e5.lastIndex <= s2.lastIndex) { 3888 t3[e5.instructionIndex] = void 0; 3889 continue; 3890 } 3891 let n3 = e5.lastIndex < s2.index || e5.index > s2.lastIndex; 3892 if (null != e5.text || null != s2.text || n3) { 3893 if (!n3) throw new Error(`replace op boundaries of ${s2} overlap with previous ${e5}`); 3894 } else t3[e5.instructionIndex] = void 0, s2.index = Math.min(e5.index, s2.index), s2.lastIndex = Math.max(e5.lastIndex, s2.lastIndex); 3895 } 3896 } 3897 for (let e4 = 0; e4 < t3.length; e4++) { 3898 let n2 = t3[e4]; 3899 if (null == n2) continue; 3900 if (!(n2 instanceof Ye)) continue; 3901 let s2 = n2, i3 = this.getKindOfOps(t3, Ye, e4); 3902 for (let e5 of i3) e5.index === s2.index && (e5 instanceof Ge ? (s2.text = this.catOpText(e5.text, s2.text), t3[e5.instructionIndex] = void 0) : e5 instanceof Ye && (s2.text = this.catOpText(s2.text, e5.text), t3[e5.instructionIndex] = void 0)); 3903 let r3 = this.getKindOfOps(t3, je, e4); 3904 for (let n3 of r3) if (s2.index !== n3.index) { 3905 if (s2.index >= n3.index && s2.index <= n3.lastIndex) throw new Error(`insert op ${s2} within boundaries of previous ${n3}`); 3906 } else n3.text = this.catOpText(s2.text, n3.text), t3[e4] = void 0; 3907 } 3908 let e3 = /* @__PURE__ */ new Map(); 3909 for (let n2 of t3) if (null != n2) { 3910 if (null != e3.get(n2.index)) throw new Error("should only be one op per index"); 3911 e3.set(n2.index, n2); 3912 } 3913 return e3; 3914 } 3915 catOpText(t3, e3) { 3916 let n2 = "", s2 = ""; 3917 return null != t3 && (n2 = t3.toString()), null != e3 && (s2 = e3.toString()), n2 + s2; 3918 } 3919 getKindOfOps(t3, e3, n2) { 3920 return t3.slice(0, n2).filter(((t4) => t4 && t4 instanceof e3)); 3921 } 3922 } 3923 var ze, qe, He; 3924 ze = Ve, He = "default", (qe = (function(t3) { 3925 var e3 = (function(t4, e4) { 3926 if ("object" != typeof t4 || null === t4) return t4; 3927 var n2 = t4[Symbol.toPrimitive]; 3928 if (void 0 !== n2) { 3929 var s2 = n2.call(t4, "string"); 3930 if ("object" != typeof s2) return s2; 3931 throw new TypeError("@@toPrimitive must return a primitive value."); 3932 } 3933 return String(t4); 3934 })(t3); 3935 return "symbol" == typeof e3 ? e3 : String(e3); 3936 })(qe = "DEFAULT_PROGRAM_NAME")) in ze ? Object.defineProperty(ze, qe, { value: He, enumerable: true, configurable: true, writable: true }) : ze[qe] = He; 3937 class Ke { 3938 constructor(t3, e3, n2, s2) { 3939 this.tokens = t3, this.instructionIndex = n2, this.index = e3, this.text = void 0 === s2 ? "" : s2; 3940 } 3941 toString() { 3942 let t3 = this.constructor.name; 3943 const e3 = t3.indexOf("$"); 3944 return t3 = t3.substring(e3 + 1, t3.length), "<" + t3 + "@" + this.tokens.get(this.index) + ':"' + this.text + '">'; 3945 } 3946 } 3947 class Ye extends Ke { 3948 constructor(t3, e3, n2, s2) { 3949 super(t3, e3, n2, s2); 3950 } 3951 execute(e3) { 3952 return this.text && e3.push(this.text.toString()), this.tokens.get(this.index).type !== t2.EOF && e3.push(String(this.tokens.get(this.index).text)), this.index + 1; 3953 } 3954 } 3955 class Ge extends Ye { 3956 constructor(t3, e3, n2, s2) { 3957 super(t3, e3 + 1, n2, s2); 3958 } 3959 } 3960 class je extends Ke { 3961 constructor(t3, e3, n2, s2, i3) { 3962 super(t3, e3, s2, i3), this.lastIndex = n2; 3963 } 3964 execute(t3) { 3965 return this.text && t3.push(this.text.toString()), this.lastIndex + 1; 3966 } 3967 toString() { 3968 return null == this.text ? "<DeleteOp@" + this.tokens.get(this.index) + ".." + this.tokens.get(this.lastIndex) + ">" : "<ReplaceOp@" + this.tokens.get(this.index) + ".." + this.tokens.get(this.lastIndex) + ':"' + this.text + '">'; 3969 } 3970 } 3971 const We = { atn: re, dfa: he, context: ce, misc: ue, tree: fe, error: Ne, Token: t2, CommonToken: Pt, CharStreams: ve, CharStream: Ie, InputStream: Ie, CommonTokenStream: be, Lexer: Ut, Parser: Fe, ParserRuleContext: Be, Interval: m2, IntervalSet: E2, LL1Analyzer: W, Utils: Re, TokenStreamRewriter: Ve }; 3972})(); 3973var i = s.dx; 3974var r = s.q2; 3975var o = s.FO; 3976var a = s.xf; 3977var l = s.Gy; 3978var h = s.s4; 3979var c = s.c7; 3980var u = s._7; 3981var d = s.tx; 3982var p = s.gp; 3983var g = s.cK; 3984var f = s.zs; 3985var x = s.AV; 3986var T = s.Xp; 3987var S = s.VS; 3988var m = s.ul; 3989var E = s.hW; 3990var _ = s.x1; 3991var A = s.z5; 3992var C = s.oN; 3993var N = s.TB; 3994var y = s.u1; 3995var I = s._b; 3996var k = s.$F; 3997var L = s._T; 3998var O = s.db; 3999var v = s.Zx; 4000var R = s._x; 4001var w = s.r8; 4002var P = s.JI; 4003var b = s.TP; 4004var D = s.WU; 4005var F = s.Nj; 4006var M = s.ZP; 4007
4008// src/worker/legacy/zomic/ZomicLexer.js 4009var serializedATN = [ 4010 4, 4011 0, 4012 48, 4013 432, 4014 6, 4015 -1, 4016 2, 4017 0, 4018 7, 4019 0, 4020 2, 4021 1, 4022 7, 4023 1, 4024 2, 4025 2, 4026 7, 4027 2, 4028 2, 4029 3, 4030 7, 4031 3, 4032 2, 4033 4, 4034 7, 4035 4, 4036 2, 4037 5, 4038 7, 4039 5, 4040 2, 4041 6, 4042 7, 4043 6, 4044 2, 4045 7, 4046 7, 4047 7, 4048 2, 4049 8, 4050 7, 4051 8, 4052 2, 4053 9, 4054 7, 4055 9, 4056 2, 4057 10, 4058 7, 4059 10, 4060 2, 4061 11, 4062 7, 4063 11, 4064 2, 4065 12, 4066 7, 4067 12, 4068 2, 4069 13, 4070 7, 4071 13, 4072 2, 4073 14, 4074 7, 4075 14, 4076 2, 4077 15, 4078 7, 4079 15, 4080 2, 4081 16, 4082 7, 4083 16, 4084 2, 4085 17, 4086 7, 4087 17, 4088 2, 4089 18, 4090 7, 4091 18, 4092 2, 4093 19, 4094 7, 4095 19, 4096 2, 4097 20, 4098 7, 4099 20, 4100 2, 4101 21, 4102 7, 4103 21, 4104 2, 4105 22, 4106 7, 4107 22, 4108 2, 4109 23, 4110 7, 4111 23, 4112 2, 4113 24, 4114 7, 4115 24, 4116 2, 4117 25, 4118 7, 4119 25, 4120 2, 4121 26, 4122 7, 4123 26, 4124 2, 4125 27, 4126 7, 4127 27, 4128 2, 4129 28, 4130 7, 4131 28, 4132 2, 4133 29, 4134 7, 4135 29, 4136 2, 4137 30, 4138 7, 4139 30, 4140 2, 4141 31, 4142 7, 4143 31, 4144 2, 4145 32, 4146 7, 4147 32, 4148 2, 4149 33, 4150 7, 4151 33, 4152 2, 4153 34, 4154 7, 4155 34, 4156 2, 4157 35, 4158 7, 4159 35, 4160 2, 4161 36, 4162 7, 4163 36, 4164 2, 4165 37, 4166 7, 4167 37, 4168 2, 4169 38, 4170 7, 4171 38, 4172 2, 4173 39, 4174 7, 4175 39, 4176 2, 4177 40, 4178 7, 4179 40, 4180 2, 4181 41, 4182 7, 4183 41, 4184 2, 4185 42, 4186 7, 4187 42, 4188 2, 4189 43, 4190 7, 4191 43, 4192 2, 4193 44, 4194 7, 4195 44, 4196 2, 4197 45, 4198 7, 4199 45, 4200 2, 4201 46, 4202 7, 4203 46, 4204 2, 4205 47, 4206 7, 4207 47, 4208 2, 4209 48, 4210 7, 4211 48, 4212 2, 4213 49, 4214 7, 4215 49, 4216 2, 4217 50, 4218 7, 4219 50, 4220 2, 4221 51, 4222 7, 4223 51, 4224 2, 4225 52, 4226 7, 4227 52, 4228 2, 4229 53, 4230 7, 4231 53, 4232 2, 4233 54, 4234 7, 4235 54, 4236 1, 4237 0, 4238 1, 4239 0, 4240 1, 4241 0, 4242 1, 4243 0, 4244 1, 4245 0, 4246 1, 4247 0, 4248 1, 4249 1, 4250 1, 4251 1, 4252 1, 4253 1, 4254 1, 4255 1, 4256 1, 4257 1, 4258 1, 4259 1, 4260 1, 4261 2, 4262 1, 4263 2, 4264 1, 4265 2, 4266 1, 4267 2, 4268 1, 4269 2, 4270 1, 4271 2, 4272 1, 4273 3, 4274 1, 4275 3, 4276 1, 4277 3, 4278 1, 4279 3, 4280 1, 4281 3, 4282 1, 4283 4, 4284 1, 4285 4, 4286 1, 4287 4, 4288 1, 4289 4, 4290 1, 4291 4, 4292 1, 4293 4, 4294 1, 4295 4, 4296 1, 4297 5, 4298 1, 4299 5, 4300 1, 4301 5, 4302 1, 4303 5, 4304 1, 4305 5, 4306 1, 4307 5, 4308 1, 4309 5, 4310 1, 4311 6, 4312 1, 4313 6, 4314 1, 4315 6, 4316 1, 4317 6, 4318 1, 4319 6, 4320 1, 4321 6, 4322 1, 4323 6, 4324 1, 4325 6, 4326 1, 4327 7, 4328 1, 4329 7, 4330 1, 4331 7, 4332 1, 4333 7, 4334 1, 4335 7, 4336 1, 4337 8, 4338 1, 4339 8, 4340 1, 4341 8, 4342 1, 4343 8, 4344 1, 4345 8, 4346 1, 4347 8, 4348 1, 4349 8, 4350 1, 4351 8, 4352 1, 4353 8, 4354 1, 4355 9, 4356 1, 4357 9, 4358 1, 4359 9, 4360 1, 4361 9, 4362 1, 4363 9, 4364 1, 4365 9, 4366 1, 4367 9, 4368 1, 4369 9, 4370 1, 4371 10, 4372 1, 4373 10, 4374 1, 4375 10, 4376 1, 4377 10, 4378 1, 4379 10, 4380 1, 4381 10, 4382 1, 4383 10, 4384 1, 4385 11, 4386 1, 4387 11, 4388 1, 4389 11, 4390 1, 4391 11, 4392 1, 4393 11, 4394 1, 4395 11, 4396 1, 4397 11, 4398 1, 4399 12, 4400 1, 4401 12, 4402 1, 4403 12, 4404 1, 4405 12, 4406 1, 4407 12, 4408 1, 4409 12, 4410 1, 4411 12, 4412 1, 4413 13, 4414 1, 4415 13, 4416 1, 4417 13, 4418 1, 4419 13, 4420 1, 4421 13, 4422 1, 4423 14, 4424 1, 4425 14, 4426 1, 4427 14, 4428 1, 4429 14, 4430 1, 4431 14, 4432 1, 4433 14, 4434 1, 4435 14, 4436 1, 4437 14, 4438 1, 4439 14, 4440 1, 4441 15, 4442 1, 4443 15, 4444 1, 4445 15, 4446 1, 4447 15, 4448 1, 4449 15, 4450 1, 4451 15, 4452 1, 4453 15, 4454 1, 4455 15, 4456 1, 4457 15, 4458 1, 4459 15, 4460 1, 4461 15, 4462 1, 4463 15, 4464 1, 4465 16, 4466 1, 4467 16, 4468 1, 4469 16, 4470 1, 4471 16, 4472 1, 4473 17, 4474 1, 4475 17, 4476 1, 4477 17, 4478 1, 4479 17, 4480 1, 4481 17, 4482 1, 4483 18, 4484 1, 4485 18, 4486 1, 4487 18, 4488 1, 4489 18, 4490 1, 4491 18, 4492 1, 4493 19, 4494 1, 4495 19, 4496 1, 4497 19, 4498 1, 4499 19, 4500 1, 4501 19, 4502 1, 4503 19, 4504 1, 4505 20, 4506 1, 4507 20, 4508 1, 4509 20, 4510 1, 4511 20, 4512 1, 4513 20, 4514 1, 4515 20, 4516 1, 4517 20, 4518 1, 4519 21, 4520 1, 4521 21, 4522 1, 4523 21, 4524 1, 4525 21, 4526 1, 4527 21, 4528 1, 4529 22, 4530 1, 4531 22, 4532 1, 4533 22, 4534 1, 4535 22, 4536 1, 4537 22, 4538 1, 4539 22, 4540 1, 4541 23, 4542 1, 4543 23, 4544 1, 4545 23, 4546 1, 4547 23, 4548 1, 4549 23, 4550 1, 4551 23, 4552 1, 4553 23, 4554 1, 4555 24, 4556 1, 4557 24, 4558 1, 4559 24, 4560 1, 4561 24, 4562 1, 4563 24, 4564 1, 4565 24, 4566 1, 4567 24, 4568 1, 4569 25, 4570 1, 4571 25, 4572 1, 4573 25, 4574 1, 4575 25, 4576 1, 4577 25, 4578 1, 4579 25, 4580 1, 4581 26, 4582 1, 4583 26, 4584 1, 4585 26, 4586 1, 4587 26, 4588 1, 4589 27, 4590 1, 4591 27, 4592 1, 4593 27, 4594 1, 4595 27, 4596 1, 4597 27, 4598 1, 4599 28, 4600 1, 4601 28, 4602 1, 4603 28, 4604 1, 4605 28, 4606 1, 4607 28, 4608 1, 4609 28, 4610 1, 4611 28, 4612 1, 4613 28, 4614 1, 4615 28, 4616 1, 4617 29, 4618 1, 4619 29, 4620 1, 4621 29, 4622 1, 4623 29, 4624 1, 4625 29, 4626 1, 4627 30, 4628 1, 4629 30, 4630 1, 4631 30, 4632 1, 4633 30, 4634 1, 4635 30, 4636 1, 4637 31, 4638 1, 4639 31, 4640 1, 4641 31, 4642 1, 4643 31, 4644 1, 4645 31, 4646 1, 4647 31, 4648 1, 4649 31, 4650 1, 4651 31, 4652 1, 4653 31, 4654 1, 4655 31, 4656 1, 4657 32, 4658 1, 4659 32, 4660 1, 4661 32, 4662 1, 4663 32, 4664 1, 4665 32, 4666 1, 4667 32, 4668 1, 4669 32, 4670 1, 4671 33, 4672 1, 4673 33, 4674 1, 4675 33, 4676 1, 4677 33, 4678 1, 4679 34, 4680 1, 4681 34, 4682 1, 4683 34, 4684 1, 4685 34, 4686 1, 4687 34, 4688 1, 4689 34, 4690 1, 4691 34, 4692 1, 4693 34, 4694 1, 4695 34, 4696 1, 4697 35, 4698 1, 4699 35, 4700 1, 4701 36, 4702 1, 4703 36, 4704 1, 4705 37, 4706 1, 4707 37, 4708 1, 4709 38, 4710 1, 4711 38, 4712 1, 4713 39, 4714 1, 4715 39, 4716 1, 4717 40, 4718 1, 4719 40, 4720 3, 4721 40, 4722 354, 4723 8, 4724 40, 4725 1, 4726 40, 4727 1, 4728 40, 4729 1, 4730 41, 4731 3, 4732 41, 4733 359, 4734 8, 4735 41, 4736 1, 4737 41, 4738 1, 4739 41, 4740 3, 4741 41, 4742 363, 4743 8, 4744 41, 4745 1, 4746 41, 4747 3, 4748 41, 4749 366, 4750 8, 4751 41, 4752 1, 4753 42, 4754 1, 4755 42, 4756 1, 4757 43, 4758 4, 4759 43, 4760 371, 4761 8, 4762 43, 4763 11, 4764 43, 4765 12, 4766 43, 4767 372, 4768 1, 4769 44, 4770 3, 4771 44, 4772 376, 4773 8, 4774 44, 4775 1, 4776 44, 4777 4, 4778 44, 4779 379, 4780 8, 4781 44, 4782 11, 4783 44, 4784 12, 4785 44, 4786 380, 4787 1, 4788 45, 4789 1, 4790 45, 4791 1, 4792 46, 4793 1, 4794 46, 4795 1, 4796 47, 4797 1, 4798 47, 4799 1, 4800 47, 4801 1, 4802 48, 4803 1, 4804 48, 4805 1, 4806 48, 4807 1, 4808 49, 4809 1, 4810 49, 4811 1, 4812 49, 4813 1, 4814 50, 4815 1, 4816 50, 4817 5, 4818 50, 4819 398, 4820 8, 4821 50, 4822 10, 4823 50, 4824 12, 4825 50, 4826 401, 4827 9, 4828 50, 4829 1, 4830 50, 4831 1, 4832 50, 4833 3, 4834 50, 4835 405, 4836 8, 4837 50, 4838 1, 4839 50, 4840 1, 4841 50, 4842 1, 4843 51, 4844 1, 4845 51, 4846 1, 4847 51, 4848 5, 4849 51, 4850 412, 4851 8, 4852 51, 4853 10, 4854 51, 4855 12, 4856 51, 4857 415, 4858 9, 4859 51, 4860 1, 4861 51, 4862 1, 4863 51, 4864 1, 4865 51, 4866 1, 4867 51, 4868 1, 4869 52, 4870 1, 4871 52, 4872 1, 4873 53, 4874 1, 4875 53, 4876 1, 4877 53, 4878 5, 4879 53, 4880 426, 4881 8, 4882 53, 4883 10, 4884 53, 4885 12, 4886 53, 4887 429, 4888 9, 4889 53, 4890 1, 4891 54, 4892 1, 4893 54, 4894 1, 4895 413, 4896 0, 4897 55, 4898 1, 4899 1, 4900 3, 4901 2, 4902 5, 4903 3, 4904 7, 4905 4, 4906 9, 4907 5, 4908 11, 4909 6, 4910 13, 4911 7, 4912 15, 4913 8, 4914 17, 4915 9, 4916 19, 4917 10, 4918 21, 4919 11, 4920 23, 4921 12, 4922 25, 4923 13, 4924 27, 4925 14, 4926 29, 4927 15, 4928 31, 4929 16, 4930 33, 4931 17, 4932 35, 4933 18, 4934 37, 4935 19, 4936 39, 4937 20, 4938 41, 4939 21, 4940 43, 4941 22, 4942 45, 4943 23, 4944 47, 4945 24, 4946 49, 4947 25, 4948 51, 4949 26, 4950 53, 4951 27, 4952 55, 4953 28, 4954 57, 4955 29, 4956 59, 4957 30, 4958 61, 4959 31, 4960 63, 4961 32, 4962 65, 4963 33, 4964 67, 4965 34, 4966 69, 4967 35, 4968 71, 4969 36, 4970 73, 4971 37, 4972 75, 4973 38, 4974 77, 4975 39, 4976 79, 4977 40, 4978 81, 4979 41, 4980 83, 4981 42, 4982 85, 4983 0, 4984 87, 4985 0, 4986 89, 4987 43, 4988 91, 4989 44, 4990 93, 4991 0, 4992 95, 4993 0, 4994 97, 4995 0, 4996 99, 4997 0, 4998 101, 4999 45, 5000 103, 5001 46, 5002 105, 5003 0, 5004 107, 5005 47, 5006 109, 5007 48, 5008 1, 5009 0, 5010 4, 5011 3, 5012 0, 5013 9, 5014 9, 5015 12, 5016 12, 5017 32, 5018 32, 5019 2, 5020 0, 5021 43, 5022 43, 5023 45, 5024 45, 5025 2, 5026 0, 5027 10, 5028 10, 5029 13, 5030 13, 5031 3, 5032 0, 5033 46, 5034 46, 5035 95, 5036 95, 5037 97, 5038 122, 5039 437, 5040 0, 5041 1, 5042 1, 5043 0, 5044 0, 5045 0, 5046 0, 5047 3, 5048 1, 5049 0, 5050 0, 5051 0, 5052 0, 5053 5, 5054 1, 5055 0, 5056 0, 5057 0, 5058 0, 5059 7, 5060 1, 5061 0, 5062 0, 5063 0, 5064 0, 5065 9, 5066 1, 5067 0, 5068 0, 5069 0, 5070 0, 5071 11, 5072 1, 5073 0, 5074 0, 5075 0, 5076 0, 5077 13, 5078 1, 5079 0, 5080 0, 5081 0, 5082 0, 5083 15, 5084 1, 5085 0, 5086 0, 5087 0, 5088 0, 5089 17, 5090 1, 5091 0, 5092 0, 5093 0, 5094 0, 5095 19, 5096 1, 5097 0, 5098 0, 5099 0, 5100 0, 5101 21, 5102 1, 5103 0, 5104 0, 5105 0, 5106 0, 5107 23, 5108 1, 5109 0, 5110 0, 5111 0, 5112 0, 5113 25, 5114 1, 5115 0, 5116 0, 5117 0, 5118 0, 5119 27, 5120 1, 5121 0, 5122 0, 5123 0, 5124 0, 5125 29, 5126 1, 5127 0, 5128 0, 5129 0, 5130 0, 5131 31, 5132 1, 5133 0, 5134 0, 5135 0, 5136 0, 5137 33, 5138 1, 5139 0, 5140 0, 5141 0, 5142 0, 5143 35, 5144 1, 5145 0, 5146 0, 5147 0, 5148 0, 5149 37, 5150 1, 5151 0, 5152 0, 5153 0, 5154 0, 5155 39, 5156 1, 5157 0, 5158 0, 5159 0, 5160 0, 5161 41, 5162 1, 5163 0, 5164 0, 5165 0, 5166 0, 5167 43, 5168 1, 5169 0, 5170 0, 5171 0, 5172 0, 5173 45, 5174 1, 5175 0, 5176 0, 5177 0, 5178 0, 5179 47, 5180 1, 5181 0, 5182 0, 5183 0, 5184 0, 5185 49, 5186 1, 5187 0, 5188 0, 5189 0, 5190 0, 5191 51, 5192 1, 5193 0, 5194 0, 5195 0, 5196 0, 5197 53, 5198 1, 5199 0, 5200 0, 5201 0, 5202 0, 5203 55, 5204 1, 5205 0, 5206 0, 5207 0, 5208 0, 5209 57, 5210 1, 5211 0, 5212 0, 5213 0, 5214 0, 5215 59, 5216 1, 5217 0, 5218 0, 5219 0, 5220 0, 5221 61, 5222 1, 5223 0, 5224 0, 5225 0, 5226 0, 5227 63, 5228 1, 5229 0, 5230 0, 5231 0, 5232 0, 5233 65, 5234 1, 5235 0, 5236 0, 5237 0, 5238 0, 5239 67, 5240 1, 5241 0, 5242 0, 5243 0, 5244 0, 5245 69, 5246 1, 5247 0, 5248 0, 5249 0, 5250 0, 5251 71, 5252 1, 5253 0, 5254 0, 5255 0, 5256 0, 5257 73, 5258 1, 5259 0, 5260 0, 5261 0, 5262 0, 5263 75, 5264 1, 5265 0, 5266 0, 5267 0, 5268 0, 5269 77, 5270 1, 5271 0, 5272 0, 5273 0, 5274 0, 5275 79, 5276 1, 5277 0, 5278 0, 5279 0, 5280 0, 5281 81, 5282 1, 5283 0, 5284 0, 5285 0, 5286 0, 5287 83, 5288 1, 5289 0, 5290 0, 5291 0, 5292 0, 5293 89, 5294 1, 5295 0, 5296 0, 5297 0, 5298 0, 5299 91, 5300 1, 5301 0, 5302 0, 5303 0, 5304 0, 5305 101, 5306 1, 5307 0, 5308 0, 5309 0, 5310 0, 5311 103, 5312 1, 5313 0, 5314 0, 5315 0, 5316 0, 5317 107, 5318 1, 5319 0, 5320 0, 5321 0, 5322 0, 5323 109, 5324 1, 5325 0, 5326 0, 5327 0, 5328 1, 5329 111, 5330 1, 5331 0, 5332 0, 5333 0, 5334 3, 5335 117, 5336 1, 5337 0, 5338 0, 5339 0, 5340 5, 5341 123, 5342 1, 5343 0, 5344 0, 5345 0, 5346 7, 5347 129, 5348 1, 5349 0, 5350 0, 5351 0, 5352 9, 5353 134, 5354 1, 5355 0, 5356 0, 5357 0, 5358 11, 5359 141, 5360 1, 5361 0, 5362 0, 5363 0, 5364 13, 5365 148, 5366 1, 5367 0, 5368 0, 5369 0, 5370 15, 5371 156, 5372 1, 5373 0, 5374 0, 5375 0, 5376 17, 5377 161, 5378 1, 5379 0, 5380 0, 5381 0, 5382 19, 5383 170, 5384 1, 5385 0, 5386 0, 5387 0, 5388 21, 5389 178, 5390 1, 5391 0, 5392 0, 5393 0, 5394 23, 5395 185, 5396 1, 5397 0, 5398 0, 5399 0, 5400 25, 5401 192, 5402 1, 5403 0, 5404 0, 5405 0, 5406 27, 5407 199, 5408 1, 5409 0, 5410 0, 5411 0, 5412 29, 5413 204, 5414 1, 5415 0, 5416 0, 5417 0, 5418 31, 5419 213, 5420 1, 5421 0, 5422 0, 5423 0, 5424 33, 5425 225, 5426 1, 5427 0, 5428 0, 5429 0, 5430 35, 5431 229, 5432 1, 5433 0, 5434 0, 5435 0, 5436 37, 5437 234, 5438 1, 5439 0, 5440 0, 5441 0, 5442 39, 5443 239, 5444 1, 5445 0, 5446 0, 5447 0, 5448 41, 5449 245, 5450 1, 5451 0, 5452 0, 5453 0, 5454 43, 5455 252, 5456 1, 5457 0, 5458 0, 5459 0, 5460 45, 5461 257, 5462 1, 5463 0, 5464 0, 5465 0, 5466 47, 5467 263, 5468 1, 5469 0, 5470 0, 5471 0, 5472 49, 5473 270, 5474 1, 5475 0, 5476 0, 5477 0, 5478 51, 5479 277, 5480 1, 5481 0, 5482 0, 5483 0, 5484 53, 5485 283, 5486 1, 5487 0, 5488 0, 5489 0, 5490 55, 5491 287, 5492 1, 5493 0, 5494 0, 5495 0, 5496 57, 5497 292, 5498 1, 5499 0, 5500 0, 5501 0, 5502 59, 5503 301, 5504 1, 5505 0, 5506 0, 5507 0, 5508 61, 5509 306, 5510 1, 5511 0, 5512 0, 5513 0, 5514 63, 5515 311, 5516 1, 5517 0, 5518 0, 5519 0, 5520 65, 5521 321,
5522 1, 5523 0, 5524 0, 5525 0, 5526 67, 5527 328, 5528 1, 5529 0, 5530 0, 5531 0, 5532 69, 5533 332, 5534 1, 5535 0, 5536 0, 5537 0, 5538 71, 5539 341, 5540 1, 5541 0, 5542 0, 5543 0, 5544 73, 5545 343, 5546 1, 5547 0, 5548 0, 5549 0, 5550 75, 5551 345, 5552 1, 5553 0, 5554 0, 5555 0, 5556 77, 5557 347, 5558 1, 5559 0, 5560 0, 5561 0, 5562 79, 5563 349, 5564 1, 5565 0, 5566 0, 5567 0, 5568 81, 5569 353, 5570 1, 5571 0, 5572 0, 5573 0, 5574 83, 5575 365, 5576 1, 5577 0, 5578 0, 5579 0, 5580 85, 5581 367, 5582 1, 5583 0, 5584 0, 5585 0, 5586 87, 5587 370, 5588 1, 5589 0, 5590 0, 5591 0, 5592 89, 5593 375, 5594 1, 5595 0, 5596 0, 5597 0, 5598 91, 5599 382, 5600 1, 5601 0, 5602 0, 5603 0, 5604 93, 5605 384, 5606 1, 5607 0, 5608 0, 5609 0, 5610 95, 5611 386, 5612 1, 5613 0, 5614 0, 5615 0, 5616 97, 5617 389, 5618 1, 5619 0, 5620 0, 5621 0, 5622 99, 5623 392, 5624 1, 5625 0, 5626 0, 5627 0, 5628 101, 5629 395, 5630 1, 5631 0, 5632 0, 5633 0, 5634 103, 5635 408, 5636 1, 5637 0, 5638 0, 5639 0, 5640 105, 5641 420, 5642 1, 5643 0, 5644 0, 5645 0, 5646 107, 5647 422, 5648 1, 5649 0, 5650 0, 5651 0, 5652 109, 5653 430, 5654 1, 5655 0, 5656 0, 5657 0, 5658 111, 5659 112, 5660 5, 5661 108, 5662 0, 5663 0, 5664 112, 5665 113, 5666 5, 5667 97, 5668 0, 5669 0, 5670 113, 5671 114, 5672 5, 5673 98, 5674 0, 5675 0, 5676 114, 5677 115, 5678 5, 5679 101, 5680 0, 5681 0, 5682 115, 5683 116, 5684 5, 5685 108, 5686 0, 5687 0, 5688 116, 5689 2, 5690 1, 5691 0, 5692 0, 5693 0, 5694 117, 5695 118, 5696 5, 5697 115, 5698 0, 5699 0, 5700 118, 5701 119, 5702 5, 5703 99, 5704 0, 5705 0, 5706 119, 5707 120, 5708 5, 5709 97, 5710 0, 5711 0, 5712 120, 5713 121, 5714 5, 5715 108, 5716 0, 5717 0, 5718 121, 5719 122, 5720 5, 5721 101, 5722 0, 5723 0, 5724 122, 5725 4, 5726 1, 5727 0, 5728 0, 5729 0, 5730 123, 5731 124, 5732 5, 5733 98, 5734 0, 5735 0, 5736 124, 5737 125, 5738 5, 5739 117, 5740 0, 5741 0, 5742 125, 5743 126, 5744 5, 5745 105, 5746 0, 5747 0, 5748 126, 5749 127, 5750 5, 5751 108, 5752 0, 5753 0, 5754 127, 5755 128, 5756 5, 5757 100, 5758 0, 5759 0, 5760 128, 5761 6, 5762 1, 5763 0, 5764 0, 5765 0, 5766 129, 5767 130, 5768 5, 5769 109, 5770 0, 5771 0, 5772 130, 5773 131, 5774 5, 5775 111, 5776 0, 5777 0, 5778 131, 5779 132, 5780 5, 5781 118, 5782 0, 5783 0, 5784 132, 5785 133, 5786 5, 5787 101, 5788 0, 5789 0, 5790 133, 5791 8, 5792 1, 5793 0, 5794 0, 5795 0, 5796 134, 5797 135, 5798 5, 5799 114, 5800 0, 5801 0, 5802 135, 5803 136, 5804 5, 5805 111, 5806 0, 5807 0, 5808 136, 5809 137, 5810 5, 5811 116, 5812 0, 5813 0, 5814 137, 5815 138, 5816 5, 5817 97, 5818 0, 5819 0, 5820 138, 5821 139, 5822 5, 5823 116, 5824 0, 5825 0, 5826 139, 5827 140, 5828 5, 5829 101, 5830 0, 5831 0, 5832 140, 5833 10, 5834 1, 5835 0, 5836 0, 5837 0, 5838 141, 5839 142, 5840 5, 5841 97, 5842 0, 5843 0, 5844 142, 5845 143, 5846 5, 5847 114, 5848 0, 5849 0, 5850 143, 5851 144, 5852 5, 5853 111, 5854 0, 5855 0, 5856 144, 5857 145, 5858 5, 5859 117, 5860 0, 5861 0, 5862 145, 5863 146, 5864 5, 5865 110, 5866 0, 5867 0, 5868 146, 5869 147, 5870 5, 5871 100, 5872 0, 5873 0, 5874 147, 5875 12, 5876 1, 5877 0, 5878 0, 5879 0, 5880 148, 5881 149, 5882 5, 5883 114, 5884 0, 5885 0, 5886 149, 5887 150, 5888 5, 5889 101, 5890 0, 5891 0, 5892 150, 5893 151, 5894 5, 5895 102, 5896 0, 5897 0, 5898 151, 5899 152, 5900 5, 5901 108, 5902 0, 5903 0, 5904 152, 5905 153, 5906 5, 5907 101, 5908 0, 5909 0, 5910 153, 5911 154, 5912 5, 5913 99, 5914 0, 5915 0, 5916 154, 5917 155, 5918 5, 5919 116, 5920 0, 5921 0, 5922 155, 5923 14, 5924 1, 5925 0, 5926 0, 5927 0, 5928 156, 5929 157, 5930 5, 5931 102, 5932 0, 5933 0, 5934 157, 5935 158, 5936 5, 5937 114, 5938 0, 5939 0, 5940 158, 5941 159, 5942 5, 5943 111, 5944 0, 5945 0, 5946 159, 5947 160, 5948 5, 5949 109, 5950 0, 5951 0, 5952 160, 5953 16, 5954 1, 5955 0, 5956 0, 5957 0, 5958 161, 5959 162, 5960 5, 5961 115, 5962 0, 5963 0, 5964 162, 5965 163, 5966 5, 5967 121, 5968 0, 5969 0, 5970 163, 5971 164, 5972 5, 5973 109, 5974 0, 5975 0, 5976 164, 5977 165, 5978 5, 5979 109, 5980 0, 5981 0, 5982 165, 5983 166, 5984 5, 5985 101, 5986 0, 5987 0, 5988 166, 5989 167, 5990 5, 5991 116, 5992 0, 5993 0, 5994 167, 5995 168, 5996 5, 5997 114, 5998 0, 5999 0, 6000 168, 6001 169, 6002 5, 6003 121, 6004 0, 6005 0, 6006 169, 6007 18, 6008 1, 6009 0, 6010 0, 6011 0, 6012 170, 6013 171, 6014 5, 6015 116, 6016 0, 6017 0, 6018 171, 6019 172, 6020 5, 6021 104, 6022 0, 6023 0, 6024 172, 6025 173, 6026 5, 6027 114, 6028 0, 6029 0, 6030 173, 6031 174, 6032 5, 6033 111, 6034 0, 6035 0, 6036 174, 6037 175, 6038 5, 6039 117, 6040 0, 6041 0, 6042 175, 6043 176, 6044 5, 6045 103, 6046 0, 6047 0, 6048 176, 6049 177, 6050 5, 6051 104, 6052 0, 6053 0, 6054 177, 6055 20, 6056 1, 6057 0, 6058 0, 6059 0, 6060 178, 6061 179, 6062 5, 6063 99, 6064 0, 6065 0, 6066 179, 6067 180, 6068 5, 6069 101, 6070 0, 6071 0, 6072 180, 6073 181, 6074 5, 6075 110, 6076 0, 6077 0, 6078 181, 6079 182, 6080 5, 6081 116, 6082 0, 6083 0, 6084 182, 6085 183, 6086 5, 6087 101, 6088 0, 6089 0, 6090 183, 6091 184, 6092 5, 6093 114, 6094 0, 6095 0, 6096 184, 6097 22, 6098 1, 6099 0, 6100 0, 6101 0, 6102 185, 6103 186, 6104 5, 6105 114, 6106 0, 6107 0, 6108 186, 6109 187, 6110 5, 6111 101, 6112 0, 6113 0, 6114 187, 6115 188, 6116 5, 6117 112, 6118 0, 6119 0, 6120 188, 6121 189, 6122 5, 6123 101, 6124 0, 6125 0, 6126 189, 6127 190, 6128 5, 6129 97, 6130 0, 6131 0, 6132 190, 6133 191, 6134 5, 6135 116, 6136 0, 6137 0, 6138 191, 6139 24, 6140 1, 6141 0, 6142 0, 6143 0, 6144 192, 6145 193, 6146 5, 6147 98, 6148 0, 6149 0, 6150 193, 6151 194, 6152 5, 6153 114, 6154 0, 6155 0, 6156 194, 6157 195, 6158 5, 6159 97, 6160 0, 6161 0, 6162 195, 6163 196, 6164 5, 6165 110, 6166 0, 6167 0, 6168 196, 6169 197, 6170 5, 6171 99, 6172 0, 6173 0, 6174 197, 6175 198, 6176 5, 6177 104, 6178 0, 6179 0, 6180 198, 6181 26, 6182 1, 6183 0, 6184 0, 6185 0, 6186 199, 6187 200, 6188 5, 6189 115, 6190 0, 6191 0, 6192 200, 6193 201, 6194 5, 6195 97, 6196 0, 6197 0, 6198 201, 6199 202, 6200 5, 6201 118, 6202 0, 6203 0, 6204 202, 6205 203, 6206 5, 6207 101, 6208 0, 6209 0, 6210 203, 6211 28, 6212 1, 6213 0, 6214 0, 6215 0, 6216 204, 6217 205, 6218 5, 6219 108, 6220 0, 6221 0, 6222 205, 6223 206, 6224 5, 6225 111, 6226 0, 6227 0, 6228 206, 6229 207, 6230 5, 6231 99, 6232 0, 6233 0, 6234 207, 6235 208, 6236 5, 6237 97, 6238 0, 6239 0, 6240 208, 6241 209, 6242 5, 6243 116, 6244 0, 6245 0, 6246 209, 6247 210, 6248 5, 6249 105, 6250 0, 6251 0, 6252 210, 6253 211, 6254 5, 6255 111, 6256 0, 6257 0, 6258 211, 6259 212, 6260 5, 6261 110, 6262 0, 6263 0, 6264 212, 6265 30, 6266 1, 6267 0, 6268 0, 6269 0, 6270 213, 6271 214, 6272 5, 6273 111, 6274 0, 6275 0, 6276 214, 6277 215, 6278 5, 6279 114,
6280 0, 6281 0, 6282 215, 6283 216, 6284 5, 6285 105, 6286 0, 6287 0, 6288 216, 6289 217, 6290 5, 6291 101, 6292 0, 6293 0, 6294 217, 6295 218, 6296 5, 6297 110, 6298 0, 6299 0, 6300 218, 6301 219, 6302 5, 6303 116, 6304 0, 6305 0, 6306 219, 6307 220, 6308 5, 6309 97, 6310 0, 6311 0, 6312 220, 6313 221, 6314 5, 6315 116, 6316 0, 6317 0, 6318 221, 6319 222, 6320 5, 6321 105, 6322 0, 6323 0, 6324 222, 6325 223, 6326 5, 6327 111, 6328 0, 6329 0, 6330 223, 6331 224, 6332 5, 6333 110, 6334 0, 6335 0, 6336 224, 6337 32, 6338 1, 6339 0, 6340 0, 6341 0, 6342 225, 6343 226, 6344 5, 6345 97, 6346 0, 6347 0, 6348 226, 6349 227, 6350 5, 6351 108, 6352 0, 6353 0, 6354 227, 6355 228, 6356 5, 6357 108, 6358 0, 6359 0, 6360 228, 6361 34, 6362 1, 6363 0, 6364 0, 6365 0, 6366 229, 6367 230, 6368 5, 6369 104, 6370 0, 6371 0, 6372 230, 6373 231, 6374 5, 6375 97, 6376 0, 6377 0, 6378 231, 6379 232, 6380 5, 6381 108, 6382 0, 6383 0, 6384 232, 6385 233, 6386 5, 6387 102, 6388 0, 6389 0, 6390 233, 6391 36, 6392 1, 6393 0, 6394 0, 6395 0, 6396 234, 6397 235, 6398 5, 6399 115, 6400 0, 6401 0, 6402 235, 6403 236, 6404 5, 6405 105, 6406 0, 6407 0, 6408 236, 6409 237, 6410 5, 6411 122, 6412 0, 6413 0, 6414 237, 6415 238, 6416 5, 6417 101, 6418 0, 6419 0, 6420 238, 6421 38, 6422 1, 6423 0, 6424 0, 6425 0, 6426 239, 6427 240, 6428 5, 6429 115, 6430 0, 6431 0, 6432 240, 6433 241, 6434 5, 6435 104, 6436 0, 6437 0, 6438 241, 6439 242, 6440 5, 6441 111, 6442 0, 6443 0, 6444 242, 6445 243, 6446 5, 6447 114, 6448 0, 6449 0, 6450 243, 6451 244, 6452 5, 6453 116, 6454 0, 6455 0, 6456 244, 6457 40, 6458 1, 6459 0, 6460 0, 6461 0, 6462 245, 6463 246, 6464 5, 6465 109, 6466 0, 6467 0, 6468 246, 6469 247, 6470 5, 6471 101, 6472 0, 6473 0, 6474 247, 6475 248, 6476 5, 6477 100, 6478 0, 6479 0, 6480 248, 6481 249, 6482 5, 6483 105, 6484 0, 6485 0, 6486 249, 6487 250, 6488 5, 6489 117, 6490 0, 6491 0, 6492 250, 6493 251, 6494 5, 6495 109, 6496 0, 6497 0, 6498 251, 6499 42, 6500 1, 6501 0, 6502 0, 6503 0, 6504 252, 6505 253, 6506 5, 6507 108, 6508 0, 6509 0, 6510 253, 6511 254, 6512 5, 6513 111, 6514 0, 6515 0, 6516 254, 6517 255, 6518 5, 6519 110, 6520 0, 6521 0, 6522 255, 6523 256, 6524 5, 6525 103, 6526 0, 6527 0, 6528 256, 6529 44, 6530 1, 6531 0, 6532 0, 6533 0, 6534 257, 6535 258, 6536 5, 6537 103, 6538 0, 6539 0, 6540 258, 6541 259, 6542 5, 6543 114, 6544 0, 6545 0, 6546 259, 6547 260, 6548 5, 6549 101, 6550 0, 6551 0, 6552 260, 6553 261, 6554 5, 6555 101, 6556 0, 6557 0, 6558 261, 6559 262, 6560 5, 6561 110, 6562 0, 6563 0, 6564 262, 6565 46, 6566 1, 6567 0, 6568 0, 6569 0, 6570 263, 6571 264, 6572 5, 6573 111, 6574 0, 6575 0, 6576 264, 6577 265, 6578 5, 6579 114, 6580 0, 6581 0, 6582 265, 6583 266, 6584 5, 6585 97, 6586 0, 6587 0, 6588 266, 6589 267, 6590 5, 6591 110, 6592 0, 6593 0, 6594 267, 6595 268, 6596 5, 6597 103, 6598 0, 6599 0, 6600 268, 6601 269, 6602 5, 6603 101, 6604 0, 6605 0, 6606 269, 6607 48, 6608 1, 6609 0, 6610 0, 6611 0, 6612 270, 6613 271, 6614 5, 6615 112, 6616 0, 6617 0, 6618 271, 6619 272, 6620 5, 6621 117, 6622 0, 6623 0, 6624 272, 6625 273, 6626 5, 6627 114, 6628 0, 6629 0, 6630 273, 6631 274, 6632 5, 6633 112, 6634 0, 6635 0, 6636 274, 6637 275, 6638 5, 6639 108, 6640 0, 6641 0, 6642 275, 6643 276, 6644 5, 6645 101, 6646 0, 6647 0, 6648 276, 6649 50, 6650 1, 6651 0, 6652 0, 6653 0, 6654 277, 6655 278, 6656 5, 6657 98, 6658 0, 6659 0, 6660 278, 6661 279, 6662 5, 6663 108, 6664 0, 6665 0, 6666 279, 6667 280, 6668 5, 6669 97, 6670 0, 6671 0, 6672 280, 6673 281, 6674 5, 6675 99, 6676 0, 6677 0, 6678 281, 6679 282, 6680 5, 6681 107, 6682 0, 6683 0, 6684 282, 6685 52, 6686 1, 6687 0, 6688 0, 6689 0, 6690 283, 6691 284, 6692 5, 6693 114, 6694 0, 6695 0, 6696 284, 6697 285, 6698 5, 6699 101, 6700 0, 6701 0, 6702 285, 6703 286, 6704 5, 6705 100, 6706 0, 6707 0, 6708 286, 6709 54, 6710 1, 6711 0, 6712 0, 6713 0, 6714 287, 6715 288, 6716 5, 6717 112, 6718 0, 6719 0, 6720 288, 6721 289, 6722 5, 6723 101, 6724 0, 6725 0, 6726 289, 6727 290, 6728 5, 6729 110, 6730 0, 6731 0, 6732 290, 6733 291, 6734 5, 6735 116, 6736 0, 6737 0, 6738 291, 6739 56, 6740 1, 6741 0, 6742 0, 6743 0, 6744 292, 6745 293, 6746 5, 6747 112, 6748 0, 6749 0, 6750 293, 6751 294, 6752 5, 6753 101, 6754 0, 6755 0, 6756 294, 6757 295, 6758 5, 6759 110, 6760 0, 6761 0, 6762 295, 6763 296, 6764 5, 6765 116, 6766 0, 6767 0, 6768 296, 6769 297, 6770 5, 6771 97, 6772 0, 6773 0, 6774 297, 6775 298, 6776 5, 6777 103, 6778 0, 6779 0, 6780 298, 6781 299, 6782 5, 6783 111, 6784 0, 6785 0, 6786 299, 6787 300, 6788 5, 6789 110, 6790 0, 6791 0, 6792 300, 6793 58, 6794 1, 6795 0, 6796 0, 6797 0, 6798 301, 6799 302, 6800 5, 6801 98, 6802 0, 6803 0, 6804 302, 6805 303, 6806 5, 6807 108, 6808 0, 6809 0, 6810 303, 6811 304, 6812 5, 6813 117, 6814 0, 6815 0, 6816 304, 6817 305, 6818 5, 6819 101, 6820 0, 6821 0, 6822 305, 6823 60, 6824 1, 6825 0, 6826 0, 6827 0, 6828 306, 6829 307, 6830 5, 6831 114, 6832 0, 6833 0, 6834 307, 6835 308, 6836 5, 6837 101, 6838 0, 6839 0, 6840 308, 6841 309, 6842 5, 6843 99, 6844 0, 6845 0, 6846 309, 6847 310, 6848 5, 6849 116, 6850 0, 6851 0, 6852 310, 6853 62, 6854 1, 6855 0, 6856 0, 6857 0, 6858 311, 6859 312, 6860 5, 6861 114, 6862 0, 6863 0, 6864 312, 6865 313, 6866 5, 6867 101, 6868 0, 6869 0, 6870 313, 6871 314, 6872 5, 6873 99, 6874 0, 6875 0, 6876 314, 6877 315, 6878 5, 6879 116, 6880 0, 6881 0, 6882 315, 6883 316, 6884 5, 6885 97, 6886 0, 6887 0, 6888 316, 6889 317, 6890 5, 6891 110, 6892 0, 6893 0, 6894 317, 6895 318, 6896 5, 6897 103, 6898 0, 6899 0, 6900 318, 6901 319, 6902 5, 6903 108, 6904 0, 6905 0, 6906 319, 6907 320, 6908 5, 6909 101, 6910 0, 6911 0, 6912 320, 6913 64, 6914 1, 6915 0, 6916 0, 6917 0, 6918 321, 6919 322, 6920 5, 6921 121, 6922 0, 6923 0, 6924 322, 6925 323, 6926 5, 6927 101, 6928 0, 6929 0, 6930 323, 6931 324, 6932 5, 6933 108, 6934 0, 6935 0, 6936 324, 6937 325, 6938 5, 6939 108, 6940 0, 6941 0, 6942 325, 6943 326, 6944 5, 6945 111, 6946 0, 6947 0, 6948 326, 6949 327, 6950 5, 6951 119, 6952 0, 6953 0, 6954 327, 6955 66, 6956 1, 6957 0, 6958 0, 6959 0, 6960 328, 6961 329, 6962 5, 6963 116, 6964 0, 6965 0, 6966 329, 6967 330, 6968 5, 6969 114, 6970 0, 6971 0, 6972 330, 6973 331, 6974 5, 6975 105, 6976 0, 6977 0, 6978 331, 6979 68, 6980 1, 6981 0, 6982 0, 6983 0, 6984 332, 6985 333, 6986 5, 6987 116, 6988 0, 6989 0, 6990 333, 6991 334, 6992 5, 6993 114,
6994 0, 6995 0, 6996 334, 6997 335, 6998 5, 6999 105, 7000 0, 7001 0, 7002 335, 7003 336, 7004 5, 7005 97, 7006 0, 7007 0, 7008 336, 7009 337, 7010 5, 7011 110, 7012 0, 7013 0, 7014 337, 7015 338, 7016 5, 7017 103, 7018 0, 7019 0, 7020 338, 7021 339, 7022 5, 7023 108, 7024 0, 7025 0, 7026 339, 7027 340, 7028 5, 7029 101, 7030 0, 7031 0, 7032 340, 7033 70, 7034 1, 7035 0, 7036 0, 7037 0, 7038 341, 7039 342, 7040 5, 7041 123, 7042 0, 7043 0, 7044 342, 7045 72, 7046 1, 7047 0, 7048 0, 7049 0, 7050 343, 7051 344, 7052 5, 7053 125, 7054 0, 7055 0, 7056 344, 7057 74, 7058 1, 7059 0, 7060 0, 7061 0, 7062 345, 7063 346, 7064 5, 7065 40, 7066 0, 7067 0, 7068 346, 7069 76, 7070 1, 7071 0, 7072 0, 7073 0, 7074 347, 7075 348, 7076 5, 7077 41, 7078 0, 7079 0, 7080 348, 7081 78, 7082 1, 7083 0, 7084 0, 7085 0, 7086 349, 7087 350, 7088 5, 7089 63, 7090 0, 7091 0, 7092 350, 7093 80, 7094 1, 7095 0, 7096 0, 7097 0, 7098 351, 7099 354, 7100 7, 7101 0, 7102 0, 7103 0, 7104 352, 7105 354, 7106 3, 7107 83, 7108 41, 7109 0, 7110 353, 7111 351, 7112 1, 7113 0, 7114 0, 7115 0, 7116 353, 7117 352, 7118 1, 7119 0, 7120 0, 7121 0, 7122 354, 7123 355, 7124 1, 7125 0, 7126 0, 7127 0, 7128 355, 7129 356, 7130 6, 7131 40, 7132 0, 7133 0, 7134 356, 7135 82, 7136 1, 7137 0, 7138 0, 7139 0, 7140 357, 7141 359, 7142 5, 7143 13, 7144 0, 7145 0, 7146 358, 7147 357, 7148 1, 7149 0, 7150 0, 7151 0, 7152 358, 7153 359, 7154 1, 7155 0, 7156 0, 7157 0, 7158 359, 7159 360, 7160 1, 7161 0, 7162 0, 7163 0, 7164 360, 7165 366, 7166 5, 7167 10, 7168 0, 7169 0, 7170 361, 7171 363, 7172 5, 7173 10, 7174 0, 7175 0, 7176 362, 7177 361, 7178 1, 7179 0, 7180 0, 7181 0, 7182 362, 7183 363, 7184 1, 7185 0, 7186 0, 7187 0, 7188 363, 7189 364, 7190 1, 7191 0, 7192 0, 7193 0, 7194 364, 7195 366, 7196 5, 7197 13, 7198 0, 7199 0, 7200 365, 7201 358, 7202 1, 7203 0, 7204 0, 7205 0, 7206 365, 7207 362, 7208 1, 7209 0, 7210 0, 7211 0, 7212 366, 7213 84, 7214 1, 7215 0, 7216 0, 7217 0, 7218 367, 7219 368, 7220 2, 7221 48, 7222 57, 7223 0, 7224 368, 7225 86, 7226 1, 7227 0, 7228 0, 7229 0, 7230 369, 7231 371, 7232 3, 7233 85, 7234 42, 7235 0, 7236 370, 7237 369, 7238 1, 7239 0, 7240 0, 7241 0, 7242 371, 7243 372, 7244 1, 7245 0, 7246 0, 7247 0, 7248 372, 7249 370, 7250 1, 7251 0, 7252 0, 7253 0, 7254 372, 7255 373, 7256 1, 7257 0, 7258 0, 7259 0, 7260 373, 7261 88, 7262 1, 7263 0, 7264 0, 7265 0, 7266 374, 7267 376, 7268 7, 7269 1, 7270 0, 7271 0, 7272 375, 7273 374, 7274 1, 7275 0, 7276 0, 7277 0, 7278 375, 7279 376, 7280 1, 7281 0, 7282 0, 7283 0, 7284 376, 7285 378, 7286 1, 7287 0, 7288 0, 7289 0, 7290 377, 7291 379, 7292 3, 7293 87, 7294 43, 7295 0, 7296 378, 7297 377, 7298 1, 7299 0, 7300 0, 7301 0, 7302 379, 7303 380, 7304 1, 7305 0, 7306 0, 7307 0, 7308 380, 7309 378, 7310 1, 7311 0, 7312 0, 7313 0, 7314 380, 7315 381, 7316 1, 7317 0, 7318 0, 7319 0, 7320 381, 7321 90, 7322 1, 7323 0, 7324 0, 7325 0, 7326 382, 7327 383, 7328 7, 7329 1, 7330 0, 7331 0, 7332 383, 7333 92, 7334 1, 7335 0, 7336 0, 7337 0, 7338 384, 7339 385, 7340 8, 7341 2, 7342 0, 7343 0, 7344 385, 7345 94, 7346 1, 7347 0, 7348 0, 7349 0, 7350 386, 7351 387, 7352 5, 7353 47, 7354 0, 7355 0, 7356 387, 7357 388, 7358 5, 7359 47, 7360 0, 7361 0, 7362 388, 7363 96, 7364 1, 7365 0, 7366 0, 7367 0, 7368 389, 7369 390, 7370 5, 7371 47, 7372 0, 7373 0, 7374 390, 7375 391, 7376 5, 7377 42, 7378 0, 7379 0, 7380 391, 7381 98, 7382 1, 7383 0, 7384 0, 7385 0, 7386 392, 7387 393, 7388 5, 7389 42, 7390 0, 7391 0, 7392 393, 7393 394, 7394 5, 7395 47, 7396 0, 7397 0, 7398 394, 7399 100, 7400 1, 7401 0, 7402 0, 7403 0, 7404 395, 7405 399, 7406 3, 7407 95, 7408 47, 7409 0, 7410 396, 7411 398, 7412 3, 7413 93, 7414 46, 7415 0, 7416 397, 7417 396, 7418 1, 7419 0, 7420 0, 7421 0, 7422 398, 7423 401, 7424 1, 7425 0, 7426 0, 7427 0, 7428 399, 7429 397, 7430 1, 7431 0, 7432 0, 7433 0, 7434 399, 7435 400, 7436 1, 7437 0, 7438 0, 7439 0, 7440 400, 7441 404, 7442 1, 7443 0, 7444 0, 7445 0, 7446 401, 7447 399, 7448 1, 7449 0, 7450 0, 7451 0, 7452 402, 7453 405, 7454 3, 7455 83, 7456 41, 7457 0, 7458 403, 7459 405, 7460 5, 7461 0, 7462 0, 7463 1, 7464 404, 7465 402, 7466 1, 7467 0, 7468 0, 7469 0, 7470 404, 7471 403, 7472 1, 7473 0, 7474 0, 7475 0, 7476 405, 7477 406, 7478 1, 7479 0, 7480 0, 7481 0, 7482 406, 7483 407, 7484 6, 7485 50, 7486 1, 7487 0, 7488 407, 7489 102, 7490 1, 7491 0, 7492 0, 7493 0, 7494 408, 7495 413, 7496 3, 7497 97, 7498 48, 7499 0, 7500 409, 7501 412, 7502 3, 7503 93, 7504 46, 7505 0, 7506 410, 7507 412, 7508 3, 7509 83, 7510 41, 7511 0, 7512 411, 7513 409, 7514 1, 7515 0, 7516 0, 7517 0, 7518 411, 7519 410, 7520 1, 7521 0, 7522 0, 7523 0, 7524 412, 7525 415, 7526 1, 7527 0, 7528 0, 7529 0, 7530 413, 7531 414, 7532 1, 7533 0, 7534 0, 7535 0, 7536 413, 7537 411, 7538 1, 7539 0, 7540 0, 7541 0, 7542 414, 7543 416, 7544 1, 7545 0, 7546 0, 7547 0, 7548 415, 7549 413, 7550 1, 7551 0, 7552 0, 7553 0, 7554 416, 7555 417, 7556 3, 7557 99, 7558 49, 7559 0, 7560 417, 7561 418, 7562 1, 7563 0, 7564 0, 7565 0, 7566 418, 7567 419, 7568 6, 7569 51, 7570 1, 7571 0, 7572 419, 7573 104, 7574 1, 7575 0, 7576 0, 7577 0, 7578 420, 7579 421, 7580 7, 7581 3, 7582 0, 7583 0, 7584 421, 7585 106, 7586 1, 7587 0, 7588 0, 7589 0, 7590 422, 7591 427, 7592 3, 7593 105, 7594 52, 7595 0, 7596 423, 7597 426, 7598 3, 7599 105, 7600 52, 7601 0, 7602 424, 7603 426, 7604 3, 7605 87, 7606 43, 7607 0, 7608 425, 7609 423, 7610 1, 7611 0, 7612 0, 7613 0, 7614 425, 7615 424, 7616 1, 7617 0, 7618 0, 7619 0, 7620 426, 7621 429, 7622 1, 7623 0, 7624 0, 7625 0, 7626 427, 7627 425, 7628 1, 7629 0, 7630 0, 7631 0, 7632 427, 7633 428, 7634 1, 7635 0, 7636 0, 7637 0, 7638 428, 7639 108, 7640 1, 7641 0, 7642 0, 7643 0, 7644 429, 7645 427, 7646 1, 7647 0, 7648 0, 7649 0, 7650 430, 7651 431, 7652 9, 7653 0, 7654 0, 7655 0, 7656 431, 7657 110, 7658 1, 7659 0, 7660 0, 7661 0, 7662 14, 7663 0, 7664 353, 7665 358, 7666 362, 7667 365, 7668 372, 7669 375, 7670 380, 7671 399, 7672 404, 7673 411, 7674 413, 7675 425, 7676 427, 7677 2, 7678 6, 7679 0, 7680 0, 7681 0, 7682 1, 7683 0 7684]; 7685var atn = new M.atn.ATNDeserializer().deserialize(serializedATN); 7686var decisionsToDFA = atn.decisionToState.map((ds, index) => new M.dfa.DFA(ds, index)); 7687var ZomicLexer = class extends M.Lexer { 7688 static grammarFileName = "ZomicLexer.g4"; 7689 static channelNames = ["DEFAULT_TOKEN_CHANNEL", "HIDDEN"]; 7690 static modeNames = ["DEFAULT_MODE"]; 7691 static literalNames = [ 7692 null, 7693 "'label'", 7694 "'scale'", 7695 "'build'", 7696 "'move'", 7697 "'rotate'", 7698 "'around'", 7699 "'reflect'", 7700 "'from'", 7701 "'symmetry'", 7702 "'through'", 7703 "'center'", 7704 "'repeat'", 7705 "'branch'", 7706 "'save'", 7707 "'location'", 7708 "'orientation'", 7709 "'all'", 7710 "'half'", 7711 "'size'", 7712 "'short'", 7713 "'medium'", 7714 "'long'", 7715 "'green'", 7716 "'orange'", 7717 "'purple'", 7718 "'black'", 7719 "'red'", 7720 "'pent'", 7721 "'pentagon'", 7722 "'blue'", 7723 "'rect'", 7724 "'rectangle'", 7725 "'yellow'", 7726 "'tri'", 7727 "'triangle'", 7728 "'{'", 7729 "'}'", 7730 "'('", 7731 "')'", 7732 "'?'" 7733 ]; 7734 static symbolicNames = [ 7735 null, 7736 "LABEL", 7737 "SCALE", 7738 "BUILD", 7739 "MOVE", 7740 "ROTATE", 7741 "AROUND", 7742 "REFLECT", 7743 "FROM", 7744 "SYMMETRY", 7745 "THROUGH", 7746 "CENTER", 7747 "REPEAT", 7748 "BRANCH", 7749 "SAVE", 7750 "LOCATION", 7751 "ORIENTATION", 7752 "ALL", 7753 "HALF", 7754 "SIZE", 7755 "SHORT", 7756 "MEDIUM", 7757 "LONG", 7758 "GREEN", 7759 "ORANGE", 7760 "PURPLE", 7761 "BLACK", 7762 "RED", 7763 "PENT", 7764 "PENTAGON", 7765 "BLUE", 7766 "RECT", 7767 "RECTANGLE", 7768 "YELLOW", 7769 "TRI", 7770 "TRIANGLE", 7771 "LBRACE", 7772 "RBRACE", 7773 "LPAREN", 7774 "RPAREN", 7775 "QUESTIONMARK", 7776 "WS", 7777 "EOL", 7778 "INT", 7779 "POLARITY", 7780 "SL_COMMENT", 7781 "ML_COMMENT", 7782 "IDENT", 7783 "UNEXPECTED_CHAR" 7784 ]; 7785 static ruleNames = [ 7786 "LABEL", 7787 "SCALE", 7788 "BUILD", 7789 "MOVE", 7790 "ROTATE", 7791 "AROUND", 7792 "REFLECT", 7793 "FROM", 7794 "SYMMETRY", 7795 "THROUGH", 7796 "CENTER", 7797 "REPEAT", 7798 "BRANCH", 7799 "SAVE", 7800 "LOCATION", 7801 "ORIENTATION", 7802 "ALL", 7803 "HALF", 7804 "SIZE", 7805 "SHORT", 7806 "MEDIUM", 7807 "LONG", 7808 "GREEN", 7809 "ORANGE", 7810 "PURPLE", 7811 "BLACK", 7812 "RED", 7813 "PENT", 7814 "PENTAGON", 7815 "BLUE", 7816 "RECT", 7817 "RECTANGLE", 7818 "YELLOW", 7819 "TRI", 7820 "TRIANGLE", 7821 "LBRACE", 7822 "RBRACE", 7823 "LPAREN", 7824 "RPAREN", 7825 "QUESTIONMARK", 7826 "WS", 7827 "EOL", 7828 "DIGIT", 7829 "NUMBER", 7830 "INT", 7831 "POLARITY", 7832 "COMMENT", 7833 "SL_COMMENT_START", 7834 "ML_COMMENT_START", 7835 "ML_COMMENT_END", 7836 "SL_COMMENT", 7837 "ML_COMMENT", 7838 "IDENT_START", 7839 "IDENT", 7840 "UNEXPECTED_CHAR" 7841 ]; 7842 constructor(input) { 7843 super(input); 7844 this._interp = new M.atn.LexerATNSimulator(this, atn, decisionsToDFA, new M.atn.PredictionContextCache()); 7845 } 7846}; 7847ZomicLexer.EOF = M.Token.EOF; 7848ZomicLexer.LABEL = 1; 7849ZomicLexer.SCALE = 2; 7850ZomicLexer.BUILD = 3; 7851ZomicLexer.MOVE = 4; 7852ZomicLexer.ROTATE = 5; 7853ZomicLexer.AROUND = 6; 7854ZomicLexer.REFLECT = 7; 7855ZomicLexer.FROM = 8; 7856ZomicLexer.SYMMETRY = 9; 7857ZomicLexer.THROUGH = 10;
7858ZomicLexer.CENTER = 11; 7859ZomicLexer.REPEAT = 12; 7860ZomicLexer.BRANCH = 13; 7861ZomicLexer.SAVE = 14; 7862ZomicLexer.LOCATION = 15; 7863ZomicLexer.ORIENTATION = 16; 7864ZomicLexer.ALL = 17; 7865ZomicLexer.HALF = 18; 7866ZomicLexer.SIZE = 19; 7867ZomicLexer.SHORT = 20; 7868ZomicLexer.MEDIUM = 21; 7869ZomicLexer.LONG = 22; 7870ZomicLexer.GREEN = 23; 7871ZomicLexer.ORANGE = 24; 7872ZomicLexer.PURPLE = 25; 7873ZomicLexer.BLACK = 26; 7874ZomicLexer.RED = 27; 7875ZomicLexer.PENT = 28; 7876ZomicLexer.PENTAGON = 29; 7877ZomicLexer.BLUE = 30; 7878ZomicLexer.RECT = 31; 7879ZomicLexer.RECTANGLE = 32; 7880ZomicLexer.YELLOW = 33; 7881ZomicLexer.TRI = 34; 7882ZomicLexer.TRIANGLE = 35; 7883ZomicLexer.LBRACE = 36; 7884ZomicLexer.RBRACE = 37; 7885ZomicLexer.LPAREN = 38; 7886ZomicLexer.RPAREN = 39; 7887ZomicLexer.QUESTIONMARK = 40; 7888ZomicLexer.WS = 41; 7889ZomicLexer.EOL = 42; 7890ZomicLexer.INT = 43; 7891ZomicLexer.POLARITY = 44; 7892ZomicLexer.SL_COMMENT = 45; 7893ZomicLexer.ML_COMMENT = 46; 7894ZomicLexer.IDENT = 47; 7895ZomicLexer.UNEXPECTED_CHAR = 48; 7896
7897// src/worker/legacy/zomic/ZomicParserListener.js 7898var ZomicParserListener = class extends M.tree.ParseTreeListener { 7899 // Enter a parse tree produced by ZomicParser#program. 7900 enterProgram(ctx) { 7901 } 7902 // Exit a parse tree produced by ZomicParser#program. 7903 exitProgram(ctx) { 7904 } 7905 // Enter a parse tree produced by ZomicParser#stmt. 7906 enterStmt(ctx) { 7907 } 7908 // Exit a parse tree produced by ZomicParser#stmt. 7909 exitStmt(ctx) { 7910 } 7911 // Enter a parse tree produced by ZomicParser#compound_stmt. 7912 enterCompound_stmt(ctx) { 7913 } 7914 // Exit a parse tree produced by ZomicParser#compound_stmt. 7915 exitCompound_stmt(ctx) { 7916 } 7917 // Enter a parse tree produced by ZomicParser#directCommand. 7918 enterDirectCommand(ctx) { 7919 } 7920 // Exit a parse tree produced by ZomicParser#directCommand. 7921 exitDirectCommand(ctx) { 7922 } 7923 // Enter a parse tree produced by ZomicParser#nestedCommand. 7924 enterNestedCommand(ctx) { 7925 } 7926 // Exit a parse tree produced by ZomicParser#nestedCommand. 7927 exitNestedCommand(ctx) { 7928 } 7929 // Enter a parse tree produced by ZomicParser#strut_stmt. 7930 enterStrut_stmt(ctx) { 7931 } 7932 // Exit a parse tree produced by ZomicParser#strut_stmt. 7933 exitStrut_stmt(ctx) { 7934 } 7935 // Enter a parse tree produced by ZomicParser#label_stmt. 7936 enterLabel_stmt(ctx) { 7937 } 7938 // Exit a parse tree produced by ZomicParser#label_stmt. 7939 exitLabel_stmt(ctx) { 7940 } 7941 // Enter a parse tree produced by ZomicParser#scale_stmt. 7942 enterScale_stmt(ctx) { 7943 } 7944 // Exit a parse tree produced by ZomicParser#scale_stmt. 7945 exitScale_stmt(ctx) { 7946 } 7947 // Enter a parse tree produced by ZomicParser#build_stmt. 7948 enterBuild_stmt(ctx) { 7949 } 7950 // Exit a parse tree produced by ZomicParser#build_stmt. 7951 exitBuild_stmt(ctx) { 7952 } 7953 // Enter a parse tree produced by ZomicParser#move_stmt. 7954 enterMove_stmt(ctx) { 7955 } 7956 // Exit a parse tree produced by ZomicParser#move_stmt. 7957 exitMove_stmt(ctx) { 7958 } 7959 // Enter a parse tree produced by ZomicParser#rotate_stmt. 7960 enterRotate_stmt(ctx) { 7961 } 7962 // Exit a parse tree produced by ZomicParser#rotate_stmt. 7963 exitRotate_stmt(ctx) { 7964 } 7965 // Enter a parse tree produced by ZomicParser#reflect_stmt. 7966 enterReflect_stmt(ctx) { 7967 } 7968 // Exit a parse tree produced by ZomicParser#reflect_stmt. 7969 exitReflect_stmt(ctx) { 7970 } 7971 // Enter a parse tree produced by ZomicParser#from_stmt. 7972 enterFrom_stmt(ctx) { 7973 } 7974 // Exit a parse tree produced by ZomicParser#from_stmt. 7975 exitFrom_stmt(ctx) { 7976 } 7977 // Enter a parse tree produced by ZomicParser#symmetry_stmt. 7978 enterSymmetry_stmt(ctx) { 7979 } 7980 // Exit a parse tree produced by ZomicParser#symmetry_stmt. 7981 exitSymmetry_stmt(ctx) { 7982 } 7983 // Enter a parse tree produced by ZomicParser#repeat_stmt. 7984 enterRepeat_stmt(ctx) { 7985 } 7986 // Exit a parse tree produced by ZomicParser#repeat_stmt. 7987 exitRepeat_stmt(ctx) { 7988 } 7989 // Enter a parse tree produced by ZomicParser#branch_stmt. 7990 enterBranch_stmt(ctx) { 7991 } 7992 // Exit a parse tree produced by ZomicParser#branch_stmt. 7993 exitBranch_stmt(ctx) { 7994 } 7995 // Enter a parse tree produced by ZomicParser#save_stmt. 7996 enterSave_stmt(ctx) { 7997 } 7998 // Exit a parse tree produced by ZomicParser#save_stmt. 7999 exitSave_stmt(ctx) { 8000 } 8001 // Enter a parse tree produced by ZomicParser#strut_length_expr. 8002 enterStrut_length_expr(ctx) { 8003 } 8004 // Exit a parse tree produced by ZomicParser#strut_length_expr. 8005 exitStrut_length_expr(ctx) { 8006 } 8007 // Enter a parse tree produced by ZomicParser#size_expr. 8008 enterSize_expr(ctx) { 8009 } 8010 // Exit a parse tree produced by ZomicParser#size_expr. 8011 exitSize_expr(ctx) { 8012 } 8013 // Enter a parse tree produced by ZomicParser#algebraic_number_expr. 8014 enterAlgebraic_number_expr(ctx) { 8015 } 8016 // Exit a parse tree produced by ZomicParser#algebraic_number_expr. 8017 exitAlgebraic_number_expr(ctx) { 8018 } 8019 // Enter a parse tree produced by ZomicParser#explicit_size_expr. 8020 enterExplicit_size_expr(ctx) { 8021 } 8022 // Exit a parse tree produced by ZomicParser#explicit_size_expr. 8023 exitExplicit_size_expr(ctx) { 8024 } 8025 // Enter a parse tree produced by ZomicParser#SizeShort. 8026 enterSizeShort(ctx) { 8027 } 8028 // Exit a parse tree produced by ZomicParser#SizeShort. 8029 exitSizeShort(ctx) { 8030 } 8031 // Enter a parse tree produced by ZomicParser#SizeLong. 8032 enterSizeLong(ctx) { 8033 } 8034 // Exit a parse tree produced by ZomicParser#SizeLong. 8035 exitSizeLong(ctx) { 8036 } 8037 // Enter a parse tree produced by ZomicParser#SizeMedium. 8038 enterSizeMedium(ctx) { 8039 } 8040 // Exit a parse tree produced by ZomicParser#SizeMedium. 8041 exitSizeMedium(ctx) { 8042 } 8043 // Enter a parse tree produced by ZomicParser#symmetry_center_expr. 8044 enterSymmetry_center_expr(ctx) { 8045 } 8046 // Exit a parse tree produced by ZomicParser#symmetry_center_expr. 8047 exitSymmetry_center_expr(ctx) { 8048 } 8049 // Enter a parse tree produced by ZomicParser#axis_expr. 8050 enterAxis_expr(ctx) { 8051 } 8052 // Exit a parse tree produced by ZomicParser#axis_expr. 8053 exitAxis_expr(ctx) { 8054 } 8055 // Enter a parse tree produced by ZomicParser#axis_index_expr. 8056 enterAxis_index_expr(ctx) { 8057 } 8058 // Exit a parse tree produced by ZomicParser#axis_index_expr. 8059 exitAxis_index_expr(ctx) { 8060 } 8061 // Enter a parse tree produced by ZomicParser#axis_name_expr. 8062 enterAxis_name_expr(ctx) { 8063 } 8064 // Exit a parse tree produced by ZomicParser#axis_name_expr. 8065 exitAxis_name_expr(ctx) { 8066 } 8067 // Enter a parse tree produced by ZomicParser#Red. 8068 enterRed(ctx) { 8069 } 8070 // Exit a parse tree produced by ZomicParser#Red. 8071 exitRed(ctx) { 8072 } 8073 // Enter a parse tree produced by ZomicParser#Blue. 8074 enterBlue(ctx) { 8075 } 8076 // Exit a parse tree produced by ZomicParser#Blue. 8077 exitBlue(ctx) { 8078 } 8079 // Enter a parse tree produced by ZomicParser#Yellow. 8080 enterYellow(ctx) { 8081 } 8082 // Exit a parse tree produced by ZomicParser#Yellow. 8083 exitYellow(ctx) { 8084 } 8085 // Enter a parse tree produced by ZomicParser#green. 8086 enterGreen(ctx) { 8087 } 8088 // Exit a parse tree produced by ZomicParser#green. 8089 exitGreen(ctx) { 8090 } 8091 // Enter a parse tree produced by ZomicParser#orange. 8092 enterOrange(ctx) { 8093 } 8094 // Exit a parse tree produced by ZomicParser#orange. 8095 exitOrange(ctx) { 8096 } 8097 // Enter a parse tree produced by ZomicParser#purple. 8098 enterPurple(ctx) { 8099 } 8100 // Exit a parse tree produced by ZomicParser#purple. 8101 exitPurple(ctx) { 8102 } 8103 // Enter a parse tree produced by ZomicParser#black. 8104 enterBlack(ctx) { 8105 } 8106 // Exit a parse tree produced by ZomicParser#black. 8107 exitBlack(ctx) { 8108 } 8109}; 8110
8111// src/worker/legacy/zomic/ZomicParser.js 8112var serializedATN2 = [ 8113 4, 8114 1, 8115 48, 8116 229, 8117 2, 8118 0, 8119 7, 8120 0, 8121 2, 8122 1, 8123 7, 8124 1, 8125 2, 8126 2, 8127 7, 8128 2, 8129 2, 8130 3, 8131 7, 8132 3, 8133 2, 8134 4, 8135 7, 8136 4, 8137 2, 8138 5, 8139 7, 8140 5, 8141 2, 8142 6, 8143 7, 8144 6, 8145 2, 8146 7, 8147 7, 8148 7, 8149 2, 8150 8, 8151 7, 8152 8, 8153 2, 8154 9, 8155 7, 8156 9, 8157 2, 8158 10, 8159 7, 8160 10, 8161 2, 8162 11, 8163 7, 8164 11, 8165 2, 8166 12, 8167 7, 8168 12, 8169 2, 8170 13, 8171 7, 8172 13, 8173 2, 8174 14, 8175 7, 8176 14, 8177 2, 8178 15, 8179 7, 8180 15, 8181 2, 8182 16, 8183 7, 8184 16, 8185 2, 8186 17, 8187 7, 8188 17, 8189 2, 8190 18, 8191 7, 8192 18, 8193 2, 8194 19, 8195 7, 8196 19, 8197 2, 8198 20, 8199 7, 8200 20, 8201 2, 8202 21, 8203 7, 8204 21, 8205 2, 8206 22, 8207 7, 8208 22, 8209 2, 8210 23, 8211 7, 8212 23, 8213 2, 8214 24, 8215 7, 8216 24, 8217 2, 8218 25, 8219 7, 8220 25, 8221 2, 8222 26, 8223 7, 8224 26, 8225 2, 8226 27, 8227 7, 8228 27, 8229 2, 8230 28, 8231 7, 8232 28, 8233 2, 8234 29, 8235 7, 8236 29, 8237 2, 8238 30, 8239 7, 8240 30, 8241 2, 8242 31, 8243 7, 8244 31, 8245 2, 8246 32, 8247 7, 8248 32, 8249 1, 8250 0, 8251 5, 8252 0, 8253 68, 8254 8, 8255 0, 8256 10, 8257 0, 8258 12, 8259 0, 8260 71, 8261 9, 8262 0, 8263 1, 8264 0, 8265 1, 8266 0, 8267 1, 8268 1, 8269 1, 8270 1, 8271 1, 8272 1, 8273 3, 8274 1, 8275 78, 8276 8, 8277 1, 8278 1, 8279 2, 8280 1, 8281 2, 8282 5, 8283 2, 8284 82, 8285 8, 8286 2, 8287 10, 8288 2, 8289 12, 8290 2, 8291 85, 8292 9, 8293 2, 8294 1, 8295 2, 8296 1, 8297 2, 8298 1, 8299 3, 8300 1, 8301 3, 8302 1, 8303 3, 8304 1, 8305 3, 8306 1, 8307 3, 8308 1, 8309 3, 8310 1, 8311 3, 8312 3, 8313 3, 8314 96, 8315 8, 8316 3, 8317 1, 8318 4, 8319 1, 8320 4, 8321 1, 8322 4, 8323 1, 8324 4, 8325 1, 8326 4, 8327 3, 8328 4, 8329 103, 8330 8, 8331 4, 8332 1, 8333 5, 8334 1, 8335 5, 8336 1, 8337 5, 8338 1, 8339 6, 8340 1, 8341 6, 8342 1, 8343 6, 8344 1, 8345 7, 8346 1, 8347 7, 8348 1, 8349 7, 8350 1, 8351 7, 8352 3, 8353 7, 8354 115, 8355 8, 8356 7, 8357 1, 8358 7, 8359 3, 8360 7, 8361 118, 8362 8, 8363 7, 8364 1, 8365 8, 8366 1, 8367 8, 8368 1, 8369 9, 8370 1, 8371 9, 8372 1, 8373 10, 8374 1, 8375 10, 8376 3, 8377 10, 8378 126, 8379 8, 8380 10, 8381 1, 8382 10, 8383 1, 8384 10, 8385 1, 8386 10, 8387 1, 8388 11, 8389 1, 8390 11, 8391 1, 8392 11, 8393 1, 8394 12, 8395 1, 8396 12, 8397 1, 8398 12, 8399 1, 8400 13, 8401 1, 8402 13, 8403 1, 8404 13, 8405 1, 8406 13, 8407 3, 8408 13, 8409 141, 8410 8, 8411 13, 8412 1, 8413 13, 8414 1, 8415 13, 8416 1, 8417 14, 8418 1, 8419 14, 8420 1, 8421 14, 8422 1, 8423 14, 8424 1, 8425 15, 8426 1, 8427 15, 8428 1, 8429 15, 8430 1, 8431 16, 8432 1, 8433 16, 8434 1, 8435 16, 8436 1, 8437 16, 8438 1, 8439 17, 8440 1, 8441 17, 8442 3, 8443 17, 8444 158, 8445 8, 8446 17, 8447 1, 8448 17, 8449 3, 8450 17, 8451 161, 8452 8, 8453 17, 8454 1, 8455 18, 8456 1, 8457 18, 8458 3, 8459 18, 8460 165, 8461 8, 8462 18, 8463 1, 8464 19, 8465 1, 8466 19, 8467 3, 8468 19, 8469 169, 8470 8, 8471 19, 8472 1, 8473 20, 8474 1, 8475 20, 8476 1, 8477 20, 8478 3, 8479 20, 8480 174, 8481 8, 8482 20, 8483 1, 8484 21, 8485 1, 8486 21, 8487 1, 8488 21, 8489 1, 8490 21, 8491 3, 8492 21, 8493 180, 8494 8, 8495 21, 8496 1, 8497 22, 8498 1, 8499 22, 8500 1, 8501 22, 8502 3, 8503 22, 8504 185, 8505 8, 8506 22, 8507 1, 8508 22, 8509 3, 8510 22, 8511 188, 8512 8, 8513 22, 8514 1, 8515 23, 8516 1, 8517 23, 8518 1, 8519 23, 8520 1, 8521 24, 8522 1, 8523 24, 8524 3, 8525 24, 8526 195, 8527 8, 8528 24, 8529 1, 8530 25, 8531 1, 8532 25, 8533 1, 8534 25, 8535 1, 8536 25, 8537 1, 8538 25, 8539 1, 8540 25, 8541 1, 8542 25, 8543 3, 8544 25, 8545 204, 8546 8, 8547 25, 8548 1, 8549 26, 8550 1, 8551 26, 8552 1, 8553 26, 8554 3, 8555 26, 8556 209, 8557 8, 8558 26, 8559 1, 8560 27, 8561 1, 8562 27, 8563 1, 8564 27, 8565 3, 8566 27, 8567 214, 8568 8, 8569 27, 8570 1, 8571 28, 8572 1, 8573 28, 8574 1, 8575 28, 8576 3, 8577 28, 8578 219, 8579 8, 8580 28, 8581 1, 8582 29, 8583 1, 8584 29, 8585 1, 8586 30, 8587 1, 8588 30, 8589 1, 8590 31, 8591 1, 8592 31, 8593 1, 8594 32, 8595 1, 8596 32, 8597 1, 8598 32, 8599 0, 8600 0, 8601 33, 8602 0, 8603 2, 8604 4, 8605 6, 8606 8, 8607 10, 8608 12, 8609 14, 8610 16, 8611 18, 8612 20, 8613 22, 8614 24, 8615 26, 8616 28, 8617 30, 8618 32, 8619 34, 8620 36, 8621 38, 8622 40, 8623 42, 8624 44, 8625 46, 8626 48, 8627 50, 8628 52, 8629 54, 8630 56, 8631 58, 8632 60, 8633 62, 8634 64, 8635 0, 8636 1, 8637 2, 8638 0, 8639 2, 8640 3, 8641 15, 8642 17, 8643 237, 8644 0, 8645 69, 8646 1, 8647 0, 8648 0, 8649 0, 8650 2, 8651 77, 8652 1, 8653 0, 8654 0, 8655 0, 8656 4, 8657 79, 8658 1, 8659 0, 8660 0, 8661 0, 8662 6, 8663 95, 8664 1, 8665 0, 8666 0, 8667 0, 8668 8, 8669 102, 8670 1, 8671 0, 8672 0, 8673 0, 8674 10, 8675 104, 8676 1, 8677 0, 8678 0, 8679 0, 8680 12, 8681 107, 8682 1, 8683 0, 8684 0, 8685 0, 8686 14, 8687 110, 8688 1, 8689 0, 8690 0, 8691 0, 8692 16, 8693 119, 8694 1, 8695 0, 8696 0, 8697 0, 8698 18, 8699 121, 8700 1, 8701 0, 8702 0, 8703 0, 8704 20, 8705 123, 8706 1, 8707 0, 8708 0, 8709 0, 8710 22, 8711 130, 8712 1, 8713 0, 8714 0, 8715 0, 8716 24, 8717 133, 8718 1, 8719 0, 8720 0, 8721 0, 8722 26, 8723 136, 8724 1, 8725 0, 8726 0, 8727 0, 8728 28, 8729 144, 8730 1, 8731 0, 8732 0, 8733 0, 8734 30, 8735 148, 8736 1, 8737 0, 8738 0, 8739 0, 8740 32, 8741 151, 8742 1, 8743 0, 8744 0, 8745 0, 8746 34, 8747 155, 8748 1, 8749 0, 8750 0, 8751 0, 8752 36, 8753 164, 8754 1, 8755 0, 8756 0, 8757 0, 8758 38, 8759 166, 8760 1, 8761 0, 8762 0, 8763 0, 8764 40, 8765 170, 8766 1, 8767 0, 8768 0, 8769 0, 8770 42, 8771 179, 8772 1, 8773 0, 8774 0, 8775 0, 8776 44, 8777 181, 8778 1, 8779 0, 8780 0, 8781 0, 8782 46, 8783 189, 8784 1, 8785 0, 8786 0, 8787 0, 8788 48, 8789 192, 8790 1, 8791 0, 8792 0, 8793 0, 8794 50, 8795 203, 8796 1, 8797 0, 8798 0, 8799 0, 8800 52, 8801 208, 8802 1, 8803 0, 8804 0, 8805 0, 8806 54, 8807 213, 8808 1, 8809 0, 8810 0, 8811 0, 8812 56, 8813 218, 8814 1, 8815 0, 8816 0, 8817 0, 8818 58, 8819 220, 8820 1, 8821 0, 8822 0, 8823 0, 8824 60, 8825 222, 8826 1, 8827 0, 8828 0, 8829 0, 8830 62, 8831 224, 8832 1, 8833 0, 8834 0, 8835 0, 8836 64, 8837 226, 8838 1, 8839 0, 8840 0, 8841 0, 8842 66, 8843 68, 8844 3, 8845 2, 8846 1, 8847 0, 8848 67, 8849 66, 8850 1, 8851 0, 8852 0, 8853 0, 8854 68, 8855 71,
8856 1, 8857 0, 8858 0, 8859 0, 8860 69, 8861 67, 8862 1, 8863 0, 8864 0, 8865 0, 8866 69, 8867 70, 8868 1, 8869 0, 8870 0, 8871 0, 8872 70, 8873 72, 8874 1, 8875 0, 8876 0, 8877 0, 8878 71, 8879 69, 8880 1, 8881 0, 8882 0, 8883 0, 8884 72, 8885 73, 8886 5, 8887 0, 8888 0, 8889 1, 8890 73, 8891 1, 8892 1, 8893 0, 8894 0, 8895 0, 8896 74, 8897 78, 8898 3, 8899 6, 8900 3, 8901 0, 8902 75, 8903 78, 8904 3, 8905 8, 8906 4, 8907 0, 8908 76, 8909 78, 8910 3, 8911 4, 8912 2, 8913 0, 8914 77, 8915 74, 8916 1, 8917 0, 8918 0, 8919 0, 8920 77, 8921 75, 8922 1, 8923 0, 8924 0, 8925 0, 8926 77, 8927 76, 8928 1, 8929 0, 8930 0, 8931 0, 8932 78, 8933 3, 8934 1, 8935 0, 8936 0, 8937 0, 8938 79, 8939 83, 8940 5, 8941 36, 8942 0, 8943 0, 8944 80, 8945 82, 8946 3, 8947 2, 8948 1, 8949 0, 8950 81, 8951 80, 8952 1, 8953 0, 8954 0, 8955 0, 8956 82, 8957 85, 8958 1, 8959 0, 8960 0, 8961 0, 8962 83, 8963 81, 8964 1, 8965 0, 8966 0, 8967 0, 8968 83, 8969 84, 8970 1, 8971 0, 8972 0, 8973 0, 8974 84, 8975 86, 8976 1, 8977 0, 8978 0, 8979 0, 8980 85, 8981 83, 8982 1, 8983 0, 8984 0, 8985 0, 8986 86, 8987 87, 8988 5, 8989 37, 8990 0, 8991 0, 8992 87, 8993 5, 8994 1, 8995 0, 8996 0, 8997 0, 8998 88, 8999 96, 9000 3, 9001 10, 9002 5, 9003 0, 9004 89, 9005 96, 9006 3, 9007 20, 9008 10, 9009 0, 9010 90, 9011 96, 9012 3, 9013 22, 9014 11, 9015 0, 9016 91, 9017 96, 9018 3, 9019 14, 9020 7, 9021 0, 9022 92, 9023 96, 9024 3, 9025 16, 9026 8, 9027 0, 9028 93, 9029 96, 9030 3, 9031 18, 9032 9, 9033 0, 9034 94, 9035 96, 9036 3, 9037 12, 9038 6, 9039 0, 9040 95, 9041 88, 9042 1, 9043 0, 9044 0, 9045 0, 9046 95, 9047 89, 9048 1, 9049 0, 9050 0, 9051 0, 9052 95, 9053 90, 9054 1, 9055 0, 9056 0, 9057 0, 9058 95, 9059 91, 9060 1, 9061 0, 9062 0, 9063 0, 9064 95, 9065 92, 9066 1, 9067 0, 9068 0, 9069 0, 9070 95, 9071 93, 9072 1, 9073 0, 9074 0, 9075 0, 9076 95, 9077 94, 9078 1, 9079 0, 9080 0, 9081 0, 9082 96, 9083 7, 9084 1, 9085 0, 9086 0, 9087 0, 9088 97, 9089 103, 9090 3, 9091 24, 9092 12, 9093 0, 9094 98, 9095 103, 9096 3, 9097 30, 9098 15, 9099 0, 9100 99, 9101 103, 9102 3, 9103 28, 9104 14, 9105 0, 9106 100, 9107 103, 9108 3, 9109 26, 9110 13, 9111 0, 9112 101, 9113 103, 9114 3, 9115 32, 9116 16, 9117 0, 9118 102, 9119 97, 9120 1, 9121 0, 9122 0, 9123 0, 9124 102, 9125 98, 9126 1, 9127 0, 9128 0, 9129 0, 9130 102, 9131 99, 9132 1, 9133 0, 9134 0, 9135 0, 9136 102, 9137 100, 9138 1, 9139 0, 9140 0, 9141 0, 9142 102, 9143 101, 9144 1, 9145 0, 9146 0, 9147 0, 9148 103, 9149 9, 9150 1, 9151 0, 9152 0, 9153 0, 9154 104, 9155 105, 9156 3, 9157 34, 9158 17, 9159 0, 9160 105, 9161 106, 9162 3, 9163 46, 9164 23, 9165 0, 9166 106, 9167 11, 9168 1, 9169 0, 9170 0, 9171 0, 9172 107, 9173 108, 9174 5, 9175 1, 9176 0, 9177 0, 9178 108, 9179 109, 9180 5, 9181 47, 9182 0, 9183 0, 9184 109, 9185 13, 9186 1, 9187 0, 9188 0, 9189 0, 9190 110, 9191 111, 9192 5, 9193 2, 9194 0, 9195 0, 9196 111, 9197 117, 9198 5, 9199 43, 9200 0, 9201 0, 9202 112, 9203 114, 9204 5, 9205 38, 9206 0, 9207 0, 9208 113, 9209 115, 9210 3, 9211 38, 9212 19, 9213 0, 9214 114, 9215 113, 9216 1, 9217 0, 9218 0, 9219 0, 9220 114, 9221 115, 9222 1, 9223 0, 9224 0, 9225 0, 9226 115, 9227 116, 9228 1, 9229 0, 9230 0, 9231 0, 9232 116, 9233 118, 9234 5, 9235 39, 9236 0, 9237 0, 9238 117, 9239 112, 9240 1, 9241 0, 9242 0, 9243 0, 9244 117, 9245 118, 9246 1, 9247 0, 9248 0, 9249 0, 9250 118, 9251 15, 9252 1, 9253 0, 9254 0, 9255 0, 9256 119, 9257 120, 9258 5, 9259 3, 9260 0, 9261 0, 9262 120, 9263 17, 9264 1, 9265 0, 9266 0, 9267 0, 9268 121, 9269 122, 9270 5, 9271 4, 9272 0, 9273 0, 9274 122, 9275 19, 9276 1, 9277 0, 9278 0, 9279 0, 9280 123, 9281 125, 9282 5, 9283 5, 9284 0, 9285 0, 9286 124, 9287 126, 9288 5, 9289 43, 9290 0, 9291 0, 9292 125, 9293 124, 9294 1, 9295 0, 9296 0, 9297 0, 9298 125, 9299 126, 9300 1, 9301 0, 9302 0, 9303 0, 9304 126, 9305 127, 9306 1, 9307 0, 9308 0, 9309 0, 9310 127, 9311 128, 9312 5, 9313 6, 9314 0, 9315 0, 9316 128, 9317 129, 9318 3, 9319 46, 9320 23, 9321 0, 9322 129, 9323 21, 9324 1, 9325 0, 9326 0, 9327 0, 9328 130, 9329 131, 9330 5, 9331 7, 9332 0, 9333 0, 9334 131, 9335 132, 9336 3, 9337 44, 9338 22, 9339 0, 9340 132, 9341 23, 9342 1, 9343 0, 9344 0, 9345 0, 9346 133, 9347 134, 9348 5, 9349 8, 9350 0, 9351 0, 9352 134, 9353 135, 9354 3, 9355 2, 9356 1, 9357 0, 9358 135, 9359 25, 9360 1, 9361 0, 9362 0, 9363 0, 9364 136, 9365 140, 9366 5, 9367 9, 9368 0, 9369 0, 9370 137, 9371 138, 9372 5, 9373 6, 9374 0, 9375 0, 9376 138, 9377 141, 9378 3, 9379 46, 9380 23, 9381 0, 9382 139, 9383 141, 9384 3, 9385 44, 9386 22, 9387 0, 9388 140, 9389 137, 9390 1, 9391 0, 9392 0, 9393 0, 9394 140, 9395 139, 9396 1, 9397 0, 9398 0, 9399 0, 9400 140, 9401 141, 9402 1, 9403 0, 9404 0, 9405 0, 9406 141, 9407 142, 9408 1, 9409 0, 9410 0, 9411 0, 9412 142, 9413 143, 9414 3, 9415 2, 9416 1, 9417 0, 9418 143, 9419 27, 9420 1, 9421 0, 9422 0, 9423 0, 9424 144, 9425 145, 9426 5, 9427 12, 9428 0, 9429 0, 9430 145, 9431 146, 9432 5, 9433 43, 9434 0, 9435 0, 9436 146, 9437 147, 9438 3, 9439 2, 9440 1, 9441 0, 9442 147, 9443 29, 9444 1, 9445 0, 9446 0, 9447 0, 9448 148, 9449 149, 9450 5, 9451 13, 9452 0, 9453 0, 9454 149, 9455 150, 9456 3, 9457 2, 9458 1, 9459 0, 9460 150, 9461 31, 9462 1, 9463 0, 9464 0, 9465 0, 9466 151, 9467 152, 9468 5, 9469 14, 9470 0, 9471 0, 9472 152, 9473 153, 9474 7, 9475 0, 9476 0, 9477 0, 9478 153, 9479 154, 9480 3, 9481 2, 9482 1, 9483 0, 9484 154, 9485 33, 9486 1, 9487 0, 9488 0, 9489 0, 9490 155, 9491 157, 9492 3, 9493 36, 9494 18, 9495 0, 9496 156, 9497 158, 9498 3, 9499 38, 9500 19, 9501 0, 9502 157, 9503 156, 9504 1, 9505 0, 9506 0, 9507 0, 9508 157, 9509 158, 9510 1, 9511 0, 9512 0, 9513 0, 9514 158, 9515 160, 9516 1, 9517 0, 9518 0, 9519 0, 9520 159, 9521 161, 9522 5, 9523 18, 9524 0, 9525 0, 9526 160, 9527 159, 9528 1, 9529 0, 9530 0, 9531 0, 9532 160, 9533 161, 9534 1, 9535 0, 9536 0, 9537 0, 9538 161, 9539 35, 9540 1, 9541 0, 9542 0, 9543 0, 9544 162, 9545 165, 9546 3, 9547 40, 9548 20, 9549 0, 9550 163, 9551 165, 9552 3, 9553 42, 9554 21, 9555 0, 9556 164, 9557 162, 9558 1, 9559 0, 9560 0, 9561 0, 9562 164, 9563 163, 9564 1, 9565 0, 9566 0, 9567 0, 9568 165, 9569 37, 9570 1, 9571 0, 9572 0, 9573 0, 9574 166, 9575 168, 9576 5, 9577 43, 9578 0, 9579 0, 9580 167, 9581 169, 9582 5, 9583 43, 9584 0, 9585 0, 9586 168, 9587 167, 9588 1, 9589 0, 9590 0, 9591 0, 9592 168, 9593 169, 9594 1, 9595 0, 9596 0, 9597 0, 9598 169, 9599 39, 9600 1, 9601 0, 9602 0, 9603 0, 9604 170, 9605 173, 9606 5, 9607 19, 9608 0, 9609 0, 9610 171, 9611 174, 9612 5, 9613 43, 9614 0, 9615 0, 9616 172, 9617 174, 9618 5, 9619 40, 9620 0, 9621 0, 9622 173, 9623 171, 9624 1, 9625 0, 9626 0, 9627 0, 9628 173, 9629 172, 9630 1, 9631 0, 9632 0, 9633 0, 9634 174, 9635 41, 9636 1, 9637 0, 9638 0, 9639 0, 9640 175,
9641 180, 9642 5, 9643 20, 9644 0, 9645 0, 9646 176, 9647 180, 9648 5, 9649 22, 9650 0, 9651 0, 9652 177, 9653 180, 9654 5, 9655 21, 9656 0, 9657 0, 9658 178, 9659 180, 9660 1, 9661 0, 9662 0, 9663 0, 9664 179, 9665 175, 9666 1, 9667 0, 9668 0, 9669 0, 9670 179, 9671 176, 9672 1, 9673 0, 9674 0, 9675 0, 9676 179, 9677 177, 9678 1, 9679 0, 9680 0, 9681 0, 9682 179, 9683 178, 9684 1, 9685 0, 9686 0, 9687 0, 9688 180, 9689 43, 9690 1, 9691 0, 9692 0, 9693 0, 9694 181, 9695 187, 9696 5, 9697 10, 9698 0, 9699 0, 9700 182, 9701 188, 9702 5, 9703 11, 9704 0, 9705 0, 9706 183, 9707 185, 9708 3, 9709 54, 9710 27, 9711 0, 9712 184, 9713 183, 9714 1, 9715 0, 9716 0, 9717 0, 9718 184, 9719 185, 9720 1, 9721 0, 9722 0, 9723 0, 9724 185, 9725 186, 9726 1, 9727 0, 9728 0, 9729 0, 9730 186, 9731 188, 9732 5, 9733 43, 9734 0, 9735 0, 9736 187, 9737 182, 9738 1, 9739 0, 9740 0, 9741 0, 9742 187, 9743 184, 9744 1, 9745 0, 9746 0, 9747 0, 9748 188, 9749 45, 9750 1, 9751 0, 9752 0, 9753 0, 9754 189, 9755 190, 9756 3, 9757 50, 9758 25, 9759 0, 9760 190, 9761 191, 9762 3, 9763 48, 9764 24, 9765 0, 9766 191, 9767 47, 9768 1, 9769 0, 9770 0, 9771 0, 9772 192, 9773 194, 9774 5, 9775 43, 9776 0, 9777 0, 9778 193, 9779 195, 9780 5, 9781 44, 9782 0, 9783 0, 9784 194, 9785 193, 9786 1, 9787 0, 9788 0, 9789 0, 9790 194, 9791 195, 9792 1, 9793 0, 9794 0, 9795 0, 9796 195, 9797 49, 9798 1, 9799 0, 9800 0, 9801 0, 9802 196, 9803 204, 9804 3, 9805 52, 9806 26, 9807 0, 9808 197, 9809 204, 9810 3, 9811 54, 9812 27, 9813 0, 9814 198, 9815 204, 9816 3, 9817 56, 9818 28, 9819 0, 9820 199, 9821 204, 9822 3, 9823 58, 9824 29, 9825 0, 9826 200, 9827 204, 9828 3, 9829 60, 9830 30, 9831 0, 9832 201, 9833 204, 9834 3, 9835 62, 9836 31, 9837 0, 9838 202, 9839 204, 9840 3, 9841 64, 9842 32, 9843 0, 9844 203, 9845 196, 9846 1, 9847 0, 9848 0, 9849 0, 9850 203, 9851 197, 9852 1, 9853 0, 9854 0, 9855 0, 9856 203, 9857 198, 9858 1, 9859 0, 9860 0, 9861 0, 9862 203, 9863 199, 9864 1, 9865 0, 9866 0, 9867 0, 9868 203, 9869 200, 9870 1, 9871 0, 9872 0, 9873 0, 9874 203, 9875 201, 9876 1, 9877 0, 9878 0, 9879 0, 9880 203, 9881 202, 9882 1, 9883 0, 9884 0, 9885 0, 9886 204, 9887 51, 9888 1, 9889 0, 9890 0, 9891 0, 9892 205, 9893 209, 9894 5, 9895 27, 9896 0, 9897 0, 9898 206, 9899 209, 9900 5, 9901 28, 9902 0, 9903 0, 9904 207, 9905 209, 9906 5, 9907 29, 9908 0, 9909 0, 9910 208, 9911 205,
9912 1, 9913 0, 9914 0, 9915 0, 9916 208, 9917 206, 9918 1, 9919 0, 9920 0, 9921 0, 9922 208, 9923 207, 9924 1, 9925 0, 9926 0, 9927 0, 9928 209, 9929 53, 9930 1, 9931 0, 9932 0, 9933 0, 9934 210, 9935 214, 9936 5, 9937 30, 9938 0, 9939 0, 9940 211, 9941 214, 9942 5, 9943 31, 9944 0, 9945 0, 9946 212, 9947 214, 9948 5, 9949 32, 9950 0, 9951 0, 9952 213, 9953 210, 9954 1, 9955 0, 9956 0, 9957 0, 9958 213, 9959 211, 9960 1, 9961 0, 9962 0, 9963 0, 9964 213, 9965 212, 9966 1, 9967 0, 9968 0, 9969 0, 9970 214, 9971 55, 9972 1, 9973 0, 9974 0, 9975 0, 9976 215, 9977 219, 9978 5, 9979 33, 9980 0, 9981 0, 9982 216, 9983 219, 9984 5, 9985 34, 9986 0, 9987 0, 9988 217, 9989 219, 9990 5, 9991 35, 9992 0, 9993 0, 9994 218, 9995 215, 9996 1, 9997 0, 9998 0, 9999 0, 10000 218, 10001 216, 10002 1, 10003 0, 10004 0, 10005 0, 10006 218, 10007 217, 10008 1, 10009 0, 10010 0, 10011 0, 10012 219, 10013 57, 10014 1, 10015 0, 10016 0, 10017 0, 10018 220, 10019 221, 10020 5, 10021 23, 10022 0, 10023 0, 10024 221, 10025 59, 10026 1, 10027 0, 10028 0, 10029 0, 10030 222, 10031 223, 10032 5, 10033 24, 10034 0, 10035 0, 10036 223, 10037 61, 10038 1, 10039 0, 10040 0, 10041 0, 10042 224, 10043 225, 10044 5, 10045 25, 10046 0, 10047 0, 10048 225, 10049 63, 10050 1, 10051 0, 10052 0, 10053 0, 10054 226, 10055 227, 10056 5, 10057 26, 10058 0, 10059 0, 10060 227, 10061 65, 10062 1, 10063 0, 10064 0, 10065 0, 10066 22, 10067 69, 10068 77, 10069 83, 10070 95, 10071 102, 10072 114, 10073 117, 10074 125, 10075 140, 10076 157, 10077 160, 10078 164, 10079 168, 10080 173, 10081 179, 10082 184, 10083 187, 10084 194, 10085 203, 10086 208, 10087 213, 10088 218 10089]; 10090var atn2 = new M.atn.ATNDeserializer().deserialize(serializedATN2); 10091var decisionsToDFA2 = atn2.decisionToState.map((ds, index) => new M.dfa.DFA(ds, index)); 10092var sharedContextCache = new M.atn.PredictionContextCache(); 10093var ZomicParser = class _ZomicParser extends M.Parser { 10094 static grammarFileName = "ZomicParser.g4"; 10095 static literalNames = [ 10096 null, 10097 "'label'", 10098 "'scale'", 10099 "'build'", 10100 "'move'", 10101 "'rotate'", 10102 "'around'", 10103 "'reflect'", 10104 "'from'", 10105 "'symmetry'", 10106 "'through'", 10107 "'center'", 10108 "'repeat'", 10109 "'branch'", 10110 "'save'", 10111 "'location'", 10112 "'orientation'", 10113 "'all'", 10114 "'half'", 10115 "'size'", 10116 "'short'", 10117 "'medium'", 10118 "'long'", 10119 "'green'", 10120 "'orange'", 10121 "'purple'", 10122 "'black'", 10123 "'red'", 10124 "'pent'", 10125 "'pentagon'", 10126 "'blue'", 10127 "'rect'", 10128 "'rectangle'", 10129 "'yellow'", 10130 "'tri'", 10131 "'triangle'", 10132 "'{'", 10133 "'}'", 10134 "'('", 10135 "')'", 10136 "'?'" 10137 ]; 10138 static symbolicNames = [ 10139 null, 10140 "LABEL", 10141 "SCALE", 10142 "BUILD", 10143 "MOVE", 10144 "ROTATE", 10145 "AROUND", 10146 "REFLECT", 10147 "FROM", 10148 "SYMMETRY", 10149 "THROUGH", 10150 "CENTER", 10151 "REPEAT", 10152 "BRANCH", 10153 "SAVE", 10154 "LOCATION", 10155 "ORIENTATION", 10156 "ALL", 10157 "HALF", 10158 "SIZE", 10159 "SHORT", 10160 "MEDIUM", 10161 "LONG", 10162 "GREEN", 10163 "ORANGE", 10164 "PURPLE", 10165 "BLACK", 10166 "RED", 10167 "PENT", 10168 "PENTAGON", 10169 "BLUE", 10170 "RECT", 10171 "RECTANGLE", 10172 "YELLOW", 10173 "TRI", 10174 "TRIANGLE", 10175 "LBRACE", 10176 "RBRACE", 10177 "LPAREN", 10178 "RPAREN", 10179 "QUESTIONMARK", 10180 "WS", 10181 "EOL", 10182 "INT", 10183 "POLARITY", 10184 "SL_COMMENT", 10185 "ML_COMMENT", 10186 "IDENT", 10187 "UNEXPECTED_CHAR" 10188 ]; 10189 static ruleNames = [ 10190 "program", 10191 "stmt", 10192 "compound_stmt", 10193 "directCommand", 10194 "nestedCommand", 10195 "strut_stmt", 10196 "label_stmt", 10197 "scale_stmt", 10198 "build_stmt", 10199 "move_stmt", 10200 "rotate_stmt", 10201 "reflect_stmt", 10202 "from_stmt", 10203 "symmetry_stmt", 10204 "repeat_stmt", 10205 "branch_stmt", 10206 "save_stmt", 10207 "strut_length_expr", 10208 "size_expr", 10209 "algebraic_number_expr", 10210 "explicit_size_expr", 10211 "named_size_expr", 10212 "symmetry_center_expr", 10213 "axis_expr", 10214 "axis_index_expr", 10215 "axis_name_expr", 10216 "red_alias_expr", 10217 "blue_alias_expr", 10218 "yellow_alias_expr", 10219 "green", 10220 "orange", 10221 "purple", 10222 "black" 10223 ]; 10224 constructor(input) { 10225 super(input); 10226 this._interp = new M.atn.ParserATNSimulator(this, atn2, decisionsToDFA2, sharedContextCache); 10227 this.ruleNames = _ZomicParser.ruleNames; 10228 this.literalNames = _ZomicParser.literalNames; 10229 this.symbolicNames = _ZomicParser.symbolicNames; 10230 } 10231 program() { 10232 let localctx = new ProgramContext(this, this._ctx, this.state); 10233 this.enterRule(localctx, 0, _ZomicParser.RULE_program); 10234 var _la = 0; 10235 try { 10236 this.enterOuterAlt(localctx, 1); 10237 this.state = 69; 10238 this._errHandler.sync(this); 10239 _la = this._input.LA(1); 10240 while ((_la & ~31) === 0 && (1 << _la & 4294734782) !== 0 || (_la - 32 & ~31) === 0 && (1 << _la - 32 & 2079) !== 0) { 10241 this.state = 66; 10242 this.stmt(); 10243 this.state = 71; 10244 this._errHandler.sync(this); 10245 _la = this._input.LA(1); 10246 } 10247 this.state = 72; 10248 this.match(_ZomicParser.EOF); 10249 } catch (re) { 10250 if (re instanceof M.error.RecognitionException) { 10251 localctx.exception = re; 10252 this._errHandler.reportError(this, re); 10253 this._errHandler.recover(this, re); 10254 } else { 10255 throw re; 10256 } 10257 } finally { 10258 this.exitRule(); 10259 } 10260 return localctx; 10261 } 10262 stmt() { 10263 let localctx = new StmtContext(this, this._ctx, this.state); 10264 this.enterRule(localctx, 2, _ZomicParser.RULE_stmt); 10265 try { 10266 this.state = 77; 10267 this._errHandler.sync(this); 10268 switch (this._input.LA(1)) { 10269 case 1: 10270 case 2: 10271 case 3: 10272 case 4: 10273 case 5: 10274 case 7: 10275 case 18: 10276 case 19: 10277 case 20: 10278 case 21: 10279 case 22: 10280 case 23: 10281 case 24: 10282 case 25: 10283 case 26: 10284 case 27: 10285 case 28: 10286 case 29: 10287 case 30: 10288 case 31: 10289 case 32: 10290 case 33: 10291 case 34: 10292 case 35: 10293 case 43: 10294 this.enterOuterAlt(localctx, 1); 10295 this.state = 74; 10296 this.directCommand(); 10297 break; 10298 case 8: 10299 case 9: 10300 case 12: 10301 case 13: 10302 case 14: 10303 this.enterOuterAlt(localctx, 2); 10304 this.state = 75; 10305 this.nestedCommand(); 10306 break; 10307 case 36: 10308 this.enterOuterAlt(localctx, 3); 10309 this.state = 76; 10310 this.compound_stmt(); 10311 break; 10312 default: 10313 throw new M.error.NoViableAltException(this); 10314 } 10315 } catch (re) { 10316 if (re instanceof M.error.RecognitionException) { 10317 localctx.exception = re; 10318 this._errHandler.reportError(this, re); 10319 this._errHandler.recover(this, re); 10320 } else { 10321 throw re; 10322 } 10323 } finally { 10324 this.exitRule(); 10325 } 10326 return localctx; 10327 } 10328 compound_stmt() { 10329 let localctx = new Compound_stmtContext(this, this._ctx, this.state); 10330 this.enterRule(localctx, 4, _ZomicParser.RULE_compound_stmt); 10331 var _la = 0; 10332 try { 10333 this.enterOuterAlt(localctx, 1); 10334 this.state = 79; 10335 this.match(_ZomicParser.LBRACE); 10336 this.state = 83; 10337 this._errHandler.sync(this); 10338 _la = this._input.LA(1); 10339 while ((_la & ~31) === 0 && (1 << _la & 4294734782) !== 0 || (_la - 32 & ~31) === 0 && (1 << _la - 32 & 2079) !== 0) { 10340 this.state = 80; 10341 this.stmt(); 10342 this.state = 85; 10343 this._errHandler.sync(this); 10344 _la = this._input.LA(1); 10345 } 10346 this.state = 86; 10347 this.match(_ZomicParser.RBRACE); 10348 } catch (re) { 10349 if (re instanceof M.error.RecognitionException) { 10350 localctx.exception = re; 10351 this._errHandler.reportError(this, re); 10352 this._errHandler.recover(this, re); 10353 } else { 10354 throw re; 10355 } 10356 } finally { 10357 this.exitRule(); 10358 } 10359 return localctx; 10360 } 10361 directCommand() { 10362 let localctx = new DirectCommandContext(this, this._ctx, this.state); 10363 this.enterRule(localctx, 6, _ZomicParser.RULE_directCommand); 10364 try { 10365 this.state = 95; 10366 this._errHandler.sync(this); 10367 switch (this._input.LA(1)) { 10368 case 18: 10369 case 19: 10370 case 20: 10371 case 21: 10372 case 22: 10373 case 23: 10374 case 24: 10375 case 25: 10376 case 26: 10377 case 27: 10378 case 28: 10379 case 29: 10380 case 30: 10381 case 31: 10382 case 32: 10383 case 33: 10384 case 34: 10385 case 35: 10386 case 43: 10387 this.enterOuterAlt(localctx, 1); 10388 this.state = 88; 10389 this.strut_stmt(); 10390 break; 10391 case 5: 10392 this.enterOuterAlt(localctx, 2); 10393 this.state = 89; 10394 this.rotate_stmt(); 10395 break; 10396 case 7: 10397 this.enterOuterAlt(localctx, 3); 10398 this.state = 90; 10399 this.reflect_stmt(); 10400 break; 10401 case 2: 10402 this.enterOuterAlt(localctx, 4); 10403 this.state = 91; 10404 this.scale_stmt(); 10405 break; 10406 case 3: 10407 this.enterOuterAlt(localctx, 5); 10408 this.state = 92; 10409 this.build_stmt(); 10410 break; 10411 case 4: 10412 this.enterOuterAlt(localctx, 6); 10413 this.state = 93; 10414 this.move_stmt(); 10415 break; 10416 case 1: 10417 this.enterOuterAlt(localctx, 7); 10418 this.state = 94; 10419 this.label_stmt(); 10420 break; 10421 default: 10422 throw new M.error.NoViableAltException(this); 10423 } 10424 } catch (re) { 10425 if (re instanceof M.error.RecognitionException) { 10426 localctx.exception = re; 10427 this._errHandler.reportError(this, re); 10428 this._errHandler.recover(this, re); 10429 } else { 10430 throw re; 10431 } 10432 } finally { 10433 this.exitRule(); 10434 } 10435 return localctx; 10436 } 10437 nestedCommand() { 10438 let localctx = new NestedCommandContext(this, this._ctx, this.state);
10439 this.enterRule(localctx, 8, _ZomicParser.RULE_nestedCommand); 10440 try { 10441 this.state = 102; 10442 this._errHandler.sync(this); 10443 switch (this._input.LA(1)) { 10444 case 8: 10445 this.enterOuterAlt(localctx, 1); 10446 this.state = 97; 10447 this.from_stmt(); 10448 break; 10449 case 13: 10450 this.enterOuterAlt(localctx, 2); 10451 this.state = 98; 10452 this.branch_stmt(); 10453 break; 10454 case 12: 10455 this.enterOuterAlt(localctx, 3); 10456 this.state = 99; 10457 this.repeat_stmt(); 10458 break; 10459 case 9: 10460 this.enterOuterAlt(localctx, 4); 10461 this.state = 100; 10462 this.symmetry_stmt(); 10463 break; 10464 case 14: 10465 this.enterOuterAlt(localctx, 5); 10466 this.state = 101; 10467 this.save_stmt(); 10468 break; 10469 default: 10470 throw new M.error.NoViableAltException(this); 10471 } 10472 } catch (re) { 10473 if (re instanceof M.error.RecognitionException) { 10474 localctx.exception = re; 10475 this._errHandler.reportError(this, re); 10476 this._errHandler.recover(this, re); 10477 } else { 10478 throw re; 10479 } 10480 } finally { 10481 this.exitRule(); 10482 } 10483 return localctx; 10484 } 10485 strut_stmt() { 10486 let localctx = new Strut_stmtContext(this, this._ctx, this.state); 10487 this.enterRule(localctx, 10, _ZomicParser.RULE_strut_stmt); 10488 try { 10489 this.enterOuterAlt(localctx, 1); 10490 this.state = 104; 10491 this.strut_length_expr(); 10492 this.state = 105; 10493 this.axis_expr(); 10494 } catch (re) { 10495 if (re instanceof M.error.RecognitionException) { 10496 localctx.exception = re; 10497 this._errHandler.reportError(this, re); 10498 this._errHandler.recover(this, re); 10499 } else { 10500 throw re; 10501 } 10502 } finally { 10503 this.exitRule(); 10504 } 10505 return localctx; 10506 } 10507 label_stmt() { 10508 let localctx = new Label_stmtContext(this, this._ctx, this.state); 10509 this.enterRule(localctx, 12, _ZomicParser.RULE_label_stmt); 10510 try { 10511 this.enterOuterAlt(localctx, 1); 10512 this.state = 107; 10513 this.match(_ZomicParser.LABEL); 10514 this.state = 108; 10515 this.match(_ZomicParser.IDENT); 10516 } catch (re) { 10517 if (re instanceof M.error.RecognitionException) { 10518 localctx.exception = re; 10519 this._errHandler.reportError(this, re); 10520 this._errHandler.recover(this, re); 10521 } else { 10522 throw re; 10523 } 10524 } finally { 10525 this.exitRule(); 10526 } 10527 return localctx; 10528 } 10529 scale_stmt() { 10530 let localctx = new Scale_stmtContext(this, this._ctx, this.state); 10531 this.enterRule(localctx, 14, _ZomicParser.RULE_scale_stmt); 10532 var _la = 0; 10533 try { 10534 this.enterOuterAlt(localctx, 1); 10535 this.state = 110; 10536 this.match(_ZomicParser.SCALE); 10537 this.state = 111; 10538 localctx.scale = this.match(_ZomicParser.INT); 10539 this.state = 117; 10540 this._errHandler.sync(this); 10541 _la = this._input.LA(1); 10542 if (_la === 38) { 10543 this.state = 112; 10544 this.match(_ZomicParser.LPAREN); 10545 this.state = 114; 10546 this._errHandler.sync(this); 10547 _la = this._input.LA(1); 10548 if (_la === 43) { 10549 this.state = 113; 10550 this.algebraic_number_expr(); 10551 } 10552 this.state = 116; 10553 this.match(_ZomicParser.RPAREN); 10554 } 10555 } catch (re) { 10556 if (re instanceof M.error.RecognitionException) { 10557 localctx.exception = re; 10558 this._errHandler.reportError(this, re); 10559 this._errHandler.recover(this, re); 10560 } else { 10561 throw re; 10562 } 10563 } finally { 10564 this.exitRule(); 10565 } 10566 return localctx; 10567 } 10568 build_stmt() { 10569 let localctx = new Build_stmtContext(this, this._ctx, this.state); 10570 this.enterRule(localctx, 16, _ZomicParser.RULE_build_stmt); 10571 try { 10572 this.enterOuterAlt(localctx, 1); 10573 this.state = 119; 10574 this.match(_ZomicParser.BUILD); 10575 } catch (re) { 10576 if (re instanceof M.error.RecognitionException) { 10577 localctx.exception = re; 10578 this._errHandler.reportError(this, re); 10579 this._errHandler.recover(this, re); 10580 } else { 10581 throw re; 10582 } 10583 } finally { 10584 this.exitRule(); 10585 } 10586 return localctx; 10587 } 10588 move_stmt() { 10589 let localctx = new Move_stmtContext(this, this._ctx, this.state); 10590 this.enterRule(localctx, 18, _ZomicParser.RULE_move_stmt); 10591 try { 10592 this.enterOuterAlt(localctx, 1); 10593 this.state = 121; 10594 this.match(_ZomicParser.MOVE); 10595 } catch (re) { 10596 if (re instanceof M.error.RecognitionException) { 10597 localctx.exception = re; 10598 this._errHandler.reportError(this, re); 10599 this._errHandler.recover(this, re); 10600 } else { 10601 throw re; 10602 } 10603 } finally { 10604 this.exitRule(); 10605 } 10606 return localctx; 10607 } 10608 rotate_stmt() { 10609 let localctx = new Rotate_stmtContext(this, this._ctx, this.state); 10610 this.enterRule(localctx, 20, _ZomicParser.RULE_rotate_stmt); 10611 var _la = 0; 10612 try { 10613 this.enterOuterAlt(localctx, 1); 10614 this.state = 123; 10615 this.match(_ZomicParser.ROTATE); 10616 this.state = 125; 10617 this._errHandler.sync(this); 10618 _la = this._input.LA(1); 10619 if (_la === 43) { 10620 this.state = 124; 10621 localctx.steps = this.match(_ZomicParser.INT); 10622 } 10623 this.state = 127; 10624 this.match(_ZomicParser.AROUND); 10625 this.state = 128; 10626 this.axis_expr(); 10627 } catch (re) { 10628 if (re instanceof M.error.RecognitionException) { 10629 localctx.exception = re; 10630 this._errHandler.reportError(this, re); 10631 this._errHandler.recover(this, re); 10632 } else { 10633 throw re; 10634 } 10635 } finally { 10636 this.exitRule(); 10637 } 10638 return localctx; 10639 } 10640 reflect_stmt() { 10641 let localctx = new Reflect_stmtContext(this, this._ctx, this.state); 10642 this.enterRule(localctx, 22, _ZomicParser.RULE_reflect_stmt); 10643 try { 10644 this.enterOuterAlt(localctx, 1); 10645 this.state = 130; 10646 this.match(_ZomicParser.REFLECT); 10647 this.state = 131; 10648 this.symmetry_center_expr(); 10649 } catch (re) { 10650 if (re instanceof M.error.RecognitionException) { 10651 localctx.exception = re; 10652 this._errHandler.reportError(this, re); 10653 this._errHandler.recover(this, re); 10654 } else { 10655 throw re; 10656 } 10657 } finally { 10658 this.exitRule(); 10659 } 10660 return localctx; 10661 } 10662 from_stmt() { 10663 let localctx = new From_stmtContext(this, this._ctx, this.state); 10664 this.enterRule(localctx, 24, _ZomicParser.RULE_from_stmt); 10665 try { 10666 this.enterOuterAlt(localctx, 1); 10667 this.state = 133; 10668 this.match(_ZomicParser.FROM); 10669 this.state = 134; 10670 this.stmt(); 10671 } catch (re) { 10672 if (re instanceof M.error.RecognitionException) { 10673 localctx.exception = re; 10674 this._errHandler.reportError(this, re); 10675 this._errHandler.recover(this, re); 10676 } else { 10677 throw re; 10678 } 10679 } finally { 10680 this.exitRule(); 10681 } 10682 return localctx; 10683 } 10684 symmetry_stmt() { 10685 let localctx = new Symmetry_stmtContext(this, this._ctx, this.state); 10686 this.enterRule(localctx, 26, _ZomicParser.RULE_symmetry_stmt); 10687 try { 10688 this.enterOuterAlt(localctx, 1); 10689 this.state = 136; 10690 this.match(_ZomicParser.SYMMETRY); 10691 this.state = 140; 10692 this._errHandler.sync(this); 10693 switch (this._input.LA(1)) { 10694 case 6: 10695 this.state = 137; 10696 this.match(_ZomicParser.AROUND); 10697 this.state = 138; 10698 this.axis_expr(); 10699 break; 10700 case 10: 10701 this.state = 139; 10702 this.symmetry_center_expr(); 10703 break; 10704 case 1: 10705 case 2: 10706 case 3: 10707 case 4: 10708 case 5: 10709 case 7: 10710 case 8: 10711 case 9: 10712 case 12: 10713 case 13: 10714 case 14: 10715 case 18: 10716 case 19: 10717 case 20: 10718 case 21: 10719 case 22: 10720 case 23: 10721 case 24: 10722 case 25: 10723 case 26: 10724 case 27: 10725 case 28: 10726 case 29: 10727 case 30: 10728 case 31: 10729 case 32: 10730 case 33: 10731 case 34: 10732 case 35: 10733 case 36: 10734 case 43: 10735 break; 10736 default: 10737 break; 10738 } 10739 this.state = 142; 10740 this.stmt(); 10741 } catch (re) { 10742 if (re instanceof M.error.RecognitionException) { 10743 localctx.exception = re; 10744 this._errHandler.reportError(this, re); 10745 this._errHandler.recover(this, re); 10746 } else { 10747 throw re; 10748 } 10749 } finally { 10750 this.exitRule(); 10751 } 10752 return localctx; 10753 } 10754 repeat_stmt() { 10755 let localctx = new Repeat_stmtContext(this, this._ctx, this.state); 10756 this.enterRule(localctx, 28, _ZomicParser.RULE_repeat_stmt); 10757 try { 10758 this.enterOuterAlt(localctx, 1); 10759 this.state = 144; 10760 this.match(_ZomicParser.REPEAT); 10761 this.state = 145; 10762 localctx.count = this.match(_ZomicParser.INT); 10763 this.state = 146; 10764 this.stmt(); 10765 } catch (re) { 10766 if (re instanceof M.error.RecognitionException) { 10767 localctx.exception = re; 10768 this._errHandler.reportError(this, re); 10769 this._errHandler.recover(this, re); 10770 } else { 10771 throw re; 10772 } 10773 } finally { 10774 this.exitRule(); 10775 } 10776 return localctx; 10777 } 10778 branch_stmt() { 10779 let localctx = new Branch_stmtContext(this, this._ctx, this.state); 10780 this.enterRule(localctx, 30, _ZomicParser.RULE_branch_stmt); 10781 try { 10782 this.enterOuterAlt(localctx, 1); 10783 this.state = 148; 10784 this.match(_ZomicParser.BRANCH); 10785 this.state = 149; 10786 this.stmt(); 10787 } catch (re) { 10788 if (re instanceof M.error.RecognitionException) { 10789 localctx.exception = re; 10790 this._errHandler.reportError(this, re); 10791 this._errHandler.recover(this, re); 10792 } else { 10793 throw re; 10794 } 10795 } finally { 10796 this.exitRule(); 10797 } 10798 return localctx; 10799 } 10800 save_stmt() { 10801 let localctx = new Save_stmtContext(this, this._ctx, this.state); 10802 this.enterRule(localctx, 32, _ZomicParser.RULE_save_stmt); 10803 var _la = 0; 10804 try { 10805 this.enterOuterAlt(localctx, 1); 10806 this.state = 151; 10807 this.match(_ZomicParser.SAVE); 10808 this.state = 152; 10809 localctx.state = this._input.LT(1); 10810 _la = this._input.LA(1); 10811 if (!((_la & ~31) === 0 && (1 << _la & 229388) !== 0)) { 10812 localctx.state = this._errHandler.recoverInline(this); 10813 } else { 10814 this._errHandler.reportMatch(this); 10815 this.consume(); 10816 } 10817 this.state = 153; 10818 this.stmt(); 10819 } catch (re) { 10820 if (re instanceof M.error.RecognitionException) { 10821 localctx.exception = re; 10822 this._errHandler.reportError(this, re); 10823 this._errHandler.recover(this, re); 10824 } else { 10825 throw re; 10826 } 10827 } finally { 10828 this.exitRule(); 10829 } 10830 return localctx; 10831 } 10832 strut_length_expr() { 10833 let localctx = new Strut_length_exprContext(this, this._ctx, this.state); 10834 this.enterRule(localctx, 34, _ZomicParser.RULE_strut_length_expr); 10835 var _la = 0; 10836 try { 10837 this.enterOuterAlt(localctx, 1); 10838 this.state = 155; 10839 this.size_expr(); 10840 this.state = 157; 10841 this._errHandler.sync(this); 10842 _la = this._input.LA(1); 10843 if (_la === 43) { 10844 this.state = 156; 10845 this.algebraic_number_expr(); 10846 } 10847 this.state = 160; 10848 this._errHandler.sync(this); 10849 _la = this._input.LA(1); 10850 if (_la === 18) { 10851 this.state = 159; 10852 this.match(_ZomicParser.HALF); 10853 } 10854 } catch (re) { 10855 if (re instanceof M.error.RecognitionException) { 10856 localctx.exception = re; 10857 this._errHandler.reportError(this, re); 10858 this._errHandler.recover(this, re); 10859 } else { 10860 throw re; 10861 } 10862 } finally { 10863 this.exitRule(); 10864 } 10865 return localctx; 10866 } 10867 size_expr() { 10868 let localctx = new Size_exprContext(this, this._ctx, this.state); 10869 this.enterRule(localctx, 36, _ZomicParser.RULE_size_expr); 10870 try { 10871 this.state = 164; 10872 this._errHandler.sync(this); 10873 switch (this._input.LA(1)) { 10874 case 19: 10875 this.enterOuterAlt(localctx, 1); 10876 this.state = 162; 10877 this.explicit_size_expr(); 10878 break; 10879 case 18: 10880 case 20: 10881 case 21: 10882 case 22: 10883 case 23: 10884 case 24: 10885 case 25: 10886 case 26: 10887 case 27: 10888 case 28: 10889 case 29: 10890 case 30: 10891 case 31: 10892 case 32: 10893 case 33: 10894 case 34: 10895 case 35: 10896 case 43: 10897 this.enterOuterAlt(localctx, 2); 10898 this.state = 163; 10899 this.named_size_expr(); 10900 break; 10901 default: 10902 throw new M.error.NoViableAltException(this); 10903 } 10904 } catch (re) { 10905 if (re instanceof M.error.RecognitionException) { 10906 localctx.exception = re; 10907 this._errHandler.reportError(this, re); 10908 this._errHandler.recover(this, re); 10909 } else { 10910 throw re; 10911 } 10912 } finally { 10913 this.exitRule(); 10914 } 10915 return localctx; 10916 } 10917 algebraic_number_expr() { 10918 let localctx = new Algebraic_number_exprContext(this, this._ctx, this.state); 10919 this.enterRule(localctx, 38, _ZomicParser.RULE_algebraic_number_expr); 10920 var _la = 0; 10921 try { 10922 this.enterOuterAlt(localctx, 1); 10923 this.state = 166; 10924 localctx.ones = this.match(_ZomicParser.INT); 10925 this.state = 168; 10926 this._errHandler.sync(this); 10927 _la = this._input.LA(1); 10928 if (_la === 43) { 10929 this.state = 167; 10930 localctx.phis = this.match(_ZomicParser.INT); 10931 } 10932 } catch (re) { 10933 if (re instanceof M.error.RecognitionException) { 10934 localctx.exception = re; 10935 this._errHandler.reportError(this, re); 10936 this._errHandler.recover(this, re); 10937 } else { 10938 throw re; 10939 } 10940 } finally { 10941 this.exitRule(); 10942 } 10943 return localctx; 10944 } 10945 explicit_size_expr() { 10946 let localctx = new Explicit_size_exprContext(this, this._ctx, this.state); 10947 this.enterRule(localctx, 40, _ZomicParser.RULE_explicit_size_expr); 10948 try { 10949 this.enterOuterAlt(localctx, 1); 10950 this.state = 170; 10951 this.match(_ZomicParser.SIZE); 10952 this.state = 173; 10953 this._errHandler.sync(this); 10954 switch (this._input.LA(1)) { 10955 case 43: 10956 this.state = 171; 10957 localctx.scale = this.match(_ZomicParser.INT); 10958 break; 10959 case 40: 10960 this.state = 172; 10961 localctx.isVariableLength = this.match(_ZomicParser.QUESTIONMARK); 10962 break; 10963 default: 10964 throw new M.error.NoViableAltException(this); 10965 } 10966 } catch (re) { 10967 if (re instanceof M.error.RecognitionException) { 10968 localctx.exception = re; 10969 this._errHandler.reportError(this, re); 10970 this._errHandler.recover(this, re); 10971 } else { 10972 throw re; 10973 } 10974 } finally { 10975 this.exitRule(); 10976 } 10977 return localctx; 10978 } 10979 named_size_expr() { 10980 let localctx = new Named_size_exprContext(this, this._ctx, this.state);
10981 this.enterRule(localctx, 42, _ZomicParser.RULE_named_size_expr); 10982 try { 10983 this.state = 179; 10984 this._errHandler.sync(this); 10985 switch (this._input.LA(1)) { 10986 case 20: 10987 localctx = new SizeShortContext(this, localctx); 10988 this.enterOuterAlt(localctx, 1); 10989 this.state = 175; 10990 this.match(_ZomicParser.SHORT); 10991 break; 10992 case 22: 10993 localctx = new SizeLongContext(this, localctx); 10994 this.enterOuterAlt(localctx, 2); 10995 this.state = 176; 10996 this.match(_ZomicParser.LONG); 10997 break; 10998 case 21: 10999 localctx = new SizeMediumContext(this, localctx); 11000 this.enterOuterAlt(localctx, 3); 11001 this.state = 177; 11002 this.match(_ZomicParser.MEDIUM); 11003 break; 11004 case 18: 11005 case 23: 11006 case 24: 11007 case 25: 11008 case 26: 11009 case 27: 11010 case 28: 11011 case 29: 11012 case 30: 11013 case 31: 11014 case 32: 11015 case 33: 11016 case 34: 11017 case 35: 11018 case 43: 11019 localctx = new SizeMediumContext(this, localctx); 11020 this.enterOuterAlt(localctx, 4); 11021 break; 11022 default: 11023 throw new M.error.NoViableAltException(this); 11024 } 11025 } catch (re) { 11026 if (re instanceof M.error.RecognitionException) { 11027 localctx.exception = re; 11028 this._errHandler.reportError(this, re); 11029 this._errHandler.recover(this, re); 11030 } else { 11031 throw re; 11032 } 11033 } finally { 11034 this.exitRule(); 11035 } 11036 return localctx; 11037 } 11038 symmetry_center_expr() { 11039 let localctx = new Symmetry_center_exprContext(this, this._ctx, this.state); 11040 this.enterRule(localctx, 44, _ZomicParser.RULE_symmetry_center_expr); 11041 var _la = 0; 11042 try { 11043 this.enterOuterAlt(localctx, 1); 11044 this.state = 181; 11045 this.match(_ZomicParser.THROUGH); 11046 this.state = 187; 11047 this._errHandler.sync(this); 11048 switch (this._input.LA(1)) { 11049 case 11: 11050 this.state = 182; 11051 this.match(_ZomicParser.CENTER); 11052 break; 11053 case 30: 11054 case 31: 11055 case 32: 11056 case 43: 11057 this.state = 184; 11058 this._errHandler.sync(this); 11059 _la = this._input.LA(1); 11060 if ((_la - 30 & ~31) === 0 && (1 << _la - 30 & 7) !== 0) { 11061 this.state = 183; 11062 this.blue_alias_expr(); 11063 } 11064 this.state = 186; 11065 localctx.blueAxisIndexNumber = this.match(_ZomicParser.INT); 11066 break; 11067 default: 11068 throw new M.error.NoViableAltException(this); 11069 } 11070 } catch (re) { 11071 if (re instanceof M.error.RecognitionException) { 11072 localctx.exception = re; 11073 this._errHandler.reportError(this, re); 11074 this._errHandler.recover(this, re); 11075 } else { 11076 throw re; 11077 } 11078 } finally { 11079 this.exitRule(); 11080 } 11081 return localctx; 11082 } 11083 axis_expr() { 11084 let localctx = new Axis_exprContext(this, this._ctx, this.state); 11085 this.enterRule(localctx, 46, _ZomicParser.RULE_axis_expr); 11086 try { 11087 this.enterOuterAlt(localctx, 1); 11088 this.state = 189; 11089 this.axis_name_expr(); 11090 this.state = 190; 11091 localctx.index = this.axis_index_expr(); 11092 } catch (re) { 11093 if (re instanceof M.error.RecognitionException) { 11094 localctx.exception = re; 11095 this._errHandler.reportError(this, re); 11096 this._errHandler.recover(this, re); 11097 } else { 11098 throw re; 11099 } 11100 } finally { 11101 this.exitRule(); 11102 } 11103 return localctx; 11104 } 11105 axis_index_expr() { 11106 let localctx = new Axis_index_exprContext(this, this._ctx, this.state); 11107 this.enterRule(localctx, 48, _ZomicParser.RULE_axis_index_expr); 11108 var _la = 0; 11109 try { 11110 this.enterOuterAlt(localctx, 1); 11111 this.state = 192; 11112 localctx.indexNumber = this.match(_ZomicParser.INT); 11113 this.state = 194; 11114 this._errHandler.sync(this); 11115 _la = this._input.LA(1); 11116 if (_la === 44) { 11117 this.state = 193; 11118 localctx.handedness = this.match(_ZomicParser.POLARITY); 11119 } 11120 } catch (re) { 11121 if (re instanceof M.error.RecognitionException) { 11122 localctx.exception = re; 11123 this._errHandler.reportError(this, re); 11124 this._errHandler.recover(this, re); 11125 } else { 11126 throw re; 11127 } 11128 } finally { 11129 this.exitRule(); 11130 } 11131 return localctx; 11132 } 11133 axis_name_expr() { 11134 let localctx = new Axis_name_exprContext(this, this._ctx, this.state); 11135 this.enterRule(localctx, 50, _ZomicParser.RULE_axis_name_expr); 11136 try { 11137 this.state = 203; 11138 this._errHandler.sync(this); 11139 switch (this._input.LA(1)) { 11140 case 27: 11141 case 28: 11142 case 29: 11143 this.enterOuterAlt(localctx, 1); 11144 this.state = 196; 11145 this.red_alias_expr(); 11146 break; 11147 case 30: 11148 case 31: 11149 case 32: 11150 this.enterOuterAlt(localctx, 2); 11151 this.state = 197; 11152 this.blue_alias_expr(); 11153 break; 11154 case 33: 11155 case 34: 11156 case 35: 11157 this.enterOuterAlt(localctx, 3); 11158 this.state = 198; 11159 this.yellow_alias_expr(); 11160 break; 11161 case 23: 11162 this.enterOuterAlt(localctx, 4); 11163 this.state = 199; 11164 this.green(); 11165 break; 11166 case 24: 11167 this.enterOuterAlt(localctx, 5); 11168 this.state = 200; 11169 this.orange(); 11170 break; 11171 case 25: 11172 this.enterOuterAlt(localctx, 6); 11173 this.state = 201; 11174 this.purple(); 11175 break; 11176 case 26: 11177 this.enterOuterAlt(localctx, 7); 11178 this.state = 202; 11179 this.black(); 11180 break; 11181 default: 11182 throw new M.error.NoViableAltException(this); 11183 } 11184 } catch (re) { 11185 if (re instanceof M.error.RecognitionException) { 11186 localctx.exception = re; 11187 this._errHandler.reportError(this, re); 11188 this._errHandler.recover(this, re); 11189 } else { 11190 throw re; 11191 } 11192 } finally { 11193 this.exitRule(); 11194 } 11195 return localctx; 11196 } 11197 red_alias_expr() { 11198 let localctx = new Red_alias_exprContext(this, this._ctx, this.state); 11199 this.enterRule(localctx, 52, _ZomicParser.RULE_red_alias_expr); 11200 try { 11201 this.state = 208; 11202 this._errHandler.sync(this); 11203 switch (this._input.LA(1)) { 11204 case 27: 11205 localctx = new RedContext(this, localctx); 11206 this.enterOuterAlt(localctx, 1); 11207 this.state = 205; 11208 this.match(_ZomicParser.RED); 11209 break; 11210 case 28: 11211 localctx = new RedContext(this, localctx); 11212 this.enterOuterAlt(localctx, 2); 11213 this.state = 206; 11214 this.match(_ZomicParser.PENT); 11215 break; 11216 case 29: 11217 localctx = new RedContext(this, localctx); 11218 this.enterOuterAlt(localctx, 3); 11219 this.state = 207; 11220 this.match(_ZomicParser.PENTAGON); 11221 break; 11222 default: 11223 throw new M.error.NoViableAltException(this); 11224 } 11225 } catch (re) { 11226 if (re instanceof M.error.RecognitionException) { 11227 localctx.exception = re; 11228 this._errHandler.reportError(this, re); 11229 this._errHandler.recover(this, re); 11230 } else { 11231 throw re; 11232 } 11233 } finally { 11234 this.exitRule(); 11235 } 11236 return localctx; 11237 } 11238 blue_alias_expr() { 11239 let localctx = new Blue_alias_exprContext(this, this._ctx, this.state); 11240 this.enterRule(localctx, 54, _ZomicParser.RULE_blue_alias_expr); 11241 try { 11242 this.state = 213; 11243 this._errHandler.sync(this); 11244 switch (this._input.LA(1)) { 11245 case 30: 11246 localctx = new BlueContext(this, localctx); 11247 this.enterOuterAlt(localctx, 1); 11248 this.state = 210; 11249 this.match(_ZomicParser.BLUE); 11250 break; 11251 case 31: 11252 localctx = new BlueContext(this, localctx); 11253 this.enterOuterAlt(localctx, 2); 11254 this.state = 211; 11255 this.match(_ZomicParser.RECT); 11256 break; 11257 case 32: 11258 localctx = new BlueContext(this, localctx); 11259 this.enterOuterAlt(localctx, 3); 11260 this.state = 212; 11261 this.match(_ZomicParser.RECTANGLE); 11262 break; 11263 default: 11264 throw new M.error.NoViableAltException(this); 11265 } 11266 } catch (re) { 11267 if (re instanceof M.error.RecognitionException) { 11268 localctx.exception = re; 11269 this._errHandler.reportError(this, re); 11270 this._errHandler.recover(this, re); 11271 } else { 11272 throw re; 11273 } 11274 } finally { 11275 this.exitRule(); 11276 } 11277 return localctx; 11278 } 11279 yellow_alias_expr() { 11280 let localctx = new Yellow_alias_exprContext(this, this._ctx, this.state); 11281 this.enterRule(localctx, 56, _ZomicParser.RULE_yellow_alias_expr); 11282 try { 11283 this.state = 218; 11284 this._errHandler.sync(this); 11285 switch (this._input.LA(1)) { 11286 case 33: 11287 localctx = new YellowContext(this, localctx); 11288 this.enterOuterAlt(localctx, 1); 11289 this.state = 215; 11290 this.match(_ZomicParser.YELLOW); 11291 break; 11292 case 34: 11293 localctx = new YellowContext(this, localctx); 11294 this.enterOuterAlt(localctx, 2); 11295 this.state = 216; 11296 this.match(_ZomicParser.TRI); 11297 break; 11298 case 35: 11299 localctx = new YellowContext(this, localctx); 11300 this.enterOuterAlt(localctx, 3); 11301 this.state = 217; 11302 this.match(_ZomicParser.TRIANGLE); 11303 break; 11304 default: 11305 throw new M.error.NoViableAltException(this); 11306 } 11307 } catch (re) { 11308 if (re instanceof M.error.RecognitionException) { 11309 localctx.exception = re; 11310 this._errHandler.reportError(this, re); 11311 this._errHandler.recover(this, re); 11312 } else { 11313 throw re; 11314 } 11315 } finally { 11316 this.exitRule(); 11317 } 11318 return localctx; 11319 } 11320 green() { 11321 let localctx = new GreenContext(this, this._ctx, this.state); 11322 this.enterRule(localctx, 58, _ZomicParser.RULE_green); 11323 try { 11324 this.enterOuterAlt(localctx, 1); 11325 this.state = 220; 11326 this.match(_ZomicParser.GREEN); 11327 } catch (re) { 11328 if (re instanceof M.error.RecognitionException) { 11329 localctx.exception = re; 11330 this._errHandler.reportError(this, re); 11331 this._errHandler.recover(this, re); 11332 } else { 11333 throw re; 11334 } 11335 } finally { 11336 this.exitRule(); 11337 } 11338 return localctx; 11339 } 11340 orange() { 11341 let localctx = new OrangeContext(this, this._ctx, this.state); 11342 this.enterRule(localctx, 60, _ZomicParser.RULE_orange); 11343 try { 11344 this.enterOuterAlt(localctx, 1); 11345 this.state = 222; 11346 this.match(_ZomicParser.ORANGE); 11347 } catch (re) { 11348 if (re instanceof M.error.RecognitionException) { 11349 localctx.exception = re; 11350 this._errHandler.reportError(this, re); 11351 this._errHandler.recover(this, re); 11352 } else { 11353 throw re; 11354 } 11355 } finally { 11356 this.exitRule(); 11357 } 11358 return localctx; 11359 } 11360 purple() { 11361 let localctx = new PurpleContext(this, this._ctx, this.state); 11362 this.enterRule(localctx, 62, _ZomicParser.RULE_purple); 11363 try { 11364 this.enterOuterAlt(localctx, 1); 11365 this.state = 224; 11366 this.match(_ZomicParser.PURPLE); 11367 } catch (re) { 11368 if (re instanceof M.error.RecognitionException) { 11369 localctx.exception = re; 11370 this._errHandler.reportError(this, re); 11371 this._errHandler.recover(this, re); 11372 } else { 11373 throw re; 11374 } 11375 } finally { 11376 this.exitRule(); 11377 } 11378 return localctx; 11379 } 11380 black() { 11381 let localctx = new BlackContext(this, this._ctx, this.state); 11382 this.enterRule(localctx, 64, _ZomicParser.RULE_black); 11383 try { 11384 this.enterOuterAlt(localctx, 1); 11385 this.state = 226; 11386 this.match(_ZomicParser.BLACK); 11387 } catch (re) { 11388 if (re instanceof M.error.RecognitionException) { 11389 localctx.exception = re; 11390 this._errHandler.reportError(this, re); 11391 this._errHandler.recover(this, re); 11392 } else { 11393 throw re; 11394 } 11395 } finally { 11396 this.exitRule(); 11397 } 11398 return localctx; 11399 } 11400}; 11401ZomicParser.EOF = M.Token.EOF; 11402ZomicParser.LABEL = 1; 11403ZomicParser.SCALE = 2; 11404ZomicParser.BUILD = 3; 11405ZomicParser.MOVE = 4; 11406ZomicParser.ROTATE = 5; 11407ZomicParser.AROUND = 6; 11408ZomicParser.REFLECT = 7; 11409ZomicParser.FROM = 8; 11410ZomicParser.SYMMETRY = 9; 11411ZomicParser.THROUGH = 10; 11412ZomicParser.CENTER = 11; 11413ZomicParser.REPEAT = 12; 11414ZomicParser.BRANCH = 13; 11415ZomicParser.SAVE = 14; 11416ZomicParser.LOCATION = 15; 11417ZomicParser.ORIENTATION = 16; 11418ZomicParser.ALL = 17; 11419ZomicParser.HALF = 18; 11420ZomicParser.SIZE = 19; 11421ZomicParser.SHORT = 20; 11422ZomicParser.MEDIUM = 21; 11423ZomicParser.LONG = 22; 11424ZomicParser.GREEN = 23; 11425ZomicParser.ORANGE = 24; 11426ZomicParser.PURPLE = 25; 11427ZomicParser.BLACK = 26; 11428ZomicParser.RED = 27; 11429ZomicParser.PENT = 28; 11430ZomicParser.PENTAGON = 29; 11431ZomicParser.BLUE = 30; 11432ZomicParser.RECT = 31; 11433ZomicParser.RECTANGLE = 32; 11434ZomicParser.YELLOW = 33; 11435ZomicParser.TRI = 34; 11436ZomicParser.TRIANGLE = 35; 11437ZomicParser.LBRACE = 36; 11438ZomicParser.RBRACE = 37; 11439ZomicParser.LPAREN = 38; 11440ZomicParser.RPAREN = 39; 11441ZomicParser.QUESTIONMARK = 40; 11442ZomicParser.WS = 41; 11443ZomicParser.EOL = 42; 11444ZomicParser.INT = 43; 11445ZomicParser.POLARITY = 44; 11446ZomicParser.SL_COMMENT = 45; 11447ZomicParser.ML_COMMENT = 46; 11448ZomicParser.IDENT = 47; 11449ZomicParser.UNEXPECTED_CHAR = 48; 11450ZomicParser.RULE_program = 0; 11451ZomicParser.RULE_stmt = 1; 11452ZomicParser.RULE_compound_stmt = 2; 11453ZomicParser.RULE_directCommand = 3;
11454ZomicParser.RULE_nestedCommand = 4; 11455ZomicParser.RULE_strut_stmt = 5; 11456ZomicParser.RULE_label_stmt = 6; 11457ZomicParser.RULE_scale_stmt = 7; 11458ZomicParser.RULE_build_stmt = 8; 11459ZomicParser.RULE_move_stmt = 9; 11460ZomicParser.RULE_rotate_stmt = 10; 11461ZomicParser.RULE_reflect_stmt = 11; 11462ZomicParser.RULE_from_stmt = 12; 11463ZomicParser.RULE_symmetry_stmt = 13; 11464ZomicParser.RULE_repeat_stmt = 14; 11465ZomicParser.RULE_branch_stmt = 15; 11466ZomicParser.RULE_save_stmt = 16; 11467ZomicParser.RULE_strut_length_expr = 17; 11468ZomicParser.RULE_size_expr = 18; 11469ZomicParser.RULE_algebraic_number_expr = 19; 11470ZomicParser.RULE_explicit_size_expr = 20; 11471ZomicParser.RULE_named_size_expr = 21; 11472ZomicParser.RULE_symmetry_center_expr = 22; 11473ZomicParser.RULE_axis_expr = 23; 11474ZomicParser.RULE_axis_index_expr = 24; 11475ZomicParser.RULE_axis_name_expr = 25; 11476ZomicParser.RULE_red_alias_expr = 26; 11477ZomicParser.RULE_blue_alias_expr = 27; 11478ZomicParser.RULE_yellow_alias_expr = 28; 11479ZomicParser.RULE_green = 29; 11480ZomicParser.RULE_orange = 30; 11481ZomicParser.RULE_purple = 31; 11482ZomicParser.RULE_black = 32; 11483var ProgramContext = class extends M.ParserRuleContext { 11484 constructor(parser, parent, invokingState) { 11485 if (parent === void 0) { 11486 parent = null; 11487 } 11488 if (invokingState === void 0 || invokingState === null) { 11489 invokingState = -1; 11490 } 11491 super(parent, invokingState); 11492 this.parser = parser; 11493 this.ruleIndex = ZomicParser.RULE_program; 11494 } 11495 EOF() { 11496 return this.getToken(ZomicParser.EOF, 0); 11497 } 11498 stmt = function(i2) { 11499 if (i2 === void 0) { 11500 i2 = null; 11501 } 11502 if (i2 === null) { 11503 return this.getTypedRuleContexts(StmtContext); 11504 } else { 11505 return this.getTypedRuleContext(StmtContext, i2); 11506 } 11507 }; 11508 enterRule(listener) { 11509 if (listener instanceof ZomicParserListener) { 11510 listener.enterProgram(this); 11511 } 11512 } 11513 exitRule(listener) { 11514 if (listener instanceof ZomicParserListener) { 11515 listener.exitProgram(this); 11516 } 11517 } 11518}; 11519var StmtContext = class extends M.ParserRuleContext { 11520 constructor(parser, parent, invokingState) { 11521 if (parent === void 0) { 11522 parent = null; 11523 } 11524 if (invokingState === void 0 || invokingState === null) { 11525 invokingState = -1; 11526 } 11527 super(parent, invokingState); 11528 this.parser = parser; 11529 this.ruleIndex = ZomicParser.RULE_stmt; 11530 } 11531 directCommand() { 11532 return this.getTypedRuleContext(DirectCommandContext, 0); 11533 } 11534 nestedCommand() { 11535 return this.getTypedRuleContext(NestedCommandContext, 0); 11536 } 11537 compound_stmt() { 11538 return this.getTypedRuleContext(Compound_stmtContext, 0); 11539 } 11540 enterRule(listener) { 11541 if (listener instanceof ZomicParserListener) { 11542 listener.enterStmt(this); 11543 } 11544 } 11545 exitRule(listener) { 11546 if (listener instanceof ZomicParserListener) { 11547 listener.exitStmt(this); 11548 } 11549 } 11550}; 11551var Compound_stmtContext = class extends M.ParserRuleContext { 11552 constructor(parser, parent, invokingState) { 11553 if (parent === void 0) { 11554 parent = null; 11555 } 11556 if (invokingState === void 0 || invokingState === null) { 11557 invokingState = -1; 11558 } 11559 super(parent, invokingState); 11560 this.parser = parser; 11561 this.ruleIndex = ZomicParser.RULE_compound_stmt; 11562 } 11563 LBRACE() { 11564 return this.getToken(ZomicParser.LBRACE, 0); 11565 } 11566 RBRACE() { 11567 return this.getToken(ZomicParser.RBRACE, 0); 11568 } 11569 stmt = function(i2) { 11570 if (i2 === void 0) { 11571 i2 = null; 11572 } 11573 if (i2 === null) { 11574 return this.getTypedRuleContexts(StmtContext); 11575 } else { 11576 return this.getTypedRuleContext(StmtContext, i2); 11577 } 11578 }; 11579 enterRule(listener) { 11580 if (listener instanceof ZomicParserListener) { 11581 listener.enterCompound_stmt(this); 11582 } 11583 } 11584 exitRule(listener) { 11585 if (listener instanceof ZomicParserListener) { 11586 listener.exitCompound_stmt(this); 11587 } 11588 } 11589}; 11590var DirectCommandContext = class extends M.ParserRuleContext { 11591 constructor(parser, parent, invokingState) { 11592 if (parent === void 0) { 11593 parent = null; 11594 } 11595 if (invokingState === void 0 || invokingState === null) { 11596 invokingState = -1; 11597 } 11598 super(parent, invokingState); 11599 this.parser = parser; 11600 this.ruleIndex = ZomicParser.RULE_directCommand; 11601 } 11602 strut_stmt() { 11603 return this.getTypedRuleContext(Strut_stmtContext, 0); 11604 } 11605 rotate_stmt() { 11606 return this.getTypedRuleContext(Rotate_stmtContext, 0); 11607 } 11608 reflect_stmt() { 11609 return this.getTypedRuleContext(Reflect_stmtContext, 0); 11610 } 11611 scale_stmt() { 11612 return this.getTypedRuleContext(Scale_stmtContext, 0); 11613 } 11614 build_stmt() { 11615 return this.getTypedRuleContext(Build_stmtContext, 0); 11616 } 11617 move_stmt() { 11618 return this.getTypedRuleContext(Move_stmtContext, 0); 11619 } 11620 label_stmt() { 11621 return this.getTypedRuleContext(Label_stmtContext, 0); 11622 } 11623 enterRule(listener) { 11624 if (listener instanceof ZomicParserListener) { 11625 listener.enterDirectCommand(this); 11626 } 11627 } 11628 exitRule(listener) { 11629 if (listener instanceof ZomicParserListener) { 11630 listener.exitDirectCommand(this); 11631 } 11632 } 11633}; 11634var NestedCommandContext = class extends M.ParserRuleContext { 11635 constructor(parser, parent, invokingState) { 11636 if (parent === void 0) { 11637 parent = null; 11638 } 11639 if (invokingState === void 0 || invokingState === null) { 11640 invokingState = -1; 11641 } 11642 super(parent, invokingState); 11643 this.parser = parser;
11644 this.ruleIndex = ZomicParser.RULE_nestedCommand; 11645 } 11646 from_stmt() { 11647 return this.getTypedRuleContext(From_stmtContext, 0); 11648 } 11649 branch_stmt() { 11650 return this.getTypedRuleContext(Branch_stmtContext, 0); 11651 } 11652 repeat_stmt() { 11653 return this.getTypedRuleContext(Repeat_stmtContext, 0); 11654 } 11655 symmetry_stmt() { 11656 return this.getTypedRuleContext(Symmetry_stmtContext, 0); 11657 } 11658 save_stmt() { 11659 return this.getTypedRuleContext(Save_stmtContext, 0); 11660 } 11661 enterRule(listener) { 11662 if (listener instanceof ZomicParserListener) { 11663 listener.enterNestedCommand(this); 11664 } 11665 } 11666 exitRule(listener) { 11667 if (listener instanceof ZomicParserListener) { 11668 listener.exitNestedCommand(this); 11669 } 11670 } 11671}; 11672var Strut_stmtContext = class extends M.ParserRuleContext { 11673 constructor(parser, parent, invokingState) { 11674 if (parent === void 0) { 11675 parent = null; 11676 } 11677 if (invokingState === void 0 || invokingState === null) { 11678 invokingState = -1; 11679 } 11680 super(parent, invokingState); 11681 this.parser = parser; 11682 this.ruleIndex = ZomicParser.RULE_strut_stmt; 11683 } 11684 strut_length_expr() { 11685 return this.getTypedRuleContext(Strut_length_exprContext, 0); 11686 } 11687 axis_expr() { 11688 return this.getTypedRuleContext(Axis_exprContext, 0); 11689 } 11690 enterRule(listener) { 11691 if (listener instanceof ZomicParserListener) { 11692 listener.enterStrut_stmt(this); 11693 } 11694 } 11695 exitRule(listener) { 11696 if (listener instanceof ZomicParserListener) { 11697 listener.exitStrut_stmt(this); 11698 } 11699 } 11700}; 11701var Label_stmtContext = class extends M.ParserRuleContext { 11702 constructor(parser, parent, invokingState) { 11703 if (parent === void 0) { 11704 parent = null; 11705 } 11706 if (invokingState === void 0 || invokingState === null) { 11707 invokingState = -1; 11708 } 11709 super(parent, invokingState); 11710 this.parser = parser; 11711 this.ruleIndex = ZomicParser.RULE_label_stmt; 11712 } 11713 LABEL() { 11714 return this.getToken(ZomicParser.LABEL, 0); 11715 } 11716 IDENT() { 11717 return this.getToken(ZomicParser.IDENT, 0); 11718 } 11719 enterRule(listener) { 11720 if (listener instanceof ZomicParserListener) { 11721 listener.enterLabel_stmt(this); 11722 } 11723 } 11724 exitRule(listener) { 11725 if (listener instanceof ZomicParserListener) { 11726 listener.exitLabel_stmt(this); 11727 } 11728 } 11729}; 11730var Scale_stmtContext = class extends M.ParserRuleContext { 11731 constructor(parser, parent, invokingState) { 11732 if (parent === void 0) { 11733 parent = null; 11734 } 11735 if (invokingState === void 0 || invokingState === null) { 11736 invokingState = -1; 11737 } 11738 super(parent, invokingState); 11739 this.parser = parser; 11740 this.ruleIndex = ZomicParser.RULE_scale_stmt; 11741 this.scale = null; 11742 } 11743 SCALE() { 11744 return this.getToken(ZomicParser.SCALE, 0); 11745 } 11746 INT() { 11747 return this.getToken(ZomicParser.INT, 0); 11748 } 11749 LPAREN() { 11750 return this.getToken(ZomicParser.LPAREN, 0); 11751 } 11752 RPAREN() { 11753 return this.getToken(ZomicParser.RPAREN, 0); 11754 } 11755 algebraic_number_expr() { 11756 return this.getTypedRuleContext(Algebraic_number_exprContext, 0); 11757 } 11758 enterRule(listener) { 11759 if (listener instanceof ZomicParserListener) { 11760 listener.enterScale_stmt(this); 11761 } 11762 } 11763 exitRule(listener) { 11764 if (listener instanceof ZomicParserListener) { 11765 listener.exitScale_stmt(this); 11766 } 11767 } 11768}; 11769var Build_stmtContext = class extends M.ParserRuleContext { 11770 constructor(parser, parent, invokingState) { 11771 if (parent === void 0) { 11772 parent = null; 11773 } 11774 if (invokingState === void 0 || invokingState === null) { 11775 invokingState = -1; 11776 } 11777 super(parent, invokingState); 11778 this.parser = parser; 11779 this.ruleIndex = ZomicParser.RULE_build_stmt; 11780 } 11781 BUILD() { 11782 return this.getToken(ZomicParser.BUILD, 0); 11783 } 11784 enterRule(listener) { 11785 if (listener instanceof ZomicParserListener) { 11786 listener.enterBuild_stmt(this); 11787 } 11788 } 11789 exitRule(listener) { 11790 if (listener instanceof ZomicParserListener) { 11791 listener.exitBuild_stmt(this); 11792 } 11793 } 11794}; 11795var Move_stmtContext = class extends M.ParserRuleContext { 11796 constructor(parser, parent, invokingState) { 11797 if (parent === void 0) { 11798 parent = null; 11799 } 11800 if (invokingState === void 0 || invokingState === null) { 11801 invokingState = -1; 11802 } 11803 super(parent, invokingState); 11804 this.parser = parser; 11805 this.ruleIndex = ZomicParser.RULE_move_stmt; 11806 } 11807 MOVE() {
11808 return this.getToken(ZomicParser.MOVE, 0); 11809 } 11810 enterRule(listener) { 11811 if (listener instanceof ZomicParserListener) { 11812 listener.enterMove_stmt(this); 11813 } 11814 } 11815 exitRule(listener) { 11816 if (listener instanceof ZomicParserListener) { 11817 listener.exitMove_stmt(this); 11818 } 11819 } 11820}; 11821var Rotate_stmtContext = class extends M.ParserRuleContext { 11822 constructor(parser, parent, invokingState) { 11823 if (parent === void 0) { 11824 parent = null; 11825 } 11826 if (invokingState === void 0 || invokingState === null) { 11827 invokingState = -1; 11828 } 11829 super(parent, invokingState); 11830 this.parser = parser; 11831 this.ruleIndex = ZomicParser.RULE_rotate_stmt; 11832 this.steps = null; 11833 } 11834 ROTATE() { 11835 return this.getToken(ZomicParser.ROTATE, 0); 11836 } 11837 AROUND() { 11838 return this.getToken(ZomicParser.AROUND, 0); 11839 } 11840 axis_expr() { 11841 return this.getTypedRuleContext(Axis_exprContext, 0); 11842 } 11843 INT() { 11844 return this.getToken(ZomicParser.INT, 0); 11845 } 11846 enterRule(listener) { 11847 if (listener instanceof ZomicParserListener) { 11848 listener.enterRotate_stmt(this); 11849 } 11850 } 11851 exitRule(listener) { 11852 if (listener instanceof ZomicParserListener) { 11853 listener.exitRotate_stmt(this); 11854 } 11855 } 11856}; 11857var Reflect_stmtContext = class extends M.ParserRuleContext { 11858 constructor(parser, parent, invokingState) { 11859 if (parent === void 0) { 11860 parent = null; 11861 } 11862 if (invokingState === void 0 || invokingState === null) { 11863 invokingState = -1; 11864 } 11865 super(parent, invokingState); 11866 this.parser = parser; 11867 this.ruleIndex = ZomicParser.RULE_reflect_stmt; 11868 } 11869 REFLECT() { 11870 return this.getToken(ZomicParser.REFLECT, 0); 11871 } 11872 symmetry_center_expr() { 11873 return this.getTypedRuleContext(Symmetry_center_exprContext, 0); 11874 } 11875 enterRule(listener) { 11876 if (listener instanceof ZomicParserListener) { 11877 listener.enterReflect_stmt(this); 11878 } 11879 } 11880 exitRule(listener) { 11881 if (listener instanceof ZomicParserListener) { 11882 listener.exitReflect_stmt(this); 11883 } 11884 } 11885}; 11886var From_stmtContext = class extends M.ParserRuleContext { 11887 constructor(parser, parent, invokingState) { 11888 if (parent === void 0) { 11889 parent = null; 11890 } 11891 if (invokingState === void 0 || invokingState === null) { 11892 invokingState = -1; 11893 } 11894 super(parent, invokingState); 11895 this.parser = parser; 11896 this.ruleIndex = ZomicParser.RULE_from_stmt; 11897 } 11898 FROM() { 11899 return this.getToken(ZomicParser.FROM, 0); 11900 } 11901 stmt() { 11902 return this.getTypedRuleContext(StmtContext, 0); 11903 } 11904 enterRule(listener) { 11905 if (listener instanceof ZomicParserListener) { 11906 listener.enterFrom_stmt(this); 11907 } 11908 } 11909 exitRule(listener) { 11910 if (listener instanceof ZomicParserListener) { 11911 listener.exitFrom_stmt(this); 11912 } 11913 } 11914}; 11915var Symmetry_stmtContext = class extends M.ParserRuleContext { 11916 constructor(parser, parent, invokingState) { 11917 if (parent === void 0) { 11918 parent = null; 11919 } 11920 if (invokingState === void 0 || invokingState === null) { 11921 invokingState = -1; 11922 } 11923 super(parent, invokingState); 11924 this.parser = parser; 11925 this.ruleIndex = ZomicParser.RULE_symmetry_stmt; 11926 } 11927 SYMMETRY() { 11928 return this.getToken(ZomicParser.SYMMETRY, 0); 11929 } 11930 stmt() { 11931 return this.getTypedRuleContext(StmtContext, 0); 11932 } 11933 AROUND() { 11934 return this.getToken(ZomicParser.AROUND, 0); 11935 } 11936 axis_expr() { 11937 return this.getTypedRuleContext(Axis_exprContext, 0); 11938 } 11939 symmetry_center_expr() { 11940 return this.getTypedRuleContext(Symmetry_center_exprContext, 0); 11941 } 11942 enterRule(listener) { 11943 if (listener instanceof ZomicParserListener) { 11944 listener.enterSymmetry_stmt(this); 11945 } 11946 } 11947 exitRule(listener) { 11948 if (listener instanceof ZomicParserListener) { 11949 listener.exitSymmetry_stmt(this); 11950 } 11951 } 11952}; 11953var Repeat_stmtContext = class extends M.ParserRuleContext { 11954 constructor(parser, parent, invokingState) { 11955 if (parent === void 0) { 11956 parent = null; 11957 } 11958 if (invokingState === void 0 || invokingState === null) { 11959 invokingState = -1; 11960 } 11961 super(parent, invokingState); 11962 this.parser = parser; 11963 this.ruleIndex = ZomicParser.RULE_repeat_stmt; 11964 this.count = null; 11965 } 11966 REPEAT() {
11967 return this.getToken(ZomicParser.REPEAT, 0); 11968 } 11969 stmt() { 11970 return this.getTypedRuleContext(StmtContext, 0); 11971 } 11972 INT() { 11973 return this.getToken(ZomicParser.INT, 0); 11974 } 11975 enterRule(listener) { 11976 if (listener instanceof ZomicParserListener) { 11977 listener.enterRepeat_stmt(this); 11978 } 11979 } 11980 exitRule(listener) { 11981 if (listener instanceof ZomicParserListener) { 11982 listener.exitRepeat_stmt(this); 11983 } 11984 } 11985}; 11986var Branch_stmtContext = class extends M.ParserRuleContext { 11987 constructor(parser, parent, invokingState) { 11988 if (parent === void 0) { 11989 parent = null; 11990 } 11991 if (invokingState === void 0 || invokingState === null) { 11992 invokingState = -1; 11993 } 11994 super(parent, invokingState); 11995 this.parser = parser; 11996 this.ruleIndex = ZomicParser.RULE_branch_stmt; 11997 } 11998 BRANCH() { 11999 return this.getToken(ZomicParser.BRANCH, 0); 12000 } 12001 stmt() { 12002 return this.getTypedRuleContext(StmtContext, 0); 12003 } 12004 enterRule(listener) { 12005 if (listener instanceof ZomicParserListener) { 12006 listener.enterBranch_stmt(this); 12007 } 12008 } 12009 exitRule(listener) { 12010 if (listener instanceof ZomicParserListener) { 12011 listener.exitBranch_stmt(this); 12012 } 12013 } 12014}; 12015var Save_stmtContext = class extends M.ParserRuleContext { 12016 constructor(parser, parent, invokingState) { 12017 if (parent === void 0) { 12018 parent = null; 12019 } 12020 if (invokingState === void 0 || invokingState === null) { 12021 invokingState = -1; 12022 } 12023 super(parent, invokingState); 12024 this.parser = parser; 12025 this.ruleIndex = ZomicParser.RULE_save_stmt; 12026 this.state = null; 12027 } 12028 SAVE() { 12029 return this.getToken(ZomicParser.SAVE, 0); 12030 } 12031 stmt() { 12032 return this.getTypedRuleContext(StmtContext, 0); 12033 } 12034 LOCATION() { 12035 return this.getToken(ZomicParser.LOCATION, 0); 12036 } 12037 SCALE() { 12038 return this.getToken(ZomicParser.SCALE, 0); 12039 } 12040 ORIENTATION() { 12041 return this.getToken(ZomicParser.ORIENTATION, 0); 12042 } 12043 BUILD() { 12044 return this.getToken(ZomicParser.BUILD, 0); 12045 } 12046 ALL() { 12047 return this.getToken(ZomicParser.ALL, 0); 12048 } 12049 enterRule(listener) { 12050 if (listener instanceof ZomicParserListener) { 12051 listener.enterSave_stmt(this); 12052 } 12053 } 12054 exitRule(listener) { 12055 if (listener instanceof ZomicParserListener) { 12056 listener.exitSave_stmt(this); 12057 } 12058 } 12059}; 12060var Strut_length_exprContext = class extends M.ParserRuleContext { 12061 constructor(parser, parent, invokingState) { 12062 if (parent === void 0) { 12063 parent = null; 12064 } 12065 if (invokingState === void 0 || invokingState === null) { 12066 invokingState = -1; 12067 } 12068 super(parent, invokingState); 12069 this.parser = parser; 12070 this.ruleIndex = ZomicParser.RULE_strut_length_expr; 12071 } 12072 size_expr() { 12073 return this.getTypedRuleContext(Size_exprContext, 0); 12074 } 12075 algebraic_number_expr() { 12076 return this.getTypedRuleContext(Algebraic_number_exprContext, 0); 12077 } 12078 HALF() { 12079 return this.getToken(ZomicParser.HALF, 0); 12080 } 12081 enterRule(listener) { 12082 if (listener instanceof ZomicParserListener) { 12083 listener.enterStrut_length_expr(this); 12084 } 12085 } 12086 exitRule(listener) { 12087 if (listener instanceof ZomicParserListener) { 12088 listener.exitStrut_length_expr(this); 12089 } 12090 } 12091}; 12092var Size_exprContext = class extends M.ParserRuleContext { 12093 constructor(parser, parent, invokingState) { 12094 if (parent === void 0) { 12095 parent = null; 12096 } 12097 if (invokingState === void 0 || invokingState === null) { 12098 invokingState = -1; 12099 } 12100 super(parent, invokingState); 12101 this.parser = parser; 12102 this.ruleIndex = ZomicParser.RULE_size_expr; 12103 } 12104 explicit_size_expr() { 12105 return this.getTypedRuleContext(Explicit_size_exprContext, 0); 12106 } 12107 named_size_expr() { 12108 return this.getTypedRuleContext(Named_size_exprContext, 0); 12109 } 12110 enterRule(listener) { 12111 if (listener instanceof ZomicParserListener) { 12112 listener.enterSize_expr(this); 12113 } 12114 } 12115 exitRule(listener) { 12116 if (listener instanceof ZomicParserListener) { 12117 listener.exitSize_expr(this); 12118 } 12119 } 12120}; 12121var Algebraic_number_exprContext = class extends M.ParserRuleContext { 12122 constructor(parser, parent, invokingState) { 12123 if (parent === void 0) { 12124 parent = null; 12125 } 12126 if (invokingState === void 0 || invokingState === null) { 12127 invokingState = -1; 12128 } 12129 super(parent, invokingState); 12130 this.parser = parser; 12131 this.ruleIndex = ZomicParser.RULE_algebraic_number_expr; 12132 this.ones = null; 12133 this.phis = null; 12134 } 12135 INT = function(i2) { 12136 if (i2 === void 0) { 12137 i2 = null; 12138 } 12139 if (i2 === null) { 12140 return this.getTokens(ZomicParser.INT); 12141 } else {
12142 return this.getToken(ZomicParser.INT, i2); 12143 } 12144 }; 12145 enterRule(listener) { 12146 if (listener instanceof ZomicParserListener) { 12147 listener.enterAlgebraic_number_expr(this); 12148 } 12149 } 12150 exitRule(listener) { 12151 if (listener instanceof ZomicParserListener) { 12152 listener.exitAlgebraic_number_expr(this); 12153 } 12154 } 12155}; 12156var Explicit_size_exprContext = class extends M.ParserRuleContext { 12157 constructor(parser, parent, invokingState) { 12158 if (parent === void 0) { 12159 parent = null; 12160 } 12161 if (invokingState === void 0 || invokingState === null) { 12162 invokingState = -1; 12163 } 12164 super(parent, invokingState); 12165 this.parser = parser; 12166 this.ruleIndex = ZomicParser.RULE_explicit_size_expr; 12167 this.scale = null; 12168 this.isVariableLength = null; 12169 } 12170 SIZE() { 12171 return this.getToken(ZomicParser.SIZE, 0); 12172 } 12173 INT() { 12174 return this.getToken(ZomicParser.INT, 0); 12175 } 12176 QUESTIONMARK() { 12177 return this.getToken(ZomicParser.QUESTIONMARK, 0); 12178 } 12179 enterRule(listener) { 12180 if (listener instanceof ZomicParserListener) { 12181 listener.enterExplicit_size_expr(this); 12182 } 12183 } 12184 exitRule(listener) { 12185 if (listener instanceof ZomicParserListener) { 12186 listener.exitExplicit_size_expr(this); 12187 } 12188 } 12189}; 12190var Named_size_exprContext = class extends M.ParserRuleContext { 12191 constructor(parser, parent, invokingState) { 12192 if (parent === void 0) { 12193 parent = null; 12194 } 12195 if (invokingState === void 0 || invokingState === null) { 12196 invokingState = -1; 12197 } 12198 super(parent, invokingState); 12199 this.parser = parser; 12200 this.ruleIndex = ZomicParser.RULE_named_size_expr; 12201 } 12202 copyFrom(ctx) { 12203 super.copyFrom(ctx); 12204 } 12205}; 12206var SizeShortContext = class extends Named_size_exprContext { 12207 constructor(parser, ctx) { 12208 super(parser); 12209 super.copyFrom(ctx); 12210 } 12211 SHORT() { 12212 return this.getToken(ZomicParser.SHORT, 0); 12213 } 12214 enterRule(listener) { 12215 if (listener instanceof ZomicParserListener) { 12216 listener.enterSizeShort(this); 12217 } 12218 } 12219 exitRule(listener) { 12220 if (listener instanceof ZomicParserListener) { 12221 listener.exitSizeShort(this); 12222 } 12223 } 12224}; 12225ZomicParser.SizeShortContext = SizeShortContext; 12226var SizeLongContext = class extends Named_size_exprContext { 12227 constructor(parser, ctx) { 12228 super(parser); 12229 super.copyFrom(ctx); 12230 } 12231 LONG() { 12232 return this.getToken(ZomicParser.LONG, 0); 12233 } 12234 enterRule(listener) { 12235 if (listener instanceof ZomicParserListener) { 12236 listener.enterSizeLong(this); 12237 } 12238 } 12239 exitRule(listener) { 12240 if (listener instanceof ZomicParserListener) { 12241 listener.exitSizeLong(this); 12242 } 12243 } 12244}; 12245ZomicParser.SizeLongContext = SizeLongContext; 12246var SizeMediumContext = class extends Named_size_exprContext { 12247 constructor(parser, ctx) { 12248 super(parser); 12249 super.copyFrom(ctx); 12250 } 12251 MEDIUM() { 12252 return this.getToken(ZomicParser.MEDIUM, 0); 12253 } 12254 enterRule(listener) { 12255 if (listener instanceof ZomicParserListener) { 12256 listener.enterSizeMedium(this); 12257 } 12258 } 12259 exitRule(listener) { 12260 if (listener instanceof ZomicParserListener) { 12261 listener.exitSizeMedium(this); 12262 } 12263 } 12264}; 12265ZomicParser.SizeMediumContext = SizeMediumContext; 12266var Symmetry_center_exprContext = class extends M.ParserRuleContext { 12267 constructor(parser, parent, invokingState) { 12268 if (parent === void 0) { 12269 parent = null; 12270 } 12271 if (invokingState === void 0 || invokingState === null) { 12272 invokingState = -1; 12273 } 12274 super(parent, invokingState); 12275 this.parser = parser; 12276 this.ruleIndex = ZomicParser.RULE_symmetry_center_expr; 12277 this.blueAxisIndexNumber = null; 12278 } 12279 THROUGH() { 12280 return this.getToken(ZomicParser.THROUGH, 0); 12281 } 12282 CENTER() { 12283 return this.getToken(ZomicParser.CENTER, 0); 12284 } 12285 INT() { 12286 return this.getToken(ZomicParser.INT, 0); 12287 } 12288 blue_alias_expr() { 12289 return this.getTypedRuleContext(Blue_alias_exprContext, 0); 12290 } 12291 enterRule(listener) { 12292 if (listener instanceof ZomicParserListener) { 12293 listener.enterSymmetry_center_expr(this); 12294 } 12295 } 12296 exitRule(listener) { 12297 if (listener instanceof ZomicParserListener) { 12298 listener.exitSymmetry_center_expr(this); 12299 } 12300 } 12301}; 12302var Axis_exprContext = class extends M.ParserRuleContext { 12303 constructor(parser, parent, invokingState) { 12304 if (parent === void 0) { 12305 parent = null; 12306 } 12307 if (invokingState === void 0 || invokingState === null) { 12308 invokingState = -1; 12309 } 12310 super(parent, invokingState); 12311 this.parser = parser; 12312 this.ruleIndex = ZomicParser.RULE_axis_expr; 12313 this.index = null; 12314 } 12315 axis_name_expr() { 12316 return this.getTypedRuleContext(Axis_name_exprContext, 0); 12317 } 12318 axis_index_expr() { 12319 return this.getTypedRuleContext(Axis_index_exprContext, 0); 12320 } 12321 enterRule(listener) { 12322 if (listener instanceof ZomicParserListener) { 12323 listener.enterAxis_expr(this); 12324 } 12325 } 12326 exitRule(listener) { 12327 if (listener instanceof ZomicParserListener) { 12328 listener.exitAxis_expr(this); 12329 } 12330 } 12331}; 12332var Axis_index_exprContext = class extends M.ParserRuleContext { 12333 constructor(parser, parent, invokingState) { 12334 if (parent === void 0) { 12335 parent = null; 12336 } 12337 if (invokingState === void 0 || invokingState === null) { 12338 invokingState = -1; 12339 } 12340 super(parent, invokingState); 12341 this.parser = parser; 12342 this.ruleIndex = ZomicParser.RULE_axis_index_expr; 12343 this.indexNumber = null; 12344 this.handedness = null; 12345 } 12346 INT() {
12347 return this.getToken(ZomicParser.INT, 0); 12348 } 12349 POLARITY() { 12350 return this.getToken(ZomicParser.POLARITY, 0); 12351 } 12352 enterRule(listener) { 12353 if (listener instanceof ZomicParserListener) { 12354 listener.enterAxis_index_expr(this); 12355 } 12356 } 12357 exitRule(listener) { 12358 if (listener instanceof ZomicParserListener) { 12359 listener.exitAxis_index_expr(this); 12360 } 12361 } 12362}; 12363var Axis_name_exprContext = class extends M.ParserRuleContext { 12364 constructor(parser, parent, invokingState) { 12365 if (parent === void 0) { 12366 parent = null; 12367 } 12368 if (invokingState === void 0 || invokingState === null) { 12369 invokingState = -1; 12370 } 12371 super(parent, invokingState); 12372 this.parser = parser; 12373 this.ruleIndex = ZomicParser.RULE_axis_name_expr; 12374 } 12375 red_alias_expr() { 12376 return this.getTypedRuleContext(Red_alias_exprContext, 0); 12377 } 12378 blue_alias_expr() { 12379 return this.getTypedRuleContext(Blue_alias_exprContext, 0); 12380 } 12381 yellow_alias_expr() { 12382 return this.getTypedRuleContext(Yellow_alias_exprContext, 0); 12383 } 12384 green() { 12385 return this.getTypedRuleContext(GreenContext, 0); 12386 } 12387 orange() { 12388 return this.getTypedRuleContext(OrangeContext, 0); 12389 } 12390 purple() { 12391 return this.getTypedRuleContext(PurpleContext, 0); 12392 } 12393 black() { 12394 return this.getTypedRuleContext(BlackContext, 0); 12395 } 12396 enterRule(listener) { 12397 if (listener instanceof ZomicParserListener) { 12398 listener.enterAxis_name_expr(this); 12399 } 12400 } 12401 exitRule(listener) { 12402 if (listener instanceof ZomicParserListener) { 12403 listener.exitAxis_name_expr(this); 12404 } 12405 } 12406}; 12407var Red_alias_exprContext = class extends M.ParserRuleContext { 12408 constructor(parser, parent, invokingState) { 12409 if (parent === void 0) { 12410 parent = null; 12411 } 12412 if (invokingState === void 0 || invokingState === null) { 12413 invokingState = -1; 12414 } 12415 super(parent, invokingState); 12416 this.parser = parser; 12417 this.ruleIndex = ZomicParser.RULE_red_alias_expr; 12418 } 12419 copyFrom(ctx) { 12420 super.copyFrom(ctx); 12421 } 12422}; 12423var RedContext = class extends Red_alias_exprContext { 12424 constructor(parser, ctx) { 12425 super(parser); 12426 super.copyFrom(ctx); 12427 } 12428 RED() { 12429 return this.getToken(ZomicParser.RED, 0); 12430 } 12431 PENT() { 12432 return this.getToken(ZomicParser.PENT, 0); 12433 } 12434 PENTAGON() { 12435 return this.getToken(ZomicParser.PENTAGON, 0); 12436 } 12437 enterRule(listener) { 12438 if (listener instanceof ZomicParserListener) { 12439 listener.enterRed(this); 12440 } 12441 } 12442 exitRule(listener) { 12443 if (listener instanceof ZomicParserListener) { 12444 listener.exitRed(this); 12445 } 12446 } 12447}; 12448ZomicParser.RedContext = RedContext; 12449var Blue_alias_exprContext = class extends M.ParserRuleContext { 12450 constructor(parser, parent, invokingState) { 12451 if (parent === void 0) { 12452 parent = null; 12453 } 12454 if (invokingState === void 0 || invokingState === null) { 12455 invokingState = -1; 12456 } 12457 super(parent, invokingState); 12458 this.parser = parser; 12459 this.ruleIndex = ZomicParser.RULE_blue_alias_expr; 12460 } 12461 copyFrom(ctx) { 12462 super.copyFrom(ctx); 12463 } 12464}; 12465var BlueContext = class extends Blue_alias_exprContext { 12466 constructor(parser, ctx) { 12467 super(parser); 12468 super.copyFrom(ctx); 12469 } 12470 BLUE() { 12471 return this.getToken(ZomicParser.BLUE, 0); 12472 } 12473 RECT() { 12474 return this.getToken(ZomicParser.RECT, 0); 12475 } 12476 RECTANGLE() { 12477 return this.getToken(ZomicParser.RECTANGLE, 0); 12478 } 12479 enterRule(listener) { 12480 if (listener instanceof ZomicParserListener) { 12481 listener.enterBlue(this); 12482 } 12483 } 12484 exitRule(listener) { 12485 if (listener instanceof ZomicParserListener) { 12486 listener.exitBlue(this); 12487 } 12488 } 12489}; 12490ZomicParser.BlueContext = BlueContext; 12491var Yellow_alias_exprContext = class extends M.ParserRuleContext { 12492 constructor(parser, parent, invokingState) { 12493 if (parent === void 0) { 12494 parent = null; 12495 } 12496 if (invokingState === void 0 || invokingState === null) { 12497 invokingState = -1; 12498 } 12499 super(parent, invokingState); 12500 this.parser = parser; 12501 this.ruleIndex = ZomicParser.RULE_yellow_alias_expr; 12502 } 12503 copyFrom(ctx) { 12504 super.copyFrom(ctx); 12505 } 12506}; 12507var YellowContext = class extends Yellow_alias_exprContext { 12508 constructor(parser, ctx) { 12509 super(parser); 12510 super.copyFrom(ctx); 12511 } 12512 YELLOW() {
12513 return this.getToken(ZomicParser.YELLOW, 0); 12514 } 12515 TRI() { 12516 return this.getToken(ZomicParser.TRI, 0); 12517 } 12518 TRIANGLE() { 12519 return this.getToken(ZomicParser.TRIANGLE, 0); 12520 } 12521 enterRule(listener) { 12522 if (listener instanceof ZomicParserListener) { 12523 listener.enterYellow(this); 12524 } 12525 } 12526 exitRule(listener) { 12527 if (listener instanceof ZomicParserListener) { 12528 listener.exitYellow(this); 12529 } 12530 } 12531}; 12532ZomicParser.YellowContext = YellowContext; 12533var GreenContext = class extends M.ParserRuleContext { 12534 constructor(parser, parent, invokingState) { 12535 if (parent === void 0) { 12536 parent = null; 12537 } 12538 if (invokingState === void 0 || invokingState === null) { 12539 invokingState = -1; 12540 } 12541 super(parent, invokingState); 12542 this.parser = parser; 12543 this.ruleIndex = ZomicParser.RULE_green; 12544 } 12545 GREEN() { 12546 return this.getToken(ZomicParser.GREEN, 0); 12547 } 12548 enterRule(listener) { 12549 if (listener instanceof ZomicParserListener) { 12550 listener.enterGreen(this); 12551 } 12552 } 12553 exitRule(listener) { 12554 if (listener instanceof ZomicParserListener) { 12555 listener.exitGreen(this); 12556 } 12557 } 12558}; 12559var OrangeContext = class extends M.ParserRuleContext { 12560 constructor(parser, parent, invokingState) { 12561 if (parent === void 0) { 12562 parent = null; 12563 } 12564 if (invokingState === void 0 || invokingState === null) { 12565 invokingState = -1; 12566 } 12567 super(parent, invokingState); 12568 this.parser = parser; 12569 this.ruleIndex = ZomicParser.RULE_orange; 12570 } 12571 ORANGE() { 12572 return this.getToken(ZomicParser.ORANGE, 0); 12573 } 12574 enterRule(listener) { 12575 if (listener instanceof ZomicParserListener) { 12576 listener.enterOrange(this); 12577 } 12578 } 12579 exitRule(listener) { 12580 if (listener instanceof ZomicParserListener) { 12581 listener.exitOrange(this); 12582 } 12583 } 12584}; 12585var PurpleContext = class extends M.ParserRuleContext { 12586 constructor(parser, parent, invokingState) { 12587 if (parent === void 0) { 12588 parent = null; 12589 } 12590 if (invokingState === void 0 || invokingState === null) { 12591 invokingState = -1; 12592 } 12593 super(parent, invokingState); 12594 this.parser = parser; 12595 this.ruleIndex = ZomicParser.RULE_purple; 12596 } 12597 PURPLE() { 12598 return this.getToken(ZomicParser.PURPLE, 0); 12599 } 12600 enterRule(listener) { 12601 if (listener instanceof ZomicParserListener) { 12602 listener.enterPurple(this); 12603 } 12604 } 12605 exitRule(listener) { 12606 if (listener instanceof ZomicParserListener) { 12607 listener.exitPurple(this); 12608 } 12609 } 12610}; 12611var BlackContext = class extends M.ParserRuleContext { 12612 constructor(parser, parent, invokingState) { 12613 if (parent === void 0) { 12614 parent = null; 12615 } 12616 if (invokingState === void 0 || invokingState === null) { 12617 invokingState = -1; 12618 } 12619 super(parent, invokingState); 12620 this.parser = parser; 12621 this.ruleIndex = ZomicParser.RULE_black; 12622 } 12623 BLACK() { 12624 return this.getToken(ZomicParser.BLACK, 0); 12625 } 12626 enterRule(listener) { 12627 if (listener instanceof ZomicParserListener) { 12628 listener.enterBlack(this); 12629 } 12630 } 12631 exitRule(listener) { 12632 if (listener instanceof ZomicParserListener) { 12633 listener.exitBlack(this); 12634 } 12635 } 12636}; 12637ZomicParser.ProgramContext = ProgramContext; 12638ZomicParser.StmtContext = StmtContext; 12639ZomicParser.Compound_stmtContext = Compound_stmtContext; 12640ZomicParser.DirectCommandContext = DirectCommandContext; 12641ZomicParser.NestedCommandContext = NestedCommandContext; 12642ZomicParser.Strut_stmtContext = Strut_stmtContext; 12643ZomicParser.Label_stmtContext = Label_stmtContext; 12644ZomicParser.Scale_stmtContext = Scale_stmtContext; 12645ZomicParser.Build_stmtContext = Build_stmtContext; 12646ZomicParser.Move_stmtContext = Move_stmtContext; 12647ZomicParser.Rotate_stmtContext = Rotate_stmtContext; 12648ZomicParser.Reflect_stmtContext = Reflect_stmtContext; 12649ZomicParser.From_stmtContext = From_stmtContext; 12650ZomicParser.Symmetry_stmtContext = Symmetry_stmtContext; 12651ZomicParser.Repeat_stmtContext = Repeat_stmtContext; 12652ZomicParser.Branch_stmtContext = Branch_stmtContext; 12653ZomicParser.Save_stmtContext = Save_stmtContext; 12654ZomicParser.Strut_length_exprContext = Strut_length_exprContext; 12655ZomicParser.Size_exprContext = Size_exprContext; 12656ZomicParser.Algebraic_number_exprContext = Algebraic_number_exprContext; 12657ZomicParser.Explicit_size_exprContext = Explicit_size_exprContext; 12658ZomicParser.Named_size_exprContext = Named_size_exprContext; 12659ZomicParser.Symmetry_center_exprContext = Symmetry_center_exprContext; 12660ZomicParser.Axis_exprContext = Axis_exprContext; 12661ZomicParser.Axis_index_exprContext = Axis_index_exprContext; 12662ZomicParser.Axis_name_exprContext = Axis_name_exprContext; 12663ZomicParser.Red_alias_exprContext = Red_alias_exprContext; 12664ZomicParser.Blue_alias_exprContext = Blue_alias_exprContext; 12665ZomicParser.Yellow_alias_exprContext = Yellow_alias_exprContext; 12666ZomicParser.GreenContext = GreenContext; 12667ZomicParser.OrangeContext = OrangeContext; 12668ZomicParser.PurpleContext = PurpleContext; 12669ZomicParser.BlackContext = BlackContext; 12670
12671// src/worker/legacy/from-java/com/vzome/core/zomic/program/Visitor.ts 12672var Visitor; 12673((Visitor2) => { 12674 class Default { 12675 /** 12676 * 12677 * @param {Walk} walk 12678 */ 12679 visitWalk(walk) { 12680 for (let index = walk.iterator(); index.hasNext(); ) { 12681 let stmt = index.next(); 12682 { 12683 stmt.accept(this); 12684 } 12685 } 12686 } 12687 /** 12688 * 12689 * @param {string} id 12690 */ 12691 visitLabel(id) { 12692 } 12693 /** 12694 * 12695 * @param {Nested} compound 12696 */ 12697 visitNested(compound) { 12698 compound.getBody().accept(this); 12699 } 12700 /** 12701 * 12702 * @param {Repeat} repeated 12703 * @param {number} repetitions 12704 */ 12705 visitRepeat(repeated, repetitions) { 12706 for (let i2 = 0; i2 < repetitions; i2++) { 12707 { 12708 this.visitNested(repeated); 12709 } 12710 ; 12711 } 12712 } 12713 /** 12714 * 12715 * @param {Axis} axis 12716 * @param {number} steps 12717 */ 12718 visitRotate(axis, steps) { 12719 } 12720 /** 12721 * 12722 * @param {Axis} blueAxis 12723 */ 12724 visitReflect(blueAxis) { 12725 } 12726 /** 12727 * 12728 * @param {Axis} axis 12729 * @param {*} length 12730 */ 12731 visitMove(axis, length) { 12732 } 12733 /** 12734 * 12735 * @param {Symmetry} model 12736 * @param {Permute} permute 12737 */ 12738 visitSymmetry(model, permute) { 12739 this.visitNested(model); 12740 } 12741 /** 12742 * 12743 * @param {Save} stmt 12744 * @param {number} state 12745 */ 12746 visitSave(stmt, state) { 12747 this.visitNested(stmt); 12748 } 12749 /** 12750 * 12751 * @param {*} size 12752 */ 12753 visitScale(size) { 12754 } 12755 /** 12756 * 12757 * @param {boolean} build 12758 * @param {boolean} destroy 12759 */ 12760 visitBuild(build, destroy) { 12761 } 12762 /** 12763 * 12764 * @param {string} message 12765 */ 12766 visitUntranslatable(message) { 12767 } 12768 constructor() { 12769 } 12770 } 12771 Visitor2.Default = Default; 12772 Default["__class"] = "com.vzome.core.zomic.program.Visitor.Default"; 12773 Default["__interfaces"] = ["com.vzome.core.zomic.program.Visitor"]; 12774})(Visitor || (Visitor = {})); 12775
12776// src/worker/legacy/from-java/com/vzome/core/zomic/Interpreter.ts 12777var Interpreter = class extends Visitor.Default { 12778 constructor(renderer, symmetry) { 12779 super(); 12780 if (this.mEvents === void 0) { 12781 this.mEvents = null; 12782 } 12783 if (this.mSymmetry === void 0) { 12784 this.mSymmetry = null; 12785 } 12786 this.mEvents = renderer; 12787 this.mSymmetry = symmetry; 12788 } 12789 /** 12790 * 12791 * @param {Axis} axis 12792 * @param {*} length 12793 */ 12794 visitMove(axis, length) { 12795 this.mEvents.step(axis, length); 12796 } 12797 /** 12798 * 12799 * @param {Axis} axis 12800 * @param {number} steps 12801 */ 12802 visitRotate(axis, steps) { 12803 this.mEvents.rotate(axis, steps); 12804 } 12805 /** 12806 * 12807 * @param {Axis} blueAxis 12808 */ 12809 visitReflect(blueAxis) { 12810 this.mEvents.reflect(blueAxis); 12811 } 12812 /** 12813 * 12814 * @param {CoreSymmetry2} model 12815 * @param {Permute} permute 12816 */ 12817 visitSymmetry(model, permute) { 12818 if (permute != null) { 12819 const repetitions = permute.getOrder(); 12820 if (repetitions === 1) throw new java.lang.RuntimeException("no rotation symmetry around extended axes"); 12821 for (let i2 = 0; i2 < repetitions; i2++) { 12822 { 12823 this.saveAndNest(model, ZomicEventHandler.ORIENTATION); 12824 permute.accept(this); 12825 } 12826 ; 12827 } 12828 } else { 12829 for (let i2 = 0; i2 < this.mSymmetry.getChiralOrder(); i2++) { 12830 { 12831 const current = this.mSymmetry.getPermutation(i2); 12832 const saved = this.mEvents; 12833 this.mEvents = this.mEvents.save(ZomicEventHandler.ALL); 12834 this.mEvents.permute(current, Symmetry.PLUS); 12835 try { 12836 this.visitNested(model); 12837 } catch (e2) { 12838 throw new java.lang.RuntimeException("error in global symmetry"); 12839 } 12840 saved.restore(this.mEvents, ZomicEventHandler.ALL); 12841 this.mEvents = saved; 12842 } 12843 ; 12844 } 12845 } 12846 } 12847 /*private*/ 12848 saveAndNest(stmt, state) { 12849 const saved = this.mEvents; 12850 this.mEvents = this.mEvents.save(state); 12851 this.visitNested(stmt); 12852 saved.restore(this.mEvents, state); 12853 this.mEvents = saved; 12854 } 12855 /** 12856 * 12857 * @param {Save} stmt 12858 * @param {number} state 12859 */ 12860 visitSave(stmt, state) { 12861 this.saveAndNest(stmt, state); 12862 } 12863 /** 12864 * 12865 * @param {*} size 12866 */ 12867 visitScale(size) { 12868 this.mEvents.scale(size); 12869 } 12870 /** 12871 * 12872 * @param {boolean} build 12873 * @param {boolean} destroy 12874 */ 12875 visitBuild(build, destroy) { 12876 let action = ZomicEventHandler.JUST_MOVE; 12877 if (build) action |= ZomicEventHandler.BUILD; 12878 if (destroy) action |= ZomicEventHandler.DESTROY; 12879 this.mEvents.action(action); 12880 } 12881}; 12882Interpreter["__class"] = "com.vzome.core.zomic.Interpreter"; 12883Interpreter["__interfaces"] = ["com.vzome.core.zomic.program.Visitor"]; 12884
12885// src/worker/legacy/from-java/com/vzome/core/math/symmetry/DirectionNaming.ts 12886var DirectionNaming = class _DirectionNaming { 12887 static SIGN_$LI$() { 12888 if (_DirectionNaming.SIGN == null) { 12889 _DirectionNaming.SIGN = ["+", "-"]; 12890 } 12891 return _DirectionNaming.SIGN; 12892 } 12893 constructor(dir, name) { 12894 if (this.mName === void 0) { 12895 this.mName = null; 12896 } 12897 if (this.mDirection === void 0) { 12898 this.mDirection = null; 12899 } 12900 this.mName = name; 12901 this.mDirection = dir; 12902 } 12903 getName$() { 12904 return this.mName; 12905 } 12906 /** 12907 * Default behavior. 12908 * @param {string} axisName 12909 * @return 12910 * @return {Axis} 12911 */ 12912 getAxis(axisName) { 12913 return this.mDirection.getAxis$int$int(this.getSign(axisName), this.getInteger(axisName)); 12914 } 12915 getSign(axisName) { 12916 if ( 12917 /* startsWith */ 12918 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(axisName, "-") 12919 ) return Symmetry.MINUS; 12920 return Symmetry.PLUS; 12921 } 12922 getInteger(axisName) { 12923 if ( 12924 /* startsWith */ 12925 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(axisName, "-") || /* startsWith */ 12926 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(axisName, "+") 12927 ) return javaemul.internal.IntegerHelper.parseInt(axisName.substring(1)); 12928 return javaemul.internal.IntegerHelper.parseInt(axisName); 12929 } 12930 getName$com_vzome_core_math_symmetry_Axis(axis) { 12931 const sign = _DirectionNaming.SIGN_$LI$()[axis.getSense()]; 12932 return sign + axis.getOrientation(); 12933 } 12934 getName(axis) { 12935 if (axis != null && axis instanceof Axis || axis === null) { 12936 return this.getName$com_vzome_core_math_symmetry_Axis(axis); 12937 } else if (axis === void 0) { 12938 return this.getName$(); 12939 } else throw new Error("invalid overload"); 12940 } 12941 getFullName(axis) { 12942 return this.mName + " " + this.getName$com_vzome_core_math_symmetry_Axis(axis); 12943 } 12944 getDirection() { 12945 return this.mDirection; 12946 } 12947}; 12948DirectionNaming["__class"] = "com.vzome.core.math.symmetry.DirectionNaming"; 12949
12950// src/worker/legacy/from-java/com/vzome/core/math/symmetry/NamingConvention.ts 12951var NamingConvention = class _NamingConvention { 12952 static { 12953 this.UNKNOWN_AXIS = "UNKNOWN AXIS"; 12954 } 12955 addDirectionNaming(naming) { 12956 this.mNamings.put(naming.getName$(), naming); 12957 } 12958 getAxis(color, name) { 12959 const naming = this.mNamings.get(color); 12960 if (naming == null) return null; 12961 return naming.getAxis(name); 12962 } 12963 getName(axis) { 12964 for (let index = this.mNamings.values().iterator(); index.hasNext(); ) { 12965 let naming = index.next(); 12966 { 12967 if (naming.getDirection().equals(axis.getDirection())) return naming.getName$com_vzome_core_math_symmetry_Axis(axis); 12968 } 12969 } 12970 return _NamingConvention.UNKNOWN_AXIS; 12971 } 12972 constructor() { 12973 this.mNamings = new java.util.HashMap(); 12974 } 12975}; 12976NamingConvention["__class"] = "com.vzome.core.math.symmetry.NamingConvention"; 12977
12978// src/worker/legacy/from-java/com/vzome/core/zomic/BlackDirectionNaming.ts 12979var BlackDirectionNaming = class extends DirectionNaming { 12980 constructor(dir, reds, yellows) { 12981 super(dir, dir.getName()); 12982 if (this.mMap === void 0) { 12983 this.mMap = null; 12984 } 12985 if (this.mRedNames === void 0) { 12986 this.mRedNames = null; 12987 } 12988 if (this.mYellowNames === void 0) { 12989 this.mYellowNames = null; 12990 } 12991 this.mRedNames = reds; 12992 this.mYellowNames = yellows; 12993 this.mMap = (function(dims) { 12994 let allocate = function(dims2) { 12995 if (dims2.length === 0) { 12996 return null; 12997 } else { 12998 let array = []; 12999 for (let i2 = 0; i2 < dims2[0]; i2++) { 13000 array.push(allocate(dims2.slice(1))); 13001 } 13002 return array; 13003 } 13004 }; 13005 return allocate(dims); 13006 })([2, dir.getSymmetry().getChiralOrder()]); 13007 for (let sense = Symmetry.PLUS; sense <= Symmetry.MINUS; sense++) { 13008 for (let i2 = 0; i2 < this.mMap[Symmetry.PLUS].length; i2++) { 13009 { 13010 const axis = dir.getAxis$int$int(sense, i2); 13011 const ry = this.getName$com_vzome_core_math_symmetry_Axis(axis); 13012 if (this.getSign(ry) === Symmetry.MINUS) continue; 13013 const minused = ( 13014 /* endsWith */ 13015 ((str, searchString) => { 13016 let pos = str.length - searchString.length; 13017 let lastIndex = str.indexOf(searchString, pos); 13018 return lastIndex !== -1 && lastIndex === pos; 13019 })(ry, "-") 13020 ); 13021 const index = this.getInteger(ry); 13022 const sign = minused ? Symmetry.MINUS : Symmetry.PLUS; 13023 this.mMap[sign][index] = axis; 13024 } 13025 ; 13026 } 13027 ; 13028 } 13029 } 13030 /** 13031 * 13032 * @param {string} axisName 13033 * @return {number} 13034 */ 13035 getInteger(axisName) { 13036 if ( 13037 /* endsWith */ 13038 ((str, searchString) => { 13039 let pos = str.length - searchString.length; 13040 let lastIndex = str.indexOf(searchString, pos); 13041 return lastIndex !== -1 && lastIndex === pos; 13042 })(axisName, "-") || /* endsWith */ 13043 ((str, searchString) => { 13044 let pos = str.length - searchString.length; 13045 let lastIndex = str.indexOf(searchString, pos); 13046 return lastIndex !== -1 && lastIndex === pos; 13047 })(axisName, "+") 13048 ) axisName = axisName.substring(0, axisName.length - 1); 13049 if ( 13050 /* startsWith */ 13051 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(axisName, "-") || /* startsWith */ 13052 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(axisName, "+") 13053 ) return javaemul.internal.IntegerHelper.parseInt(axisName.substring(1)); 13054 return javaemul.internal.IntegerHelper.parseInt(axisName); 13055 } 13056 /** 13057 * 13058 * @param {string} axisName 13059 * @return {Axis} 13060 */ 13061 getAxis(axisName) { 13062 const minused = ( 13063 /* endsWith */ 13064 ((str, searchString) => { 13065 let pos = str.length - searchString.length; 13066 let lastIndex = str.indexOf(searchString, pos); 13067 return lastIndex !== -1 && lastIndex === pos; 13068 })(axisName, "-") 13069 ); 13070 const sense = this.getSign(axisName); 13071 const ry = this.getInteger(axisName); 13072 let axis = this.mMap[minused ? Symmetry.MINUS : Symmetry.PLUS][ry]; 13073 if (sense === Symmetry.MINUS) axis = this.getDirection().getAxis$int$int((axis.getSense() + 1) % 2, axis.getOrientation()); 13074 return axis; 13075 } 13076 getName$com_vzome_core_math_symmetry_Axis(axis) { 13077 let orn = axis.getOrientation(); 13078 const redNeighbor = this.mRedNames.getDirection().getAxis$int$int(axis.getSense(), orn); 13079 const redName = this.mRedNames.getName$com_vzome_core_math_symmetry_Axis(redNeighbor); 13080 let rot = redNeighbor.getRotationPermutation(); 13081 if (axis.getSense() === Symmetry.MINUS) rot = rot.inverse(); 13082 orn = rot.mapIndex(orn); 13083 const redSign = this.getSign(redName); 13084 const yellowNeighbor = this.mYellowNames.getDirection().getAxis$int$int(redSign, orn); 13085 let yellowName = this.mYellowNames.getName$com_vzome_core_math_symmetry_Axis(yellowNeighbor).substring(1); 13086 if (axis.getSense() === redSign) yellowName += "-"; 13087 return redName + yellowName; 13088 } 13089 /** 13090 * 13091 * @param {Axis} axis 13092 * @return {string} 13093 */ 13094 getName(axis) { 13095 if (axis != null && axis instanceof Axis || axis === null) { 13096 return this.getName$com_vzome_core_math_symmetry_Axis(axis); 13097 } else if (axis === void 0) { 13098 return this.getName$(); 13099 } else throw new Error("invalid overload"); 13100 } 13101}; 13102BlackDirectionNaming["__class"] = "com.vzome.core.zomic.BlackDirectionNaming"; 13103
13104// src/worker/legacy/from-java/com/vzome/core/zomic/GreenDirectionNaming.ts 13105var GreenDirectionNaming = class extends DirectionNaming { 13106 constructor(dir, reds, yellows) { 13107 super(dir, dir.getName()); 13108 if (this.mMap === void 0) { 13109 this.mMap = null; 13110 } 13111 if (this.mRedNames === void 0) { 13112 this.mRedNames = null; 13113 } 13114 if (this.mYellowNames === void 0) { 13115 this.mYellowNames = null; 13116 } 13117 this.mRedNames = reds; 13118 this.mYellowNames = yellows; 13119 this.mMap = ((s2) => { 13120 let a2 = []; 13121 while (s2-- > 0) a2.push(null); 13122 return a2; 13123 })(dir.getSymmetry().getChiralOrder()); 13124 for (let i2 = 0; i2 < this.mMap.length; i2++) { 13125 { 13126 let axis = dir.getAxis$int$int(Symmetry.PLUS, i2); 13127 const ry = this.getName$com_vzome_core_math_symmetry_Axis(axis); 13128 const sense = this.getSign(ry); 13129 const index = this.getInteger(ry); 13130 if (sense === Symmetry.MINUS) axis = dir.getAxis$int$int(sense, i2); 13131 this.mMap[index] = axis; 13132 } 13133 ; 13134 } 13135 } 13136 /** 13137 * 13138 * @param {string} axisName 13139 * @return {Axis} 13140 */ 13141 getAxis(axisName) { 13142 const sense = this.getSign(axisName); 13143 const ry = this.getInteger(axisName); 13144 let axis = this.mMap[ry]; 13145 if (sense === Symmetry.MINUS) axis = this.getDirection().getAxis$int$int(sense, axis.getOrientation()); 13146 return axis; 13147 } 13148 getName$com_vzome_core_math_symmetry_Axis(axis) { 13149 const redNeighbor = this.mRedNames.getDirection().getAxis$int$int(axis.getSense(), axis.getOrientation()); 13150 const redName = this.mRedNames.getName$com_vzome_core_math_symmetry_Axis(redNeighbor); 13151 const yellowNeighbor = this.mYellowNames.getDirection().getAxis$int$int(axis.getSense(), axis.getOrientation()); 13152 const yellowName = this.mYellowNames.getName$com_vzome_core_math_symmetry_Axis(yellowNeighbor).substring(1); 13153 return redName + yellowName; 13154 } 13155 /** 13156 * 13157 * @param {Axis} axis 13158 * @return {string} 13159 */ 13160 getName(axis) { 13161 if (axis != null && axis instanceof Axis || axis === null) { 13162 return this.getName$com_vzome_core_math_symmetry_Axis(axis); 13163 } else if (axis === void 0) { 13164 return this.getName$(); 13165 } else throw new Error("invalid overload"); 13166 } 13167}; 13168GreenDirectionNaming["__class"] = "com.vzome.core.zomic.GreenDirectionNaming"; 13169
13170// src/worker/legacy/from-java/com/vzome/core/zomic/ZomodDirectionNaming.ts 13171var ZomodDirectionNaming = class extends DirectionNaming { 13172 constructor(dir, mapping) { 13173 super(dir, dir.getName()); 13174 if (this.mMapping === void 0) { 13175 this.mMapping = null; 13176 } 13177 this.mBackMap = new java.util.HashMap(); 13178 this.mMapping = mapping; 13179 for (let i2 = 0; i2 < this.mMapping.length; i2++) { 13180 { 13181 let axis = dir.getAxis$int$int(Symmetry.PLUS, this.mMapping[i2]); 13182 this.mBackMap.put(axis, "+" + i2); 13183 axis = dir.getAxis$int$int(Symmetry.MINUS, this.mMapping[i2]); 13184 this.mBackMap.put(axis, "-" + i2); 13185 } 13186 ; 13187 } 13188 } 13189 /** 13190 * 13191 * @param {string} axisName 13192 * @return {Axis} 13193 */ 13194 getAxis(axisName) { 13195 const sense = this.getSign(axisName); 13196 const index = this.getInteger(axisName); 13197 return this.getDirection().getAxis$int$int(sense, this.mMapping[index]); 13198 } 13199 getName$com_vzome_core_math_symmetry_Axis(axis) { 13200 return this.mBackMap.get(axis); 13201 } 13202 /** 13203 * 13204 * @param {Axis} axis 13205 * @return {string} 13206 */ 13207 getName(axis) { 13208 if (axis != null && axis instanceof Axis || axis === null) { 13209 return this.getName$com_vzome_core_math_symmetry_Axis(axis); 13210 } else if (axis === void 0) { 13211 return this.getName$(); 13212 } else throw new Error("invalid overload"); 13213 } 13214}; 13215ZomodDirectionNaming["__class"] = "com.vzome.core.zomic.ZomodDirectionNaming"; 13216
13217// src/worker/legacy/from-java/com/vzome/core/zomic/ZomicNamingConvention.ts 13218var ZomicNamingConvention = class _ZomicNamingConvention extends NamingConvention { 13219 static { 13220 this.SHORT = 3; 13221 } 13222 static { 13223 this.MEDIUM = 4; 13224 } 13225 static { 13226 this.LONG = 5; 13227 } 13228 constructor(symm) { 13229 super(); 13230 let dir = symm.getDirection("red"); 13231 const redNames = new ZomodDirectionNaming(dir, [0, 1, 2, 15, 17, 46]); 13232 this.addDirectionNaming(redNames); 13233 dir = symm.getDirection("yellow"); 13234 const yellowNames = new ZomodDirectionNaming(dir, [6, 9, 12, 0, 3, 1, 14, 5, 24, 17]); 13235 this.addDirectionNaming(yellowNames); 13236 dir = symm.getDirection("blue"); 13237 this.addDirectionNaming(new ZomodDirectionNaming(dir, [9, 12, 0, 3, 6, 1, 14, 18, 26, 52, 58, 4, 7, 2, 5])); 13238 dir = symm.getDirection("olive"); 13239 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13240 dir = symm.getDirection("maroon"); 13241 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13242 dir = symm.getDirection("lavender"); 13243 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13244 dir = symm.getDirection("rose"); 13245 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13246 dir = symm.getDirection("navy"); 13247 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13248 dir = symm.getDirection("turquoise"); 13249 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13250 dir = symm.getDirection("coral"); 13251 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13252 dir = symm.getDirection("sulfur"); 13253 this.addDirectionNaming(new DirectionNaming(dir, dir.getName())); 13254 dir = symm.getDirection("green"); 13255 this.addDirectionNaming(new GreenDirectionNaming(dir, redNames, yellowNames)); 13256 dir = symm.getDirection("orange"); 13257 this.addDirectionNaming(new GreenDirectionNaming(dir, redNames, yellowNames)); 13258 dir = symm.getDirection("purple"); 13259 this.addDirectionNaming(new _ZomicNamingConvention.ZomicNamingConvention$0(this, dir, redNames, yellowNames)); 13260 dir = symm.getDirection("black"); 13261 this.addDirectionNaming(new BlackDirectionNaming(dir, redNames, yellowNames)); 13262 } 13263}; 13264ZomicNamingConvention["__class"] = "com.vzome.core.zomic.ZomicNamingConvention"; 13265((ZomicNamingConvention2) => { 13266 class ZomicNamingConvention$0 extends GreenDirectionNaming { 13267 getName$com_vzome_core_math_symmetry_Axis(axis) { 13268 let orn = axis.getOrientation(); 13269 const redNeighbor = this.mRedNames.getDirection().getAxis$int$int(axis.getSense(), orn); 13270 const redName = this.mRedNames.getName$com_vzome_core_math_symmetry_Axis(redNeighbor); 13271 const rot = redNeighbor.getRotationPermutation(); 13272 orn = rot.mapIndex(rot.mapIndex(orn)); 13273 if (axis.getSense() === Symmetry.MINUS) orn = rot.mapIndex(orn); 13274 const yellowNeighbor = this.mYellowNames.getDirection().getAxis$int$int(axis.getSense(), orn); 13275 const yellowName = this.mYellowNames.getName$com_vzome_core_math_symmetry_Axis(yellowNeighbor).substring(1); 13276 return redName + yellowName; 13277 } 13278 /** 13279 * 13280 * @param {Axis} axis 13281 * @return {string} 13282 */ 13283 getName(axis) { 13284 if (axis != null && axis instanceof Axis || axis === null) { 13285 return this.getName$com_vzome_core_math_symmetry_Axis(axis); 13286 } else if (axis === void 0) { 13287 return this.getName$(); 13288 } else throw new Error("invalid overload"); 13289 } 13290 constructor(__parent, __arg0, __arg1, __arg2) { 13291 super(__arg0, __arg1, __arg2); 13292 this.__parent = __parent; 13293 } 13294 } 13295 ZomicNamingConvention2.ZomicNamingConvention$0 = ZomicNamingConvention$0; 13296})(ZomicNamingConvention || (ZomicNamingConvention = {})); 13297
13298// src/worker/legacy/from-java/com/vzome/core/zomic/program/Move.ts 13299var Move = class extends ZomicStatement { 13300 constructor(axis, len) { 13301 super(); 13302 if (this.axis === void 0) { 13303 this.axis = null; 13304 } 13305 if (this.length === void 0) { 13306 this.length = null; 13307 } 13308 this.axis = axis; 13309 this.length = len; 13310 } 13311 /** 13312 * 13313 * @param {*} visitor 13314 */ 13315 accept(visitor) { 13316 visitor.visitMove(this.axis, this.length); 13317 } 13318 /** 13319 * @return 13320 * @return {*} 13321 */ 13322 getLength() { 13323 return this.length; 13324 } 13325 getAxis() { 13326 return this.axis; 13327 } 13328 /** 13329 * Needed only for Zomic XMLS2AST. TODO: remove this by 13330 * rearranging the XML? 13331 * @param axis2 13332 * @param {*} len 13333 * @param {Axis} axis 13334 */ 13335 reset(axis, len) { 13336 this.axis = axis; 13337 this.length = len; 13338 } 13339}; 13340Move["__class"] = "com.vzome.core.zomic.program.Move"; 13341
13342// src/worker/legacy/from-java/com/vzome/core/zomic/program/Nested.ts 13343var Nested = class extends ZomicStatement { 13344 /** 13345 * 13346 * @param {*} visitor 13347 */ 13348 accept(visitor) { 13349 visitor.visitNested(this); 13350 } 13351 setBody(body) { 13352 this.m_body = body; 13353 } 13354 getBody() { 13355 return this.m_body; 13356 } 13357 constructor() { 13358 super(); 13359 if (this.m_body === void 0) { 13360 this.m_body = null; 13361 } 13362 } 13363}; 13364Nested["__class"] = "com.vzome.core.zomic.program.Nested"; 13365
13366// src/worker/legacy/from-java/com/vzome/core/zomic/program/Permute.ts 13367var Permute = class extends ZomicStatement { 13368 constructor(axis) { 13369 super(); 13370 if (this.m_axis === void 0) { 13371 this.m_axis = null; 13372 } 13373 this.m_axis = axis; 13374 } 13375 setAxis(axis) { 13376 this.m_axis = axis; 13377 } 13378 getOrder() { 13379 if (this.m_axis == null) return 2; 13380 return this.m_axis.getRotationPermutation().getOrder(); 13381 } 13382 getAxis() { 13383 return this.m_axis; 13384 } 13385}; 13386Permute["__class"] = "com.vzome.core.zomic.program.Permute"; 13387
13388// src/worker/legacy/from-java/com/vzome/core/zomic/program/Reflect.ts 13389var Reflect = class extends Permute { 13390 /** 13391 * 13392 * @param {*} visitor 13393 */ 13394 accept(visitor) { 13395 visitor.visitReflect(this.getAxis()); 13396 } 13397 constructor() { 13398 super(null); 13399 } 13400 /** 13401 * 13402 * @param {Axis} axis 13403 */ 13404 setAxis(axis) { 13405 super.setAxis(axis); 13406 } 13407}; 13408Reflect["__class"] = "com.vzome.core.zomic.program.Reflect"; 13409
13410// src/worker/legacy/from-java/com/vzome/core/zomic/program/Rotate.ts 13411var Rotate = class extends Permute { 13412 /** 13413 * 13414 * @param {*} visitor 13415 */ 13416 accept(visitor) { 13417 visitor.visitRotate(this.getAxis(), this.steps); 13418 } 13419 constructor(axis, steps) { 13420 super(axis); 13421 if (this.steps === void 0) { 13422 this.steps = 0; 13423 } 13424 this.steps = steps; 13425 } 13426 setSteps(steps) { 13427 this.steps = steps; 13428 } 13429}; 13430Rotate["__class"] = "com.vzome.core.zomic.program.Rotate"; 13431
13432// src/worker/legacy/from-java/com/vzome/core/zomic/program/Scale.ts 13433var Scale = class extends ZomicStatement { 13434 constructor(size) { 13435 super(); 13436 if (this.m_scale === void 0) { 13437 this.m_scale = null; 13438 } 13439 this.m_scale = size; 13440 } 13441 /** 13442 * 13443 * @param {*} visitor 13444 */ 13445 accept(visitor) { 13446 visitor.visitScale(this.m_scale); 13447 } 13448}; 13449Scale["__class"] = "com.vzome.core.zomic.program.Scale"; 13450
13451// src/worker/legacy/from-java/com/vzome/core/zomic/program/Walk.ts 13452var Walk = class extends ZomicStatement { 13453 /** 13454 * 13455 * @param {*} visitor 13456 */ 13457 accept(visitor) { 13458 visitor.visitWalk(this); 13459 } 13460 addStatement(stmt) { 13461 this.stmts.add(stmt); 13462 } 13463 /** 13464 * 13465 * @return {*} 13466 */ 13467 iterator() { 13468 return this.stmts.iterator(); 13469 } 13470 size() { 13471 return this.stmts.size(); 13472 } 13473 constructor() { 13474 super(); 13475 this.stmts = new java.util.ArrayList(); 13476 } 13477}; 13478Walk["__class"] = "com.vzome.core.zomic.program.Walk"; 13479Walk["__interfaces"] = ["java.lang.Iterable"]; 13480
13481// src/worker/legacy/from-java/com/vzome/core/zomic/ZomicCompilerState.ts 13482var ZomicCompilerState = class _ZomicCompilerState { 13483 constructor(icosaSymm) { 13484 if (this.icosaSymmetry === void 0) { 13485 this.icosaSymmetry = null; 13486 } 13487 if (this.namingConvention === void 0) { 13488 this.namingConvention = null; 13489 } 13490 this.statements = new java.util.Stack(); 13491 this.templates = new java.util.Stack(); 13492 this.icosaSymmetry = icosaSymm; 13493 this.namingConvention = new ZomicNamingConvention(icosaSymm); 13494 } 13495 getProgram() { 13496 return this.statements.size() === 0 ? new Walk() : this.statements.firstElement(); 13497 } 13498 prepareStatement(statement) { 13499 this.statements.push(statement); 13500 } 13501 peekTemplate() { 13502 return this.templates.peek(); 13503 } 13504 popTemplate() { 13505 return this.templates.pop(); 13506 } 13507 commitLastStatement() { 13508 const statement = this.statements.pop(); 13509 if (statement != null && statement instanceof Nested) { 13510 const body = statement.getBody(); 13511 if (body == null || body != null && body
13511instanceof Walk && body.size() === 0) { 13512 return; 13513 } 13514 } 13515 this.commit(statement); 13516 } 13517 commit(newStatement) { 13518 const currentStatement = this.statements.peek(); 13519 if (currentStatement != null && currentStatement instanceof Walk) { 13520 currentStatement.addStatement(newStatement); 13521 } else { 13522 currentStatement.setBody(newStatement); 13523 } 13524 } 13525 reset() { 13526 this.statements.clear(); 13527 this.templates.clear(); 13528 } 13529 setCurrentScale(scale) { 13530 this.templates.peek().scale = scale; 13531 } 13532 prepareSymmetryTemplate(symmetryMode) { 13533 const template = new _ZomicCompilerState.SymmetryTemplate(this, symmetryMode); 13534 this.templates.push(template); 13535 } 13536 prepareMoveTemplate() { 13537 const template = new _ZomicCompilerState.MoveTemplate(this); 13538 this.templates.push(template); 13539 } 13540 prepareScaleTemplate() { 13541 const template = new _ZomicCompilerState.ScaleTemplate(this); 13542 this.templates.push(template); 13543 } 13544 prepareReflectTemplate(isThruCenter) { 13545 const template = new _ZomicCompilerState.ReflectTemplate(this, isThruCenter); 13546 this.templates.push(template); 13547 } 13548 prepareRotateTemplate() { 13549 const template = new _ZomicCompilerState.RotateTemplate(this); 13550 this.templates.push(template); 13551 } 13552}; 13553ZomicCompilerState["__class"] = "com.vzome.core.zomic.ZomicCompilerState"; 13554((ZomicCompilerState2) => { 13555 class AxisInfo { 13556 generate() { 13557 try { 13558 const axis = this.__parent.namingConvention.getAxis(this.__axisColor, this.indexFullName()); 13559 if (axis == null) { 13560 const msg = "bad axis specification: '" + this.__axisColor + " " + this.indexFullName() + "'"; 13561 throw new Error(msg); 13562 } 13563 return axis; 13564 } catch (ex) { 13565 const msg = "bad axis specification: '" + this.__axisColor + " " + this.indexFullName() + "'"; 13566 throw new Error(msg); 13567 } 13568 } 13569 /** 13570 * 13571 * @return {string} 13572 */ 13573 axisColor() { 13574 return this.__axisColor; 13575 } 13576 /** 13577 * 13578 * @param {string} s 13579 */ 13580 setAxisColor(s2) { 13581 this.__axisColor = s2; 13582 } 13583 /** 13584 * 13585 * @return {string} 13586 */ 13587 indexNumber() { 13588 return this.__indexNumber; 13589 } 13590 /** 13591 * 13592 * @param {string} s 13593 */ 13594 setIndexNumber(s2) { 13595 this.__indexNumber = s2; 13596 } 13597 /** 13598 * 13599 * @return {string} 13600 */ 13601 handedness() { 13602 return this.__handedness; 13603 } 13604 /** 13605 * 13606 * @param {string} s 13607 */ 13608 setHandedness(s2) { 13609 this.__handedness = s2; 13610 } 13611 /** 13612 * 13613 * @return {string} 13614 */ 13615 indexFullName() { 13616 return this.__indexNumber + this.__handedness; 13617 } 13618 constructor(__parent) { 13619 this.__parent = __parent; 13620 this.__axisColor = ""; 13621 this.__indexNumber = ""; 13622 this.__handedness = ""; 13623 } 13624 } 13625 ZomicCompilerState2.AxisInfo = AxisInfo; 13626 AxisInfo["__class"] = "com.vzome.core.zomic.ZomicCompilerState.AxisInfo"; 13627 AxisInfo["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.IHaveAxisInfo"]; 13628 class ScaleInfo { 13629 generate(symmetry) { 13630 return symmetry.getField()["createAlgebraicNumber$int$int$int$int"](this.ones, this.phis, 1, this.scale); 13631 } 13632 constructor(__parent) { 13633 this.__parent = __parent; 13634 this.ones = 1; 13635 this.phis = 0; 13636 this.scale = 1; 13637 } 13638 } 13639 ZomicCompilerState2.ScaleInfo = ScaleInfo; 13640 ScaleInfo["__class"] = "com.vzome.core.zomic.ZomicCompilerState.ScaleInfo"; 13641 class RotateTemplate { 13642 /** 13643 * 13644 * @return {Rotate} 13645 */ 13646 generate() { 13647 const axis = this.axisInfo.generate(); 13648 return new Rotate(axis, this.steps); 13649 } 13650 /** 13651 * 13652 * @return {string} 13653 */ 13654 axisColor() { 13655 return this.axisInfo.__axisColor; 13656 } 13657 /** 13658 * 13659 * @param {string} s 13660 */ 13661 setAxisColor(s2) { 13662 this.axisInfo.setAxisColor(s2); 13663 } 13664 /** 13665 * 13666 * @return {string} 13667 */ 13668 indexNumber() { 13669 return this.axisInfo.__indexNumber; 13670 } 13671 /** 13672 * 13673 * @param {string} s 13674 */ 13675 setIndexNumber(s2) { 13676 this.axisInfo.setIndexNumber(s2); 13677 } 13678 /** 13679 * 13680 * @return {string} 13681 */ 13682 handedness() { 13683 return this.axisInfo.__handedness; 13684 } 13685 /** 13686 * 13687 * @param {string} s 13688 */ 13689 setHandedness(s2) { 13690 this.axisInfo.setHandedness(s2); 13691 } 13692 /** 13693 * 13694 * @return {string} 13695 */ 13696 indexFullName() { 13697 return this.axisInfo.indexFullName(); 13698 } 13699 constructor(__parent) { 13700 this.__parent = __parent; 13701 this.axisInfo = new ZomicCompilerState2.AxisInfo(this.__parent); 13702 this.steps = 1; 13703 } 13704 } 13705 ZomicCompilerState2.RotateTemplate = RotateTemplate; 13706 RotateTemplate["__class"] = "com.vzome.core.zomic.ZomicCompilerState.RotateTemplate"; 13707 RotateTemplate["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.IHaveAxisInfo", "com.vzome.core.zomic.ZomicCompilerState.ZomicStatementTemplate"]; 13708 class ReflectTemplate { 13709 constructor(__parent, isThruCenter) { 13710 this.__parent = __parent; 13711 this.axisInfo = new ZomicCompilerState2.AxisInfo(this.__parent); 13712 if (this.isThroughCenter === void 0) { 13713 this.isThroughCenter = false;
13714 } 13715 this.isThroughCenter = isThruCenter; 13716 } 13717 /** 13718 * 13719 * @return {Reflect} 13720 */ 13721 generate() { 13722 const result = new Reflect(); 13723 if (!this.isThroughCenter) { 13724 if ("" === this.axisColor() && !("" === this.indexNumber())) { 13725 this.setAxisColor("blue"); 13726 } 13727 const axis = this.axisInfo.generate(); 13728 result.setAxis(axis); 13729 } 13730 return result; 13731 } 13732 /** 13733 * 13734 * @return {string} 13735 */ 13736 axisColor() { 13737 return this.axisInfo.__axisColor; 13738 } 13739 /** 13740 * 13741 * @param {string} s 13742 */ 13743 setAxisColor(s2) { 13744 if (!("blue" === s2)) { 13745 this.enforceBlueAxis(); 13746 } else { 13747 this.axisInfo.setAxisColor(s2); 13748 } 13749 } 13750 /** 13751 * 13752 * @return {string} 13753 */ 13754 indexNumber() { 13755 return this.axisInfo.__indexNumber; 13756 } 13757 /** 13758 * 13759 * @param {string} s 13760 */ 13761 setIndexNumber(s2) { 13762 if ( 13763 /* startsWith */ 13764 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(s2, "-") 13765 ) s2 = s2.substring(1); 13766 this.axisInfo.setIndexNumber(s2); 13767 if (this.isThroughCenter && !("" === this.indexNumber())) { 13768 this.setAxisColor("blue"); 13769 } 13770 } 13771 /** 13772 * 13773 * @return {string} 13774 */ 13775 handedness() { 13776 return this.axisInfo.__handedness; 13777 } 13778 /** 13779 * 13780 * @param {string} s 13781 */ 13782 setHandedness(s2) { 13783 this.enforceBlueAxis(); 13784 } 13785 /** 13786 * 13787 * @return {string} 13788 */ 13789 indexFullName() { 13790 return this.axisInfo.indexFullName(); 13791 } 13792 enforceBlueAxis() { 13793 throw new java.lang.IllegalStateException("Only 'center' or blue axis indexes are allowed."); 13794 } 13795 } 13796 ZomicCompilerState2.ReflectTemplate = ReflectTemplate; 13797 ReflectTemplate["__class"] = "com.vzome.core.zomic.ZomicCompilerState.ReflectTemplate"; 13798 ReflectTemplate["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.IHaveAxisInfo", "com.vzome.core.zomic.ZomicCompilerState.ZomicStatementTemplate"]; 13799 let SymmetryModeEnum; 13800 ((SymmetryModeEnum2) => { 13801 SymmetryModeEnum2[SymmetryModeEnum2["Icosahedral"] = 0] = "Icosahedral"; 13802 SymmetryModeEnum2[SymmetryModeEnum2["RotateAroundAxis"] = 1] = "RotateAroundAxis"; 13803 SymmetryModeEnum2[SymmetryModeEnum2["MirrorThroughBlueAxis"] = 2] = "MirrorThroughBlueAxis"; 13804 SymmetryModeEnum2[SymmetryModeEnum2["ReflectThroughOrigin"] = 3] = "ReflectThroughOrigin"; 13805 })(SymmetryModeEnum = ZomicCompilerState2.SymmetryModeEnum || (ZomicCompilerState2.SymmetryModeEnum = {})); 13806 class SymmetryTemplate { 13807 constructor(__parent, mode) { 13808 this.__parent = __parent; 13809 this.axisInfo = new ZomicCompilerState2.AxisInfo(this.__parent); 13810 if (this.symmetryMode === void 0) { 13811 this.symmetryMode = null; 13812 } 13813 this.symmetryMode = mode; 13814 } 13815 /** 13816 * 13817 * @return {Symmetry} 13818 */ 13819 generate() { 13820 const result = this.__parent.statements.peek(); 13821 switch (this.symmetryMode) { 13822 case 0 /* Icosahedral */: 13823 break; 13824 case 1 /* RotateAroundAxis */: 13825 { 13826 const rotate = new Rotate(null, -1); 13827 const axis = this.axisInfo.generate(); 13828 rotate.setAxis(axis); 13829 result.setPermute(rotate); 13830 } 13831 ; 13832 break; 13833 case 2 /* MirrorThroughBlueAxis */: 13834 { 13835 const reflect = new Reflect(); 13836 const axis = this.axisInfo.generate(); 13837 reflect.setAxis(axis); 13838 result.setPermute(reflect); 13839 } 13840 ; 13841 break; 13842 case 3 /* ReflectThroughOrigin */: 13843 result.setPermute(new Reflect()); 13844 break; 13845 default: 13846 throw new java.lang.IllegalStateException("Unexpected SymmetryModeEnum: " + this.symmetryMode == null ? "<null>" : ZomicCompilerState2.SymmetryModeEnum["_$wrappers"][this.symmetryMode].toString()); 13847 } 13848 return result; 13849 } 13850 /** 13851 * 13852 * @return {string} 13853 */ 13854 axisColor() { 13855 return this.axisInfo.__axisColor; 13856 } 13857 /** 13858 * 13859 * @param {string} s 13860 */ 13861 setAxisColor(s2) { 13862 this.axisInfo.setAxisColor(s2); 13863 } 13864 /** 13865 * 13866 * @return {string} 13867 */ 13868 indexNumber() { 13869 return this.axisInfo.__indexNumber; 13870 } 13871 /** 13872 * 13873 * @param {string} s 13874 */ 13875 setIndexNumber(s2) { 13876 if (this.symmetryMode === 2 /* MirrorThroughBlueAxis */) { 13877 if ( 13878 /* startsWith */ 13879 ((str, searchString, position = 0) => str.substr(position, searchString.length) === searchString)(s2, "-") 13880 ) s2 = s2.substring(1); 13881 } 13882 this.axisInfo.setIndexNumber(s2); 13883 if (this.symmetryMode === 2 /* MirrorThroughBlueAxis */) { 13884 this.setAxisColor("blue"); 13885 } 13886 } 13887 /** 13888 * 13889 * @return {string} 13890 */ 13891 handedness() { 13892 return this.axisInfo.__handedness; 13893 } 13894 /** 13895 * 13896 * @param {string} s 13897 */ 13898 setHandedness(s2) { 13899 this.axisInfo.setHandedness(s2); 13900 } 13901 /** 13902 * 13903 * @return {string} 13904 */ 13905 indexFullName() { 13906 return this.axisInfo.indexFullName(); 13907 } 13908 } 13909 ZomicCompilerState2.SymmetryTemplate = SymmetryTemplate; 13910 SymmetryTemplate["__class"] = "com.vzome.core.zomic.ZomicCompilerState.SymmetryTemplate"; 13911 SymmetryTemplate["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.IHaveAxisInfo", "com.vzome.core.zomic.ZomicCompilerState.ZomicStatementTemplate"]; 13912 class ScaleTemplate extends ZomicCompilerState2.ScaleInfo { 13913 generate(symmetry) { 13914 if (symmetry != null && symmetry instanceof IcosahedralSymmetry || symmetry === null) { 13915 return super.generate(symmetry); 13916 } else if (symmetry === void 0) { 13917 return this.generate$(); 13918 } else throw new Error("invalid overload"); 13919 } 13920 generate$() { 13921 const algebraicNumber = this.generate(this.__parent.icosaSymmetry); 13922 return new Scale(algebraicNumber); 13923 } 13924 constructor(__parent) { 13925 super(__parent); 13926 this.__parent = __parent; 13927 } 13928 } 13929 ZomicCompilerState2.ScaleTemplate = ScaleTemplate; 13930 ScaleTemplate["__class"] = "com.vzome.core.zomic.ZomicCompilerState.ScaleTemplate"; 13931 ScaleTemplate["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.ZomicStatementTemplate"]; 13932 class MoveTemplate extends ZomicCompilerState2.ScaleInfo { 13933 constructor(__parent) { 13934 super(__parent); 13935 this.__parent = __parent; 13936 this.axisInfo = new ZomicCompilerState2.AxisInfo(this.__parent); 13937 this.denominator = 1; 13938 this.sizeRef = null; 13939 this.__isVariableLength = false;
13940 this.scale = ZomicNamingConvention.MEDIUM; 13941 } 13942 isVariableLength$() { 13943 return this.__isVariableLength || -99 === this.scale; 13944 } 13945 isVariableLength$boolean(is) { 13946 this.__isVariableLength = is; 13947 } 13948 isVariableLength(is) { 13949 if (typeof is === "boolean" || is === null) { 13950 return this.isVariableLength$boolean(is); 13951 } else if (is === void 0) { 13952 return this.isVariableLength$(); 13953 } else throw new Error("invalid overload"); 13954 } 13955 generate$java_lang_String(axisColor) { 13956 if (this.denominator !== 1) { 13957 const direction = this.__parent.icosaSymmetry.getDirection(axisColor); 13958 if (direction == null || !direction.hasHalfSizes()) { 13959 const msg = "half struts are not allowed on '" + axisColor + "' axes."; 13960 throw new Error(msg); 13961 } 13962 } 13963 if (this.isVariableLength$()) { 13964 return this.__parent.icosaSymmetry.getField().zero(); 13965 } 13966 let lengthFactor = 1; 13967 let scaleOffset = 0; 13968 switch (axisColor) { 13969 case "blue": 13970 lengthFactor = 2; 13971 break; 13972 case "green": 13973 lengthFactor = 2; 13974 break; 13975 case "yellow": 13976 scaleOffset = -1; 13977 break; 13978 case "purple": 13979 scaleOffset = -1; 13980 break; 13981 default: 13982 break; 13983 } 13984 return this.__parent.icosaSymmetry.getField()["createAlgebraicNumber$int$int$int$int"](this.ones * lengthFactor, this.phis * lengthFactor, this.denominator, this.scale + scaleOffset); 13985 } 13986 generate(axisColor) { 13987 if (typeof axisColor === "string" || axisColor === null) { 13988 return this.generate$java_lang_String(axisColor); 13989 } else if (axisColor != null && axisColor instanceof IcosahedralSymmetry || axisColor === null) { 13990 return super.generate(axisColor); 13991 } else if (axisColor === void 0) { 13992 return this.generate$(); 13993 } else throw new Error("invalid overload"); 13994 } 13995 generate$() { 13996 const axis = this.axisInfo.generate(); 13997 const strutLength = this.generate$java_lang_String(this.axisColor()); 13998 return new Move(axis, strutLength); 13999 } 14000 /** 14001 * 14002 * @return {string} 14003 */ 14004 axisColor() { 14005 return this.axisInfo.__axisColor; 14006 } 14007 /** 14008 * 14009 * @param {string} s 14010 */ 14011 setAxisColor(s2) { 14012 this.axisInfo.setAxisColor(s2); 14013 } 14014 /** 14015 * 14016 * @return {string} 14017 */ 14018 indexNumber() { 14019 return this.axisInfo.__indexNumber; 14020 } 14021 /** 14022 * 14023 * @param {string} s 14024 */ 14025 setIndexNumber(s2) { 14026 this.axisInfo.setIndexNumber(s2); 14027 } 14028 /** 14029 * 14030 * @return {string} 14031 */ 14032 handedness() { 14033 return this.axisInfo.__handedness; 14034 } 14035 /** 14036 * 14037 * @param {string} s 14038 */ 14039 setHandedness(s2) { 14040 this.axisInfo.setHandedness(s2); 14041 } 14042 /** 14043 * 14044 * @return {string} 14045 */ 14046 indexFullName() { 14047 return this.axisInfo.indexFullName(); 14048 } 14049 } 14050 ZomicCompilerState2.MoveTemplate = MoveTemplate; 14051 MoveTemplate["__class"] = "com.vzome.core.zomic.ZomicCompilerState.MoveTemplate"; 14052 MoveTemplate["__interfaces"] = ["com.vzome.core.zomic.ZomicCompilerState.IHaveAxisInfo", "com.vzome.core.zomic.ZomicCompilerState.ZomicStatementTemplate"]; 14053})(ZomicCompilerState || (ZomicCompilerState = {})); 14054
14055// src/worker/legacy/from-java/com/vzome/core/zomic/program/Build.ts 14056var Build = class extends ZomicStatement { 14057 constructor(build, destroy) { 14058 super(); 14059 if (this.m_build === void 0) { 14060 this.m_build = false; 14061 } 14062 if (this.m_destroy === void 0) { 14063 this.m_destroy = false; 14064 } 14065 this.m_build = build; 14066 this.m_destroy = destroy; 14067 } 14068 /** 14069 * 14070 * @param {*} visitor 14071 */ 14072 accept(visitor) { 14073 visitor.visitBuild(this.m_build, this.m_destroy); 14074 } 14075 setBuild(value) { 14076 this.m_build = value; 14077 } 14078 setDestroy(value) { 14079 this.m_destroy = value; 14080 } 14081 justMoving() { 14082 return this.m_build === this.m_destroy; 14083 } 14084}; 14085Build["__class"] = "com.vzome.core.zomic.program.Build"; 14086
14087// src/worker/legacy/from-java/com/vzome/core/zomic/program/Label.ts 14088var Label = class extends ZomicStatement { 14089 constructor(id) { 14090 super(); 14091 if (this.mLabel === void 0) { 14092 this.mLabel = null; 14093 } 14094 this.mLabel = id; 14095 } 14096 /** 14097 * 14098 * @param {*} visitor 14099 */ 14100 accept(visitor) { 14101 visitor.visitLabel(this.mLabel); 14102 } 14103}; 14104Label["__class"] = "com.vzome.core.zomic.program.Label"; 14105
14106// src/worker/legacy/from-java/com/vzome/core/zomic/program/Repeat.ts 14107var Repeat = class extends Nested { 14108 constructor(repetitions) { 14109 super(); 14110 if (this.repetitions === void 0) { 14111 this.repetitions = 0; 14112 } 14113 this.repetitions = repetitions; 14114 } 14115 /** 14116 * 14117 * @param {*} visitor 14118 */ 14119 accept(visitor) { 14120 visitor.visitRepeat(this, this.repetitions); 14121 } 14122}; 14123Repeat["__class"] = "com.vzome.core.zomic.program.Repeat"; 14124
14125// src/worker/legacy/from-java/com/vzome/core/zomic/program/Save.ts 14126var Save = class extends Nested { 14127 constructor(state) { 14128 super(); 14129 if (this.m_state === void 0) { 14130 this.m_state = 0; 14131 } 14132 this.m_state = state; 14133 } 14134 /** 14135 * 14136 * @param {*} visitor 14137 */ 14138 accept(visitor) { 14139 visitor.visitSave(this, this.m_state); 14140 } 14141 setState(state) { 14142 this.m_state = state; 14143 } 14144}; 14145Save["__class"] = "com.vzome.core.zomic.program.Save"; 14146
14147// src/worker/legacy/from-java/com/vzome/core/zomic/program/Symmetry.ts 14148var Symmetry2 = class extends Nested { 14149 /** 14150 * 14151 * @param {*} visitor 14152 */ 14153 accept(visitor) { 14154 visitor.visitSymmetry(this, this.permute); 14155 } 14156 setPermute(permute) { 14157 this.permute = permute; 14158 } 14159 getPermute() { 14160 return this.permute; 14161 } 14162 constructor() { 14163 super(); 14164 if (this.permute === void 0) { 14165 this.permute = null; 14166 } 14167 } 14168}; 14169Symmetry2["__class"] = "com.vzome.core.zomic.program.Symmetry"; 14170
14171// src/worker/legacy/zomic/index.js 14172var interpretScript = (script, language, offset, symmetry, effects) => { 14173 if (language !== "zomic") 14174 throw new Error(`${language} is not a supported script language.`); 14175 const chars = new M.InputStream(script); 14176 const lexer = new ZomicLexer(chars); 14177 const tokens = new M.CommonTokenStream(lexer); 14178 const parser = new ZomicParser(tokens); 14179 const tree = parser.program(); 14180 const compiler = new ZomicCompiler(symmetry); 14181 M.tree.ParseTreeWalker.DEFAULT.walk(compiler, tree); 14182 const program = compiler.getProgram(); 14183 const builder = new ZomicVirtualMachine(offset, effects, symmetry); 14184 program.accept(new Interpreter(builder, symmetry)); 14185}; 14186var ZomicCompiler = class extends ZomicParserListener { 14187 constructor(symmetry) { 14188 super(); 14189 this.state = new ZomicCompilerState(symmetry); 14190 } 14191 getProgram() { 14192 return this.state.getProgram(); 14193 } 14194 enterProgram(ctx) { 14195 this.state.prepareStatement(new Walk()); 14196 this.state.prepareStatement(new Walk()); 14197 } 14198 exitProgram(ctx) { 14199 this.state.commitLastStatement(); 14200 if (this.state.getProgram().size() === 0) { 14201 throw new Error("We should always have a Walk by the time we get here!"); 14202 } 14203 } 14204 enterCompound_stmt(ctx) { 14205 this.state.prepareStatement(new Walk()); 14206 } 14207 exitCompound_stmt(ctx) { 14208 this.state.commitLastStatement(); 14209 } 14210 enterStrut_stmt(ctx) { 14211 this.state.prepareMoveTemplate(); 14212 } 14213 exitStrut_stmt(ctx) { 14214 const template = this.state.popTemplate(); 14215 try { 14216 this.state.commit(template.generate()); 14217 } catch (e2) { 14218 throw new Error(e2.getMessage()); 14219 } 14220 } 14221 exitLabel_stmt(ctx) { 14222 this.state.commit(new Label(ctx.IDENT().text)); 14223 } 14224 enterScale_stmt(ctx) { 14225 this.state.prepareScaleTemplate(); 14226 } 14227 exitScale_stmt(ctx) { 14228 if (!!ctx.scale) { 14229 this.state.setCurrentScale(parseInt(ctx.scale.text)); 14230 } 14231 const template = this.state.popTemplate(); 14232 this.state.commit(template.generate()); 14233 } 14234 exitBuild_stmt(ctx) { 14235 this.state.commit(new Build( 14236 /*build*/ 14237 true, 14238 /*destroy*/ 14239 false 14240 )); 14241 } 14242 exitMove_stmt(ctx) { 14243 this.state.commit(new Build( 14244 /*build*/ 14245 false, 14246 /*destroy*/ 14247 false 14248 )); 14249 } 14250 enterRotate_stmt(ctx) { 14251 this.state.prepareRotateTemplate(); 14252 } 14253 exitRotate_stmt(ctx) { 14254 try { 14255 const template = this.state.popTemplate(); 14256 if (!!ctx.steps) { 14257 template.steps = parseInt(ctx.steps.text); 14258 } 14259 this.state.commit(template.generate()); 14260 } catch (e2) { 14261 throw new Error(e2.getMessage()); 14262 } 14263 } 14264 enterReflect_stmt(ctx) { 14265 const isThruCenter = ctx.symmetry_center_expr().CENTER() !== null; 14266 this.state.prepareReflectTemplate(isThruCenter); 14267 } 14268 exitReflect_stmt(ctx) { 14269 const template = this.state.popTemplate(); 14270 try { 14271 this.state.commit(template.generate()); 14272 } catch (e2) { 14273 throw new Error(e2.getMessage()); 14274 } 14275 } 14276 enterFrom_stmt(ctx) { 14277 this.state.prepareStatement(new Save(ZomicEventHandler.ACTION)); 14278 this.state.prepareStatement(new Walk()); 14279 this.state.commit(new Build( 14280 /*build*/ 14281 false, 14282 /*destroy*/ 14283 false 14284 )); 14285 } 14286 exitFrom_stmt(ctx) { 14287 this.state.commitLastStatement(); 14288 this.state.commitLastStatement(); 14289 } 14290 enterSymmetry_stmt(ctx) { 14291 let symmetryMode; 14292 if (ctx.axis_expr() !== null) { 14293 symmetryMode = ZomicCompilerState.SymmetryModeEnum.RotateAroundAxis; 14294 } else if (ctx.symmetry_center_expr() === null) { 14295 symmetryMode = ZomicCompilerState.SymmetryModeEnum.Icosahedral; 14296 } else if (ctx.symmetry_center_expr().blueAxisIndexNumber !== null) { 14297 symmetryMode = ZomicCompilerState.SymmetryModeEnum.MirrorThroughBlueAxis; 14298 } else if (ctx.symmetry_center_expr().CENTER() !== null) { 14299 symmetryMode = ZomicCompilerState.SymmetryModeEnum.ReflectThroughOrigin; 14300 } else { 14301 throw new Error("Unexpected symmetry mode: " + ctx.text); 14302 } 14303 this.state.prepareSymmetryTemplate(symmetryMode); 14304 this.state.prepareStatement(new Symmetry2()); 14305 } 14306 exitSymmetry_stmt(ctx) { 14307 const template = this.state.popTemplate(); 14308 try { 14309 template.generate(); 14310 } catch (e2) { 14311 throw new Error(e2.getMessage()); 14312 }
14313 this.state.commitLastStatement(); 14314 } 14315 enterRepeat_stmt(ctx) { 14316 const txt = ctx.count.text; 14317 const count = parseInt(txt); 14318 this.state.prepareStatement(new Repeat(Math.abs(count))); 14319 } 14320 exitRepeat_stmt(ctx) { 14321 this.state.commitLastStatement(); 14322 } 14323 enterBranch_stmt(ctx) { 14324 this.state.prepareStatement(new Save(ZomicEventHandler.LOCATION)); 14325 } 14326 exitBranch_stmt(ctx) { 14327 this.state.commitLastStatement(); 14328 } 14329 enterSave_stmt(ctx) { 14330 let state = 0; 14331 switch (ctx.state.text) { 14332 case "orientation": 14333 state = ZomicEventHandler.ORIENTATION; 14334 break; 14335 case "scale": 14336 state = ZomicEventHandler.SCALE; 14337 break; 14338 case "location": 14339 state = ZomicEventHandler.LOCATION; 14340 break; 14341 case "build": 14342 state = ZomicEventHandler.ACTION; 14343 break; 14344 case "all": 14345 state = ZomicEventHandler.ALL; 14346 break; 14347 default: 14348 throw new Error("Unexpected save parameter: " + ctx.state.text); 14349 } 14350 this.state.prepareStatement(new Save(state)); 14351 } 14352 exitSave_stmt(ctx) { 14353 this.state.commitLastStatement(); 14354 } 14355 exitStrut_length_expr(ctx) { 14356 if (ctx.HALF() !== null) { 14357 this.state.peekTemplate().denominator = 2; 14358 } 14359 } 14360 exitAlgebraic_number_expr(ctx) { 14361 const template = this.state.peekTemplate(); 14362 template.ones = parseInt(ctx.ones.text); 14363 if (ctx.phis !== null) { 14364 template.phis = parseInt(ctx.phis.text); 14365 } 14366 } 14367 exitExplicit_size_expr(ctx) { 14368 if (ctx.scale !== null) { 14369 this.state.setCurrentScale(parseInt(ctx.scale.text)); 14370 } 14371 const template = this.state.peekTemplate(); 14372 if (ctx.isVariableLength !== null) { 14373 template.isVariableLength(true); 14374 } 14375 } 14376 exitSizeShort(ctx) { 14377 this.state.setCurrentScale(ZomicNamingConvention.SHORT); 14378 } 14379 exitSizeLong(ctx) { 14380 this.state.setCurrentScale(ZomicNamingConvention.LONG); 14381 } 14382 exitSizeMedium(ctx) { 14383 this.state.setCurrentScale(ZomicNamingConvention.MEDIUM); 14384 } 14385 exitSymmetry_center_expr(ctx) { 14386 const elements = this.state.peekTemplate(); 14387 if (ctx.blueAxisIndexNumber !== null) { 14388 elements.setIndexNumber(ctx.blueAxisIndexNumber.text); 14389 } 14390 } 14391 exitAxis_index_expr(ctx) { 14392 const elements = this.state.peekTemplate(); 14393 elements.setIndexNumber(ctx.INT()); 14394 if (ctx.handedness !== null) { 14395 elements.setHandedness(ctx.handedness.text); 14396 } 14397 } 14398 exitRed(ctx) { 14399 this.state.peekTemplate().setAxisColor("red"); 14400 } 14401 exitBlue(ctx) { 14402 this.state.peekTemplate().setAxisColor("blue"); 14403 } 14404 exitYellow(ctx) { 14405 this.state.peekTemplate().setAxisColor("yellow"); 14406 } 14407 exitGreen(ctx) { 14408 this.state.peekTemplate().setAxisColor("green"); 14409 } 14410 exitOrange(ctx) { 14411 this.state.peekTemplate().setAxisColor("orange"); 14412 } 14413 exitPurple(ctx) { 14414 this.state.peekTemplate().setAxisColor("purple"); 14415 } 14416 exitBlack(ctx) { 14417 this.state.peekTemplate().setAxisColor("black"); 14418 } 14419}; 14420export { 14421 interpretScript 14422};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.