1
0

task_processor.js 262 KB

1
  1. (()=>{"use strict";const t=require("node:worker_threads"),e=require("node:fs");function n(t){var e="0123456789abcdef";function n(t){var n,i="";for(n=0;n<=3;n++)i+=e.charAt(t>>8*n+4&15)+e.charAt(t>>8*n&15);return i}function i(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function s(t,e,n,s,r,o){return i(function(t,e){return t<<e|t>>>32-e}(i(i(e,t),i(s,o)),r),n)}function r(t,e,n,i,r,o,a){return s(e&n|~e&i,t,e,r,o,a)}function o(t,e,n,i,r,o,a){return s(e&i|n&~i,t,e,r,o,a)}function a(t,e,n,i,r,o,a){return s(e^n^i,t,e,r,o,a)}function l(t,e,n,i,r,o,a){return s(n^(e|~i),t,e,r,o,a)}var h,u,c,d,p,g=function(t){var e,n=1+(t.length+8>>6),i=new Array(16*n);for(e=0;e<16*n;e++)i[e]=0;for(e=0;e<t.length;e++)i[e>>2]|=t.charCodeAt(e)<<e%4*8;return i[e>>2]|=128<<e%4*8,i[16*n-2]=8*t.length,i}(""+t),x=1732584193,f=-271733879,m=-1732584194,E=271733878;for(h=0;h<g.length;h+=16)u=x,c=f,d=m,p=E,x=r(x,f,m,E,g[h+0],7,-680876936),E=r(E,x,f,m,g[h+1],12,-389564586),m=r(m,E,x,f,g[h+2],17,606105819),f=r(f,m,E,x,g[h+3],22,-1044525330),x=r(x,f,m,E,g[h+4],7,-176418897),E=r(E,x,f,m,g[h+5],12,1200080426),m=r(m,E,x,f,g[h+6],17,-1473231341),f=r(f,m,E,x,g[h+7],22,-45705983),x=r(x,f,m,E,g[h+8],7,1770035416),E=r(E,x,f,m,g[h+9],12,-1958414417),m=r(m,E,x,f,g[h+10],17,-42063),f=r(f,m,E,x,g[h+11],22,-1990404162),x=r(x,f,m,E,g[h+12],7,1804603682),E=r(E,x,f,m,g[h+13],12,-40341101),m=r(m,E,x,f,g[h+14],17,-1502002290),x=o(x,f=r(f,m,E,x,g[h+15],22,1236535329),m,E,g[h+1],5,-165796510),E=o(E,x,f,m,g[h+6],9,-1069501632),m=o(m,E,x,f,g[h+11],14,643717713),f=o(f,m,E,x,g[h+0],20,-373897302),x=o(x,f,m,E,g[h+5],5,-701558691),E=o(E,x,f,m,g[h+10],9,38016083),m=o(m,E,x,f,g[h+15],14,-660478335),f=o(f,m,E,x,g[h+4],20,-405537848),x=o(x,f,m,E,g[h+9],5,568446438),E=o(E,x,f,m,g[h+14],9,-1019803690),m=o(m,E,x,f,g[h+3],14,-187363961),f=o(f,m,E,x,g[h+8],20,1163531501),x=o(x,f,m,E,g[h+13],5,-1444681467),E=o(E,x,f,m,g[h+2],9,-51403784),m=o(m,E,x,f,g[h+7],14,1735328473),x=a(x,f=o(f,m,E,x,g[h+12],20,-1926607734),m,E,g[h+5],4,-378558),E=a(E,x,f,m,g[h+8],11,-2022574463),m=a(m,E,x,f,g[h+11],16,1839030562),f=a(f,m,E,x,g[h+14],23,-35309556),x=a(x,f,m,E,g[h+1],4,-1530992060),E=a(E,x,f,m,g[h+4],11,1272893353),m=a(m,E,x,f,g[h+7],16,-155497632),f=a(f,m,E,x,g[h+10],23,-1094730640),x=a(x,f,m,E,g[h+13],4,681279174),E=a(E,x,f,m,g[h+0],11,-358537222),m=a(m,E,x,f,g[h+3],16,-722521979),f=a(f,m,E,x,g[h+6],23,76029189),x=a(x,f,m,E,g[h+9],4,-640364487),E=a(E,x,f,m,g[h+12],11,-421815835),m=a(m,E,x,f,g[h+15],16,530742520),x=l(x,f=a(f,m,E,x,g[h+2],23,-995338651),m,E,g[h+0],6,-198630844),E=l(E,x,f,m,g[h+7],10,1126891415),m=l(m,E,x,f,g[h+14],15,-1416354905),f=l(f,m,E,x,g[h+5],21,-57434055),x=l(x,f,m,E,g[h+12],6,1700485571),E=l(E,x,f,m,g[h+3],10,-1894986606),m=l(m,E,x,f,g[h+10],15,-1051523),f=l(f,m,E,x,g[h+1],21,-2054922799),x=l(x,f,m,E,g[h+8],6,1873313359),E=l(E,x,f,m,g[h+15],10,-30611744),m=l(m,E,x,f,g[h+6],15,-1560198380),f=l(f,m,E,x,g[h+13],21,1309151649),x=l(x,f,m,E,g[h+4],6,-145523070),E=l(E,x,f,m,g[h+11],10,-1120210379),m=l(m,E,x,f,g[h+2],15,718787259),f=l(f,m,E,x,g[h+9],21,-343485551),x=i(x,u),f=i(f,c),m=i(m,d),E=i(E,p);return n(x)+n(f)+n(m)+n(E)}const i=require("path");var s={92:()=>{}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var n=r[t]={exports:{}};return s[t](n,n.exports,o),n.exports}o.d=(t,e)=>{for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var a={};(()=>{o.d(a,{dx:()=>z,q2:()=>Nt,FO:()=>Ae,xf:()=>Le,Gy:()=>ke,s4:()=>wt,c7:()=>be,_7:()=>le,tx:()=>_e,gp:()=>Te,cK:()=>It,zs:()=>me,AV:()=>Le,Xp:()=>T,VS:()=>R,ul:()=>Y,hW:()=>Ht,x1:()=>jt,z5:()=>ee,oN:()=>de,TB:()=>pe,u1:()=>ge,_b:()=>Ue,$F:()=>ie,_T:()=>Fe,db:()=>se,Zx:()=>te,_x:()=>Ut,r8:()=>M,JI:()=>P,TP:()=>w,WU:()=>t,Nj:()=>u,ZP:()=>Ye});class t{constructor(){this.source=null,this.type=null,this.channel=null,this.start=null,this.stop=null,this.tokenIndex=null,this.line=null,this.column=null,this._text=null}getTokenSource(){return this.source[0]}getInputStream(){return this.source[1]}get text(){return this._text}set text(t){this._text=t}}function e(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!(t[n]===e[n]||t[n].equals&&t[n].equals(e[n])))return!1;return!0}t.INVALID_TYPE=0,t.EPSILON=-2,t.MIN_USER_TOKEN_TYPE=1,t.EOF=-1,t.DEFAULT_CHANNEL=0,t.HIDDEN_CHANNEL=1;const n=Math.round(Math.random()*Math.pow(2,32));function i(t){if(!t)return 0;const e=typeof t,i="string"===e?t:!("object"!==e||!t.toString)&&t.toString();if(!i)return 0;let s,r;const o=3&i.length,a=i.length-o;let l=n;const h=3432918353,u=461845907;let c=0;for(;c<a;)r=255&i.charCodeAt(c)|(255&i.charCodeAt(++c))<<8|(255&i.charCodeAt(++c))<<16|(255&i.charCodeAt(++c))<<24,++c,r=(65535&r)*h+(((r>>>16)*h&65535)<<16)&4294967295,r=r<<15|r>>>17,r=(65535&r)*u+(((r>>>16)*u&65535)<<16)&4294967295,l^=r,l=l<<13|l>>>19,s=5*(65535&l)+((5*(l>>>16)&65535)<<16)&4294967295,l=27492+(65535&s)+((58964+(s>>>16)&65535)<<16);switch(r=0,o){case 3:r^=(255&i.charCodeAt(c+2))<<16;case 2:r^=(255&i.charCodeAt(c+1))<<8;case 1:r^=255&i.charCodeAt(c),r=(65535&r)*h+(((r>>>16)*h&65535)<<16)&4294967295,r=r<<15|r>>>17,r=(65535&r)*u+(((r>>>16)*u&65535)<<16)&4294967295,l^=r}return l^=i.length,l^=l>>>16,l=2246822507*(65535&l)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(65535&l)+((3266489909*(l>>>16)&65535)<<16)&4294967295,l^=l>>>16,l>>>0}class s{constructor(){this.count=0,this.hash=0}update(){for(let t=0;t<arguments.length;t++){const e=arguments[t];if(null!=e)if(Array.isArray(e))this.update.apply(this,e);else{let t=0;switch(typeof e){case"undefined":case"function":continue;case"number":case"boolean":t=e;break;case"string":t=i(e);break;default:e.updateHashCode?e.updateHashCode(this):console.log("No updateHashCode for "+e.toString());continue}t*=3432918353,t=t<<15|t>>>17,t*=461845907,this.count=this.count+1;let n=this.hash^t;n=n<<13|n>>>19,n=5*n+3864292196,this.hash=n}}}finish(){let t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16,t}static hashStuff(){const t=new s;return t.update.apply(t,arguments),t.finish()}}function r(t){return t?"string"==typeof t?i(t):t.hashCode():-1}function l(t,e){return t?t.equals(e):t===e}function h(t){return null===t?"null":t}function u(t){return Array.isArray(t)?"["+t.map(h).join(", ")+"]":"null"}const c="h-";class d{constructor(t,e){this.data={},this.hashFunction=t||r,this.equalsFunction=e||l}add(t){const e=c+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;e<n.length;e++)if(this.equalsFunction(t,n[e]))return n[e];return n.push(t),t}return this.data[e]=[t],t}has(t){return null!=this.get(t)}get(t){const e=c+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;e<n.length;e++)if(this.equalsFunction(t,n[e]))return n[e]}return null}values(){return Object.keys(this.data).filter((t=>t.startsWith(c))).flatMap((t=>this.data[t]),this)}toString(){return u(this.values())}get length(){return Object.keys(this.data).filter((t=>t.startsWith(c))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}class p{hashCode(){const t=new s;return this.updateHashCode(t),t.finish()}evaluate(t,e){}evalPrecedence(t,e){return this}static andContext(t,e){if(null===t||t===p.NONE)return e;if(null===e||e===p.NONE)return t;const n=new g(t,e);return 1===n.opnds.length?n.opnds[0]:n}static orContext(t,e){if(null===t)return e;if(null===e)return t;if(t===p.NONE||e===p.NONE)return p.NONE;const n=new x(t,e);return 1===n.opnds.length?n.opnds[0]:n}}class g extends p{constructor(t,e){super();const n=new d;t instanceof g?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof g?e.opnds.map((function(t){n.add(t)})):n.add(e);const i=f(n);if(i.length>0){let t=null;i.map((function(e){(null===t||e.precedence<t.precedence)&&(t=e)})),n.add(t)}this.opnds=Array.from(n.values())}equals(t){return this===t||t instanceof g&&e(this.opnds,t.opnds)}updateHashCode(t){t.update(this.opnds,"AND")}evaluate(t,e){for(let n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(t,e))return!1;return!0}evalPrecedence(t,e){let n=!1;const i=[];for(let s=0;s<this.opnds.length;s++){const r=this.opnds[s],o=r.evalPrecedence(t,e);if(n|=o!==r,null===o)return null;o!==p.NONE&&i.push(o)}if(!n)return this;if(0===i.length)return p.NONE;let s=null;return i.map((function(t){s=null===s?t:p.andContext(s,t)})),s}toString(){const t=this.opnds.map((t=>t.toString()));return(t.length>3?t.slice(3):t).join("&&")}}class x extends p{constructor(t,e){super();const n=new d;t instanceof x?t.opnds.map((function(t){n.add(t)})):n.add(t),e instanceof x?e.opnds.map((function(t){n.add(t)})):n.add(e);const i=f(n);if(i.length>0){const t=i.sort((function(t,e){return t.compareTo(e)})),e=t[t.length-1];n.add(e)}this.opnds=Array.from(n.values())}equals(t){return this===t||t instanceof x&&e(this.opnds,t.opnds)}updateHashCode(t){t.update(this.opnds,"OR")}evaluate(t,e){for(let n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(t,e))return!0;return!1}evalPrecedence(t,e){let n=!1;const i=[];for(let s=0;s<this.opnds.length;s++){const r=this.opnds[s],o=r.evalPrecedence(t,e);if(n|=o!==r,o===p.NONE)return p.NONE;null!==o&&i.push(o)}return n?(0===i.length||i.map((function(t){return t})),null):this}toString(){const t=this.opnds.map((t=>t.toString()));return(t.length>3?t.slice(3):t).join("||")}}function f(t){const e=[];return t.values().map((function(t){t instanceof p.PrecedencePredicate&&e.push(t)})),e}function m(t,e){if(null===t){const t={state:null,alt:null,context:null,semanticContext:null};return e&&(t.reachesIntoOuterContext=0),t}{const n={};return n.state=t.state||null,n.alt=void 0===t.alt?null:t.alt,n.context=t.context||null,n.semanticContext=t.semanticContext||null,e&&(n.reachesIntoOuterContext=t.reachesIntoOuterContext||0,n.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),n}}class E{constructor(t,e){this.checkContext(t,e),t=m(t),e=m(e,!0),this.state=null!==t.state?t.state:e.state,this.alt=null!==t.alt?t.alt:e.alt,this.context=null!==t.context?t.context:e.context,this.semanticContext=null!==t.semanticContext?t.semanticContext:null!==e.semanticContext?e.semanticContext:p.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed}checkContext(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)}hashCode(){const t=new s;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)}equals(t){return this===t||t instanceof E&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&(null===this.context?null===t.context:this.context.equals(t.context))&&this.semanticContext.equals(t.semanticContext)&&this.precedenceFilterSuppressed===t.precedenceFilterSuppressed}hashCodeForConfigSet(){const t=new s;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()}equalsForConfigSet(t){return this===t||t instanceof E&&this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext)}toString(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==p.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"}}class T{constructor(t,e){this.start=t,this.stop=e}clone(){return new T(this.start,this.stop)}contains(t){return t>=this.start&&t<this.stop}toString(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()}get length(){return this.stop-this.start}}T.INVALID_INTERVAL=new T(-1,-2);class R{constructor(){this.intervals=null,this.readOnly=!1}first(e){return null===this.intervals||0===this.intervals.length?t.INVALID_TYPE:this.intervals[0].start}addOne(t){this.addInterval(new T(t,t+1))}addRange(t,e){this.addInterval(new T(t,e+1))}addInterval(t){if(null===this.intervals)this.intervals=[],this.intervals.push(t.clone());else{for(let e=0;e<this.intervals.length;e++){const n=this.intervals[e];if(t.stop<n.start)return void this.intervals.splice(e,0,t);if(t.stop===n.start)return void(this.intervals[e]=new T(t.start,n.stop));if(t.start<=n.stop)return this.intervals[e]=new T(Math.min(n.start,t.start),Math.max(n.stop,t.stop)),void this.reduce(e)}this.intervals.push(t.clone())}}addSet(t){return null!==t.intervals&&t.intervals.forEach((t=>this.addInterval(t)),this),this}reduce(t){if(t<this.intervals.length-1){const e=this.intervals[t],n=this.intervals[t+1];e.stop>=n.stop?(this.intervals.splice(t+1,1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new T(e.start,n.stop),this.intervals.splice(t+1,1))}}complement(t,e){const n=new R;return n.addInterval(new T(t,e+1)),null!==this.intervals&&this.intervals.forEach((t=>n.removeRange(t))),n}contains(t){if(null===this.intervals)return!1;for(let e=0;e<this.intervals.length;e++)if(this.intervals[e].contains(t))return!0;return!1}removeRange(t){if(t.start===t.stop-1)this.removeOne(t.start);else if(null!==this.intervals){let e=0;for(let n=0;n<this.intervals.length;n++){const n=this.intervals[e];if(t.stop<=n.start)return;if(t.start>n.start&&t.stop<n.stop){this.intervals[e]=new T(n.start,t.start);const i=new T(t.stop,n.stop);return void this.intervals.splice(e,0,i)}t.start<=n.start&&t.stop>=n.stop?(this.intervals.splice(e,1),e-=1):t.start<n.stop?this.intervals[e]=new T(n.start,t.start):t.stop<n.stop&&(this.intervals[e]=new T(t.stop,n.stop)),e+=1}}}removeOne(t){if(null!==this.intervals)for(let e=0;e<this.intervals.length;e++){const n=this.intervals[e];if(t<n.start)return;if(t===n.start&&t===n.stop-1)return void this.intervals.splice(e,1);if(t===n.start)return void(this.intervals[e]=new T(n.start+1,n.stop));if(t===n.stop-1)return void(this.intervals[e]=new T(n.start,n.stop-1));if(t<n.stop-1){const i=new T(n.start,t);return n.start=t+1,void this.intervals.splice(e,0,i)}}}toString(t,e,n){return t=t||null,e=e||null,n=n||!1,null===this.intervals?"{}":null!==t||null!==e?this.toTokenString(t,e):n?this.toCharString():this.toIndexString()}toCharString(){const e=[];for(let n=0;n<this.intervals.length;n++){const i=this.intervals[n];i.stop===i.start+1?i.start===t.EOF?e.push("<EOF>"):e.push("'"+String.fromCharCode(i.start)+"'"):e.push("'"+String.fromCharCode(i.start)+"'..'"+String.fromCharCode(i.stop-1)+"'")}return e.length>1?"{"+e.join(", ")+"}":e[0]}toIndexString(){const e=[];for(let n=0;n<this.intervals.length;n++){const i=this.intervals[n];i.stop===i.start+1?i.start===t.EOF?e.push("<EOF>"):e.push(i.start.toString()):e.push(i.start.toString()+".."+(i.stop-1).toString())}return e.length>1?"{"+e.join(", ")+"}":e[0]}toTokenString(t,e){const n=[];for(let i=0;i<this.intervals.length;i++){const s=this.intervals[i];for(let i=s.start;i<s.stop;i++)n.push(this.elementName(t,e,i))}return n.length>1?"{"+n.join(", ")+"}":n[0]}elementName(e,n,i){return i===t.EOF?"<EOF>":i===t.EPSILON?"<EPSILON>":e[i]||n[i]}get length(){return this.intervals.map((t=>t.length)).reduce(((t,e)=>t+e))}}class S{constructor(){this.atn=null,this.stateNumber=S.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null}toString(){return this.stateNumber}equals(t){return t instanceof S&&this.stateNumber===t.stateNumber}isNonGreedyExitState(){return!1}addTransition(t,e){void 0===e&&(e=-1),0===this.transitions.length?this.epsilonOnlyTransitions=t.isEpsilon:this.epsilonOnlyTransitions!==t.isEpsilon&&(this.epsilonOnlyTransitions=!1),-1===e?this.transitions.push(t):this.transitions.splice(e,1,t)}}S.INVALID_TYPE=0,S.BASIC=1,S.RULE_START=2,S.BLOCK_START=3,S.PLUS_BLOCK_START=4,S.STAR_BLOCK_START=5,S.TOKEN_START=6,S.RULE_STOP=7,S.BLOCK_END=8,S.STAR_LOOP_BACK=9,S.STAR_LOOP_ENTRY=10,S.PLUS_LOOP_BACK=11,S.LOOP_END=12,S.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"],S.INVALID_STATE_NUMBER=-1;class _ extends S{constructor(){return super(),this.stateType=S.RULE_STOP,this}}class A{constructor(t){if(null==t)throw"target cannot be null.";this.target=t,this.isEpsilon=!1,this.label=null}}A.EPSILON=1,A.RANGE=2,A.RULE=3,A.PREDICATE=4,A.ATOM=5,A.ACTION=6,A.SET=7,A.NOT_SET=8,A.WILDCARD=9,A.PRECEDENCE=10,A.serializationNames=["INVALID","EPSILON","RANGE","RULE","PREDICATE","ATOM","ACTION","SET","NOT_SET","WILDCARD","PRECEDENCE"],A.serializationTypes={EpsilonTransition:A.EPSILON,RangeTransition:A.RANGE,RuleTransition:A.RULE,PredicateTransition:A.PREDICATE,AtomTransition:A.ATOM,ActionTransition:A.ACTION,SetTransition:A.SET,NotSetTransition:A.NOT_SET,WildcardTransition:A.WILDCARD,PrecedencePredicateTransition:A.PRECEDENCE};class C extends A{constructor(t,e,n,i){super(t),this.ruleIndex=e,this.precedence=n,this.followState=i,this.serializationType=A.RULE,this.isEpsilon=!0}matches(t,e,n){return!1}}class v extends A{constructor(e,n){super(e),this.serializationType=A.SET,null!=n?this.label=n:(this.label=new R,this.label.addOne(t.INVALID_TYPE))}matches(t,e,n){return this.label.contains(t)}toString(){return this.label.toString()}}class L extends v{constructor(t,e){super(t,e),this.serializationType=A.NOT_SET}matches(t,e,n){return t>=e&&t<=n&&!super.matches(t,e,n)}toString(){return"~"+super.toString()}}class y extends A{constructor(t){super(t),this.serializationType=A.WILDCARD}matches(t,e,n){return t>=e&&t<=n}toString(){return"."}}class N extends A{constructor(t){super(t)}}class I{}class k extends I{}class O extends k{}class P extends O{get ruleContext(){throw new Error("missing interface implementation")}}class w extends O{}class b extends w{}const D={toStringTree:function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);let i=D.getNodeText(t,e);i=function(t,e){return t.replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r")}(i);const s=t.getChildCount();if(0===s)return i;let r="("+i+" ";s>0&&(i=D.toStringTree(t.getChild(0),e),r=r.concat(i));for(let n=1;n<s;n++)i=D.toStringTree(t.getChild(n),e),r=r.concat(" "+i);return r=r.concat(")"),r},getNodeText:function(e,n,i){if(n=n||null,null!==(i=i||null)&&(n=i.ruleNames),null!==n){if(e instanceof P){const t=e.ruleContext.getAltNumber();return 0!=t?n[e.ruleIndex]+":"+t:n[e.ruleIndex]}if(e instanceof b)return e.toString();if(e instanceof w&&null!==e.symbol)return e.symbol.text}const s=e.getPayload();return s instanceof t?s.text:e.getPayload().toString()},getChildren:function(t){const e=[];for(let n=0;n<t.getChildCount();n++)e.push(t.getChild(n));return e},getAncestors:function(t){let e=[];for(t=t.getParent();null!==t;)e=[t].concat(e),t=t.getParent();return e},findAllTokenNodes:function(t,e){return D.findAllNodes(t,e,!0)},findAllRuleNodes:function(t,e){return D.findAllNodes(t,e,!1)},findAllNodes:function(t,e,n){const i=[];return D._findAllNodes(t,e,n,i),i},_findAllNodes:function(t,e,n,i){n&&t instanceof w?t.symbol.type===e&&i.push(t):!n&&t instanceof P&&t.ruleIndex===e&&i.push(t);for(let s=0;s<t.getChildCount();s++)D._findAllNodes(t.getChild(s),e,n,i)},descendants:function(t){let e=[t];for(let n=0;n<t.getChildCount();n++)e=e.concat(D.descendants(t.getChild(n)));return e}},U=D;class M extends P{constructor(t,e){super(),this.parentCtx=t||null,this.invokingState=e||-1}depth(){let t=0,e=this;for(;null!==e;)e=e.parentCtx,t+=1;return t}isEmpty(){return-1===this.invokingState}getSourceInterval(){return T.INVALID_INTERVAL}get ruleContext(){return this}getPayload(){return this}getText(){return 0===this.getChildCount()?"":this.children.map((function(t){return t.getText()})).join("")}getAltNumber(){return 0}setAltNumber(t){}getChild(t){return null}getChildCount(){return 0}accept(t){return t.visitChildren(this)}toStringTree(t,e){return U.toStringTree(this,t,e)}toString(t,e){t=t||null,e=e||null;let n=this,i="[";for(;null!==n&&n!==e;){if(null===t)n.isEmpty()||(i+=n.invokingState);else{const e=n.ruleIndex;i+=e>=0&&e<t.length?t[e]:""+e}null===n.parentCtx||null===t&&n.parentCtx.isEmpty()||(i+=" "),n=n.parentCtx}return i+="]",i}}class H{constructor(t){this.cachedHashCode=t}isEmpty(){return this===H.EMPTY}hasEmptyPath(){return this.getReturnState(this.length-1)===H.EMPTY_RETURN_STATE}hashCode(){return this.cachedHashCode}updateHashCode(t){t.update(this.cachedHashCode)}}H.EMPTY=null,H.EMPTY_RETURN_STATE=2147483647,H.globalNodeCount=1,H.id=H.globalNodeCount,H.trace_atn_sim=!1;class F extends H{constructor(t,e){const n=new s;return n.update(t,e),super(n.finish()),this.parents=t,this.returnStates=e,this}isEmpty(){return this.returnStates[0]===H.EMPTY_RETURN_STATE}getParent(t){return this.parents[t]}getReturnState(t){return this.returnStates[t]}equals(t){return this===t||t instanceof F&&this.hashCode()===t.hashCode()&&e(this.returnStates,t.returnStates)&&e(this.parents,t.parents)}toString(){if(this.isEmpty())return"[]";{let t="[";for(let e=0;e<this.returnStates.length;e++)e>0&&(t+=", "),this.returnStates[e]!==H.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"}}get length(){return this.returnStates.length}}class B extends H{constructor(t,e){let n=0;const i=new s;null!==t?i.update(t,e):i.update(1),n=i.finish(),super(n),this.parentCtx=t,this.returnState=e}getParent(t){return this.parentCtx}getReturnState(t){return this.returnState}equals(t){return this===t||t instanceof B&&this.hashCode()===t.hashCode()&&this.returnState===t.returnState&&(null==this.parentCtx?null==t.parentCtx:this.parentCtx.equals(t.parentCtx))}toString(){const t=null===this.parentCtx?"":this.parentCtx.toString();return 0===t.length?this.returnState===H.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+t}get length(){return 1}static create(t,e){return e===H.EMPTY_RETURN_STATE&&null===t?H.EMPTY:new B(t,e)}}class V extends B{constructor(){super(null,H.EMPTY_RETURN_STATE)}isEmpty(){return!0}getParent(t){return null}getReturnState(t){return this.returnState}equals(t){return this===t}toString(){return"$"}}H.EMPTY=new V;const W="h-";class ${constructor(t,e){this.data={},this.hashFunction=t||r,this.equalsFunction=e||l}set(t,e){const n=W+this.hashFunction(t);if(n in this.data){const i=this.data[n];for(let n=0;n<i.length;n++){const s=i[n];if(this.equalsFunction(t,s.key)){const t=s.value;return s.value=e,t}}return i.push({key:t,value:e}),e}return this.data[n]=[{key:t,value:e}],e}containsKey(t){const e=W+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;e<n.length;e++){const i=n[e];if(this.equalsFunction(t,i.key))return!0}}return!1}get(t){const e=W+this.hashFunction(t);if(e in this.data){const n=this.data[e];for(let e=0;e<n.length;e++){const i=n[e];if(this.equalsFunction(t,i.key))return i.value}}return null}entries(){return Object.keys(this.data).filter((t=>t.startsWith(W))).flatMap((t=>this.data[t]),this)}getKeys(){return this.entries().map((t=>t.key))}getValues(){return this.entries().map((t=>t.value))}toString(){return"["+this.entries().map((t=>"{"+t.key+":"+t.value+"}")).join(", ")+"]"}get length(){return Object.keys(this.data).filter((t=>t.startsWith(W))).map((t=>this.data[t].length),this).reduce(((t,e)=>t+e),0)}}function Q(t,e){if(null==e&&(e=M.EMPTY),null===e.parentCtx||e===M.EMPTY)return H.EMPTY;const n=Q(t,e.parentCtx),i=t.states[e.invokingState].transitions[0];return B.create(n,i.followState.stateNumber)}function G(t,e,n){if(t.isEmpty())return t;let i=n.get(t)||null;if(null!==i)return i;if(i=e.get(t),null!==i)return n.set(t,i),i;let s=!1,r=[];for(let i=0;i<r.length;i++){const o=G(t.getParent(i),e,n);if(s||o!==t.getParent(i)){if(!s){r=[];for(let e=0;e<t.length;e++)r[e]=t.getParent(e);s=!0}r[i]=o}}if(!s)return e.add(t),n.set(t,t),t;let o=null;return o=0===r.length?H.EMPTY:1===r.length?B.create(r[0],t.getReturnState(0)):new F(r,t.returnStates),e.add(o),n.set(o,o),n.set(t,o),o}function K(t,e,n,i){if(t===e)return t;if(t instanceof B&&e instanceof B)return function(t,e,n,i){if(null!==i){let n=i.get(t,e);if(null!==n)return n;if(n=i.get(e,t),null!==n)return n}const s=function(t,e,n){if(n){if(t===H.EMPTY)return H.EMPTY;if(e===H.EMPTY)return H.EMPTY}else{if(t===H.EMPTY&&e===H.EMPTY)return H.EMPTY;if(t===H.EMPTY){const t=[e.returnState,H.EMPTY_RETURN_STATE],n=[e.parentCtx,null];return new F(n,t)}if(e===H.EMPTY){const e=[t.returnState,H.EMPTY_RETURN_STATE],n=[t.parentCtx,null];return new F(n,e)}}return null}(t,e,n);if(null!==s)return null!==i&&i.set(t,e,s),s;if(t.returnState===e.returnState){const s=K(t.parentCtx,e.parentCtx,n,i);if(s===t.parentCtx)return t;if(s===e.parentCtx)return e;const r=B.create(s,t.returnState);return null!==i&&i.set(t,e,r),r}{let n=null;if((t===e||null!==t.parentCtx&&t.parentCtx===e.parentCtx)&&(n=t.parentCtx),null!==n){const s=[t.returnState,e.returnState];t.returnState>e.returnState&&(s[0]=e.returnState,s[1]=t.returnState);const r=new F([n,n],s);return null!==i&&i.set(t,e,r),r}const s=[t.returnState,e.returnState];let r=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(s[0]=e.returnState,s[1]=t.returnState,r=[e.parentCtx,t.parentCtx]);const o=new F(r,s);return null!==i&&i.set(t,e,o),o}}(t,e,n,i);if(n){if(t instanceof V)return t;if(e instanceof V)return e}return t instanceof B&&(t=new F([t.getParent()],[t.returnState])),e instanceof B&&(e=new F([e.getParent()],[e.returnState])),function(t,e,n,i){if(null!==i){let n=i.get(t,e);if(null!==n)return H.trace_atn_sim&&console.log("mergeArrays a="+t+",b="+e+" -> previous"),n;if(n=i.get(e,t),null!==n)return H.trace_atn_sim&&console.log("mergeArrays a="+t+",b="+e+" -> previous"),n}let s=0,r=0,o=0,a=new Array(t.returnStates.length+e.returnStates.length).fill(0),l=new Array(t.returnStates.length+e.returnStates.length).fill(null);for(;s<t.returnStates.length&&r<e.returnStates.length;){const h=t.parents[s],u=e.parents[r];if(t.returnStates[s]===e.returnStates[r]){const e=t.returnStates[s];e===H.EMPTY_RETURN_STATE&&null===h&&null===u||null!==h&&null!==u&&h===u?(l[o]=h,a[o]=e):(l[o]=K(h,u,n,i),a[o]=e),s+=1,r+=1}else t.returnStates[s]<e.returnStates[r]?(l[o]=h,a[o]=t.returnStates[s],s+=1):(l[o]=u,a[o]=e.returnStates[r],r+=1);o+=1}if(s<t.returnStates.length)for(let e=s;e<t.returnStates.length;e++)l[o]=t.parents[e],a[o]=t.returnStates[e],o+=1;else for(let t=r;t<e.returnStates.length;t++)l[o]=e.parents[t],a[o]=e.returnStates[t],o+=1;if(o<l.length){if(1===o){const n=B.create(l[0],a[0]);return null!==i&&i.set(t,e,n),n}l=l.slice(0,o),a=a.slice(0,o)}const h=new F(l,a);return h.equals(t)?(null!==i&&i.set(t,e,t),H.trace_atn_sim&&console.log("mergeArrays a="+t+",b="+e+" -> a"),t):h.equals(e)?(null!==i&&i.set(t,e,e),H.trace_atn_sim&&console.log("mergeArrays a="+t+",b="+e+" -> b"),e):(function(t){const e=new $;for(let n=0;n<t.length;n++){const i=t[n];e.containsKey(i)||e.set(i,i)}for(let n=0;n<t.length;n++)t[n]=e.get(t[n])}(l),null!==i&&i.set(t,e,h),H.trace_atn_sim&&console.log("mergeArrays a="+t+",b="+e+" -> "+h),h)}(t,e,n,i)}class q{constructor(){this.data=[]}add(t){this.data[t]=!0}or(t){Object.keys(t.data).map((t=>this.add(t)),this)}remove(t){delete this.data[t]}has(t){return!0===this.data[t]}values(){return Object.keys(this.data)}minValue(){return Math.min.apply(null,this.values())}hashCode(){return s.hashStuff(this.values())}equals(t){return t instanceof q&&e(this.data,t.data)}toString(){return"{"+this.values().join(", ")+"}"}get length(){return this.values().length}}class Y{constructor(t){this.atn=t}getDecisionLookahead(t){if(null===t)return null;const e=t.transitions.length,n=[];for(let i=0;i<e;i++){n[i]=new R;const e=new d,s=!1;this._LOOK(t.transition(i).target,null,H.EMPTY,n[i],e,new q,s,!1),(0===n[i].length||n[i].contains(Y.HIT_PRED))&&(n[i]=null)}return n}LOOK(t,e,n){const i=new R,s=null!==(n=n||null)?Q(t.atn,n):null;return this._LOOK(t,e,s,i,new d,new q,!0,!0),i}_LOOK(e,n,i,s,r,o,a,l){const h=new E({state:e,alt:0,context:i},null);if(!r.has(h)){if(r.add(h),e===n){if(null===i)return void s.addOne(t.EPSILON);if(i.isEmpty()&&l)return void s.addOne(t.EOF)}if(e instanceof _){if(null===i)return void s.addOne(t.EPSILON);if(i.isEmpty()&&l)return void s.addOne(t.EOF);if(i!==H.EMPTY){const t=o.has(e.ruleIndex);try{o.remove(e.ruleIndex);for(let t=0;t<i.length;t++){const e=this.atn.states[i.getReturnState(t)];this._LOOK(e,n,i.getParent(t),s,r,o,a,l)}}finally{t&&o.add(e.ruleIndex)}return}}for(let h=0;h<e.transitions.length;h++){const u=e.transitions[h];if(u.constructor===C){if(o.has(u.target.ruleIndex))continue;const t=B.create(i,u.followState.stateNumber);try{o.add(u.target.ruleIndex),this._LOOK(u.target,n,t,s,r,o,a,l)}finally{o.remove(u.target.ruleIndex)}}else if(u instanceof N)a?this._LOOK(u.target,n,i,s,r,o,a,l):s.addOne(Y.HIT_PRED);else if(u.isEpsilon)this._LOOK(u.target,n,i,s,r,o,a,l);else if(u.constructor===y)s.addRange(t.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{let e=u.label;null!==e&&(u instanceof L&&(e=e.complement(t.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),s.addSet(e))}}}}}Y.HIT_PRED=t.INVALID_TYPE;class z{constructor(t,e){this.grammarType=t,this.maxTokenType=e,this.states=[],this.decisionToState=[],this.ruleToStartState=[],this.ruleToStopState=null,this.modeNameToStartState={},this.ruleToTokenType=null,this.lexerActions=null,this.modeToStartState=[]}nextTokensInContext(t,e){return new Y(this).LOOK(t,null,e)}nextTokensNoContext(t){return null!==t.nextTokenWithinRule||(t.nextTokenWithinRule=this.nextTokensInContext(t,null),t.nextTokenWithinRule.readOnly=!0),t.nextTokenWithinRule}nextTokens(t,e){return void 0===e?this.nextTokensNoContext(t):this.nextTokensInContext(t,e)}addState(t){null!==t&&(t.atn=this,t.stateNumber=this.states.length),this.states.push(t)}removeState(t){this.states[t.stateNumber]=null}defineDecisionState(t){return this.decisionToState.push(t),t.decision=this.decisionToState.length-1,t.decision}getDecisionState(t){return 0===this.decisionToState.length?null:this.decisionToState[t]}getExpectedTokens(e,n){if(e<0||e>=this.states.length)throw"Invalid state number.";const i=this.states[e];let s=this.nextTokens(i);if(!s.contains(t.EPSILON))return s;const r=new R;for(r.addSet(s),r.removeOne(t.EPSILON);null!==n&&n.invokingState>=0&&s.contains(t.EPSILON);){const e=this.states[n.invokingState].transitions[0];s=this.nextTokens(e.followState),r.addSet(s),r.removeOne(t.EPSILON),n=n.parentCtx}return s.contains(t.EPSILON)&&r.addOne(t.EOF),r}}z.INVALID_ALT_NUMBER=0;class j extends S{constructor(){super(),this.stateType=S.BASIC}}class J extends S{constructor(){return super(),this.decision=-1,this.nonGreedy=!1,this}}class X extends J{constructor(){return super(),this.endState=null,this}}class Z extends S{constructor(){return super(),this.stateType=S.BLOCK_END,this.startState=null,this}}class tt extends S{constructor(){return super(),this.stateType=S.LOOP_END,this.loopBackState=null,this}}class et extends S{constructor(){return super(),this.stateType=S.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}}class nt extends J{constructor(){return super(),this.stateType=S.TOKEN_START,this}}class it extends J{constructor(){return super(),this.stateType=S.PLUS_LOOP_BACK,this}}class st extends S{constructor(){return super(),this.stateType=S.STAR_LOOP_BACK,this}}class rt extends J{constructor(){return super(),this.stateType=S.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}}class ot extends X{constructor(){return super(),this.stateType=S.PLUS_BLOCK_START,this.loopBackState=null,this}}class at extends X{constructor(){return super(),this.stateType=S.STAR_BLOCK_START,this}}class lt extends X{constructor(){return super(),this.stateType=S.BLOCK_START,this}}class ht extends A{constructor(t,e){super(t),this.label_=e,this.label=this.makeLabel(),this.serializationType=A.ATOM}makeLabel(){const t=new R;return t.addOne(this.label_),t}matches(t,e,n){return this.label_===t}toString(){return this.label_}}class ut extends A{constructor(t,e,n){super(t),this.serializationType=A.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel()}makeLabel(){const t=new R;return t.addRange(this.start,this.stop),t}matches(t,e,n){return t>=this.start&&t<=this.stop}toString(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"}}class ct extends A{constructor(t,e,n,i){super(t),this.serializationType=A.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==i&&i,this.isEpsilon=!0}matches(t,e,n){return!1}toString(){return"action_"+this.ruleIndex+":"+this.actionIndex}}class dt extends A{constructor(t,e){super(t),this.serializationType=A.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e}matches(t,e,n){return!1}toString(){return"epsilon"}}class pt extends p{constructor(t,e,n){super(),this.ruleIndex=void 0===t?-1:t,this.predIndex=void 0===e?-1:e,this.isCtxDependent=void 0!==n&&n}evaluate(t,e){const n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)}updateHashCode(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)}equals(t){return this===t||t instanceof pt&&this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent}toString(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"}}p.NONE=new pt;class gt extends N{constructor(t,e,n,i){super(t),this.serializationType=A.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=i,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new pt(this.ruleIndex,this.predIndex,this.isCtxDependent)}toString(){return"pred_"+this.ruleIndex+":"+this.predIndex}}class xt extends p{constructor(t){super(),this.precedence=void 0===t?0:t}evaluate(t,e){return t.precpred(e,this.precedence)}evalPrecedence(t,e){return t.precpred(e,this.precedence)?p.NONE:null}compareTo(t){return this.precedence-t.precedence}updateHashCode(t){t.update(this.precedence)}equals(t){return this===t||t instanceof xt&&this.precedence===t.precedence}toString(){return"{"+this.precedence+">=prec}?"}}p.PrecedencePredicate=xt;class ft extends N{constructor(t,e){super(t),this.serializationType=A.PRECEDENCE,this.precedence=e,this.isEpsilon=!0}matches(t,e,n){return!1}getPredicate(){return new xt(this.precedence)}toString(){return this.precedence+" >= _p"}}class mt{constructor(t){void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions}}mt.defaultOptions=new mt,mt.defaultOptions.readOnly=!0;class Et{constructor(t){this.actionType=t,this.isPositionDependent=!1}hashCode(){const t=new s;return this.updateHashCode(t),t.finish()}updateHashCode(t){t.update(this.actionType)}equals(t){return this===t}}class Tt extends Et{constructor(){super(6)}execute(t){t.skip()}toString(){return"skip"}}Tt.INSTANCE=new Tt;class Rt extends Et{constructor(t){super(0),this.channel=t}execute(t){t._channel=this.channel}updateHashCode(t){t.update(this.actionType,this.channel)}equals(t){return this===t||t instanceof Rt&&this.channel===t.channel}toString(){return"channel("+this.channel+")"}}class St extends Et{constructor(t,e){super(1),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0}execute(t){t.action(null,this.ruleIndex,this.actionIndex)}updateHashCode(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)}equals(t){return this===t||t instanceof St&&this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex}}class _t extends Et{constructor(){super(3)}execute(t){t.more()}toString(){return"more"}}_t.INSTANCE=new _t;class At extends Et{constructor(t){super(7),this.type=t}execute(t){t.type=this.type}updateHashCode(t){t.update(this.actionType,this.type)}equals(t){return this===t||t instanceof At&&this.type===t.type}toString(){return"type("+this.type+")"}}class Ct extends Et{constructor(t){super(5),this.mode=t}execute(t){t.pushMode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Ct&&this.mode===t.mode}toString(){return"pushMode("+this.mode+")"}}class vt extends Et{constructor(){super(4)}execute(t){t.popMode()}toString(){return"popMode"}}vt.INSTANCE=new vt;class Lt extends Et{constructor(t){super(2),this.mode=t}execute(t){t.mode(this.mode)}updateHashCode(t){t.update(this.actionType,this.mode)}equals(t){return this===t||t instanceof Lt&&this.mode===t.mode}toString(){return"mode("+this.mode+")"}}function yt(t,e){const n=[];return n[t-1]=e,n.map((function(t){return e}))}class Nt{constructor(t){null==t&&(t=mt.defaultOptions),this.deserializationOptions=t,this.stateFactories=null,this.actionFactories=null}deserialize(t){const e=this.reset(t);this.checkVersion(e),e&&this.skipUUID();const n=this.readATN();this.readStates(n,e),this.readRules(n,e),this.readModes(n);const i=[];return this.readSets(n,i,this.readInt.bind(this)),e&&this.readSets(n,i,this.readInt32.bind(this)),this.readEdges(n,i),this.readDecisions(n),this.readLexerActions(n,e),this.markPrecedenceDecisions(n),this.verifyATN(n),this.deserializationOptions.generateRuleBypassTransitions&&1===n.grammarType&&(this.generateRuleBypassTransitions(n),this.verifyATN(n)),n}reset(t){if(3===(t.charCodeAt?t.charCodeAt(0):t[0])){const e=function(t){const e=t.charCodeAt(0);return e>1?e-2:e+65534},n=t.split("").map(e);return n[0]=t.charCodeAt(0),this.data=n,this.pos=0,!0}return this.data=t,this.pos=0,!1}skipUUID(){let t=0;for(;t++<8;)this.readInt()}checkVersion(t){const e=this.readInt();if(!t&&4!==e)throw"Could not deserialize ATN with version "+e+" (expected 4)."}readATN(){const t=this.readInt(),e=this.readInt();return new z(t,e)}readStates(t,e){let n,i,s;const r=[],o=[],a=this.readInt();for(let n=0;n<a;n++){const n=this.readInt();if(n===S.INVALID_TYPE){t.addState(null);continue}let i=this.readInt();e&&65535===i&&(i=-1);const s=this.stateFactory(n,i);if(n===S.LOOP_END){const t=this.readInt();r.push([s,t])}else if(s instanceof X){const t=this.readInt();o.push([s,t])}t.addState(s)}for(n=0;n<r.length;n++)i=r[n],i[0].loopBackState=t.states[i[1]];for(n=0;n<o.length;n++)i=o[n],i[0].endState=t.states[i[1]];let l=this.readInt();for(n=0;n<l;n++)s=this.readInt(),t.states[s].nonGreedy=!0;let h=this.readInt();for(n=0;n<h;n++)s=this.readInt(),t.states[s].isPrecedenceRule=!0}readRules(e,n){let i;const s=this.readInt();for(0===e.grammarType&&(e.ruleToTokenType=yt(s,0)),e.ruleToStartState=yt(s,0),i=0;i<s;i++){const s=this.readInt();if(e.ruleToStartState[i]=e.states[s],0===e.grammarType){let s=this.readInt();n&&65535===s&&(s=t.EOF),e.ruleToTokenType[i]=s}}for(e.ruleToStopState=yt(s,0),i=0;i<e.states.length;i++){const t=e.states[i];t instanceof _&&(e.ruleToStopState[t.ruleIndex]=t,e.ruleToStartState[t.ruleIndex].stopState=t)}}readModes(t){const e=this.readInt();for(let n=0;n<e;n++){let e=this.readInt();t.modeToStartState.push(t.states[e])}}readSets(t,e,n){const i=this.readInt();for(let t=0;t<i;t++){const t=new R;e.push(t);const i=this.readInt();0!==this.readInt()&&t.addOne(-1);for(let e=0;e<i;e++){const e=n(),i=n();t.addRange(e,i)}}}readEdges(t,e){let n,i,s,r,o;const a=this.readInt();for(n=0;n<a;n++){const n=this.readInt(),i=this.readInt(),s=this.readInt(),o=this.readInt(),a=this.readInt(),l=this.readInt();r=this.edgeFactory(t,s,n,i,o,a,l,e),t.states[n].addTransition(r)}for(n=0;n<t.states.length;n++)for(s=t.states[n],i=0;i<s.transitions.length;i++){const e=s.transitions[i];if(!(e instanceof C))continue;let n=-1;t.ruleToStartState[e.target.ruleIndex].isPrecedenceRule&&0===e.precedence&&(n=e.target.ruleIndex),r=new dt(e.followState,n),t.ruleToStopState[e.target.ruleIndex].addTransition(r)}for(n=0;n<t.states.length;n++){if(s=t.states[n],s instanceof X){if(null===s.endState)throw"IllegalState";if(null!==s.endState.startState)throw"IllegalState";s.endState.startState=s}if(s instanceof it)for(i=0;i<s.transitions.length;i++)o=s.transitions[i].target,o instanceof ot&&(o.loopBackState=s);else if(s instanceof st)for(i=0;i<s.transitions.length;i++)o=s.transitions[i].target,o instanceof rt&&(o.loopBackState=s)}}readDecisions(t){const e=this.readInt();for(let n=0;n<e;n++){const e=this.readInt(),i=t.states[e];t.decisionToState.push(i),i.decision=n}}readLexerActions(t,e){if(0===t.grammarType){const n=this.readInt();t.lexerActions=yt(n,null);for(let i=0;i<n;i++){const n=this.readInt();let s=this.readInt();e&&65535===s&&(s=-1);let r=this.readInt();e&&65535===r&&(r=-1),t.lexerActions[i]=this.lexerActionFactory(n,s,r)}}}generateRuleBypassTransitions(t){let e;const n=t.ruleToStartState.length;for(e=0;e<n;e++)t.ruleToTokenType[e]=t.maxTokenType+e+1;for(e=0;e<n;e++)this.generateRuleBypassTransition(t,e)}generateRuleBypassTransition(t,e){let n,i;const s=new lt;s.ruleIndex=e,t.addState(s);const r=new Z;r.ruleIndex=e,t.addState(r),s.endState=r,t.defineDecisionState(s),r.startState=s;let o=null,a=null;if(t.ruleToStartState[e].isPrecedenceRule){for(a=null,n=0;n<t.states.length;n++)if(i=t.states[n],this.stateIsEndStateFor(i,e)){a=i,o=i.loopBackState.transitions[0];break}if(null===o)throw"Couldn't identify final state of the precedence rule prefix section."}else a=t.ruleToStopState[e];for(n=0;n<t.states.length;n++){i=t.states[n];for(let t=0;t<i.transitions.length;t++){const e=i.transitions[t];e!==o&&e.target===a&&(e.target=r)}}const l=t.ruleToStartState[e],h=l.transitions.length;for(;h>0;)s.addTransition(l.transitions[h-1]),l.transitions=l.transitions.slice(-1);t.ruleToStartState[e].addTransition(new dt(s)),r.addTransition(new dt(a));const u=new j;t.addState(u),u.addTransition(new ht(r,t.ruleToTokenType[e])),s.addTransition(new dt(u))}stateIsEndStateFor(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof rt))return null;const n=t.transitions[t.transitions.length-1].target;return n instanceof tt&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof _?t:null}markPrecedenceDecisions(t){for(let e=0;e<t.states.length;e++){const n=t.states[e];if(n instanceof rt&&t.ruleToStartState[n.ruleIndex].isPrecedenceRule){const t=n.transitions[n.transitions.length-1].target;t instanceof tt&&t.epsilonOnlyTransitions&&t.transitions[0].target instanceof _&&(n.isPrecedenceDecision=!0)}}}verifyATN(t){if(this.deserializationOptions.verifyATN)for(let e=0;e<t.states.length;e++){const n=t.states[e];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof ot)this.checkCondition(null!==n.loopBackState);else if(n instanceof rt)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof at)this.checkCondition(n.transitions[1].target instanceof tt),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof tt))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof at),this.checkCondition(n.nonGreedy)}else n instanceof st?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof rt)):n instanceof tt?this.checkCondition(null!==n.loopBackState):n instanceof et?this.checkCondition(null!==n.stopState):n instanceof X?this.checkCondition(null!==n.endState):n instanceof Z?this.checkCondition(null!==n.startState):n instanceof J?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof _)}}checkCondition(t,e){if(!t)throw null==e&&(e="IllegalState"),e}readInt(){return this.data[this.pos++]}readInt32(){return this.readInt()|this.readInt()<<16}edgeFactory(e,n,i,s,r,o,a,l){const h=e.states[s];switch(n){case A.EPSILON:return new dt(h);case A.RANGE:return new ut(h,0!==a?t.EOF:r,o);case A.RULE:return new C(e.states[r],o,a,h);case A.PREDICATE:return new gt(h,r,o,0!==a);case A.PRECEDENCE:return new ft(h,r);case A.ATOM:return new ht(h,0!==a?t.EOF:r);case A.ACTION:return new ct(h,r,o,0!==a);case A.SET:return new v(h,l[r]);case A.NOT_SET:return new L(h,l[r]);case A.WILDCARD:return new y(h);default:throw"The specified transition type: "+n+" is not valid."}}stateFactory(t,e){if(null===this.stateFactories){const t=[];t[S.INVALID_TYPE]=null,t[S.BASIC]=()=>new j,t[S.RULE_START]=()=>new et,t[S.BLOCK_START]=()=>new lt,t[S.PLUS_BLOCK_START]=()=>new ot,t[S.STAR_BLOCK_START]=()=>new at,t[S.TOKEN_START]=()=>new nt,t[S.RULE_STOP]=()=>new _,t[S.BLOCK_END]=()=>new Z,t[S.STAR_LOOP_BACK]=()=>new st,t[S.STAR_LOOP_ENTRY]=()=>new rt,t[S.PLUS_LOOP_BACK]=()=>new it,t[S.LOOP_END]=()=>new tt,this.stateFactories=t}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";{const n=this.stateFactories[t]();if(null!==n)return n.ruleIndex=e,n}}lexerActionFactory(t,e,n){if(null===this.actionFactories){const t=[];t[0]=(t,e)=>new Rt(t),t[1]=(t,e)=>new St(t,e),t[2]=(t,e)=>new Lt(t),t[3]=(t,e)=>_t.INSTANCE,t[4]=(t,e)=>vt.INSTANCE,t[5]=(t,e)=>new Ct(t),t[6]=(t,e)=>Tt.INSTANCE,t[7]=(t,e)=>new At(t),this.actionFactories=t}if(t>this.actionFactories.length||null===this.actionFactories[t])throw"The specified lexer action type "+t+" is not valid.";return this.actionFactories[t](e,n)}}class It{syntaxError(t,e,n,i,s,r){}reportAmbiguity(t,e,n,i,s,r,o){}reportAttemptingFullContext(t,e,n,i,s,r){}reportContextSensitivity(t,e,n,i,s,r){}}class kt extends It{constructor(){super()}syntaxError(t,e,n,i,s,r){console.error("line "+n+":"+i+" "+s)}}kt.INSTANCE=new kt;class Ot extends It{constructor(t){if(super(),null===t)throw"delegates";return this.delegates=t,this}syntaxError(t,e,n,i,s,r){this.delegates.map((o=>o.syntaxError(t,e,n,i,s,r)))}reportAmbiguity(t,e,n,i,s,r,o){this.delegates.map((a=>a.reportAmbiguity(t,e,n,i,s,r,o)))}reportAttemptingFullContext(t,e,n,i,s,r){this.delegates.map((o=>o.reportAttemptingFullContext(t,e,n,i,s,r)))}reportContextSensitivity(t,e,n,i,s,r){this.delegates.map((o=>o.reportContextSensitivity(t,e,n,i,s,r)))}}class Pt{constructor(){this._listeners=[kt.INSTANCE],this._interp=null,this._stateNumber=-1}checkVersion(t){const e="4.13.1";e!==t&&console.log("ANTLR runtime and generated code versions disagree: "+e+"!="+t)}addErrorListener(t){this._listeners.push(t)}removeErrorListeners(){this._listeners=[]}getLiteralNames(){return Object.getPrototypeOf(this).constructor.literalNames||[]}getSymbolicNames(){return Object.getPrototypeOf(this).constructor.symbolicNames||[]}getTokenNames(){if(!this.tokenNames){const t=this.getLiteralNames(),e=this.getSymbolicNames(),n=t.length>e.length?t.length:e.length;this.tokenNames=[];for(let i=0;i<n;i++)this.tokenNames[i]=t[i]||e[i]||"<INVALID"}return this.tokenNames}getTokenTypeMap(){const e=this.getTokenNames();if(null===e)throw"The current recognizer does not provide a list of token names.";let n=this.tokenTypeMapCache[e];return void 0===n&&(n=e.reduce((function(t,e,n){t[e]=n})),n.EOF=t.EOF,this.tokenTypeMapCache[e]=n),n}getRuleIndexMap(){const t=this.ruleNames;if(null===t)throw"The current recognizer does not provide a list of rule names.";let e=this.ruleIndexMapCache[t];return void 0===e&&(e=t.reduce((function(t,e,n){t[e]=n})),this.ruleIndexMapCache[t]=e),e}getTokenType(e){const n=this.getTokenTypeMap()[e];return void 0!==n?n:t.INVALID_TYPE}getErrorHeader(t){return"line "+t.getOffendingToken().line+":"+t.getOffendingToken().column}getTokenErrorDisplay(e){if(null===e)return"<no token>";let n=e.text;return null===n&&(n=e.type===t.EOF?"<EOF>":"<"+e.type+">"),n=n.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"),"'"+n+"'"}getErrorListenerDispatch(){return new Ot(this._listeners)}sempred(t,e,n){return!0}precpred(t,e){return!0}get atn(){return this._interp.atn}get state(){return this._stateNumber}set state(t){this._stateNumber=t}}Pt.tokenTypeMapCache={},Pt.ruleIndexMapCache={};class wt extends t{constructor(e,n,i,s,r){super(),this.source=void 0!==e?e:wt.EMPTY_SOURCE,this.type=void 0!==n?n:null,this.channel=void 0!==i?i:t.DEFAULT_CHANNEL,this.start=void 0!==s?s:-1,this.stop=void 0!==r?r:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=e[0].line,this.column=e[0].column):this.column=-1}clone(){const t=new wt(this.source,this.type,this.channel,this.start,this.stop);return t.tokenIndex=this.tokenIndex,t.line=this.line,t.column=this.column,t.text=this.text,t}cloneWithType(e){const n=new wt(this.source,e,this.channel,this.start,this.stop);return n.tokenIndex=this.tokenIndex,n.line=this.line,n.column=this.column,e===t.EOF&&(n.text=""),n}toString(){let t=this.text;return t=null!==t?t.replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t"):"<no text>","[@"+this.tokenIndex+","+this.start+":"+this.stop+"='"+t+"',<"+this.type+">"+(this.channel>0?",channel="+this.channel:"")+","+this.line+":"+this.column+"]"}get text(){if(null!==this._text)return this._text;const t=this.getInputStream();if(null===t)return null;const e=t.size;return this.start<e&&this.stop<e?t.getText(this.start,this.stop):"<EOF>"}set text(t){this._text=t}}wt.EMPTY_SOURCE=[null,null];class bt{}class Dt extends bt{constructor(t){super(),this.copyText=void 0!==t&&t}create(t,e,n,i,s,r,o,a){const l=new wt(t,e,i,s,r);return l.line=o,l.column=a,null!==n?l.text=n:this.copyText&&null!==t[1]&&(l.text=t[1].getText(s,r)),l}createThin(t,e){const n=new wt(null,t);return n.text=e,n}}Dt.DEFAULT=new Dt;class Ut extends Error{constructor(t){super(t.message),Error.captureStackTrace&&Error.captureStackTrace(this,Ut),this.message=t.message,this.recognizer=t.recognizer,this.input=t.input,this.ctx=t.ctx,this.offendingToken=null,this.offendingState=-1,null!==this.recognizer&&(this.offendingState=this.recognizer.state)}getExpectedTokens(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null}toString(){return this.message}}class Mt extends Ut{constructor(t,e,n,i){super({message:"",recognizer:t,input:e,ctx:null}),this.startIndex=n,this.deadEndConfigs=i}toString(){let t="";return this.startIndex>=0&&this.startIndex<this.input.size&&(t=this.input.getText(new T(this.startIndex,this.startIndex))),"LexerNoViableAltException"+t}}class Ht extends Pt{constructor(e){super(),this._input=e,this._factory=Dt.DEFAULT,this._tokenFactorySourcePair=[this,e],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=t.DEFAULT_CHANNEL,this._type=t.INVALID_TYPE,this._modeStack=[],this._mode=Ht.DEFAULT_MODE,this._text=null}reset(){null!==this._input&&this._input.seek(0),this._token=null,this._type=t.INVALID_TYPE,this._channel=t.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=Ht.DEFAULT_MODE,this._modeStack=[],this._interp.reset()}nextToken(){if(null===this._input)throw"nextToken requires a non-null input stream.";const e=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=t.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;let e=!1;for(;;){this._type=t.INVALID_TYPE;let n=Ht.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(t){if(!(t instanceof Ut))throw console.log(t.stack),t;this.notifyListeners(t),this.recover(t)}if(this._input.LA(1)===t.EOF&&(this._hitEOF=!0),this._type===t.INVALID_TYPE&&(this._type=n),this._type===Ht.SKIP){e=!0;break}if(this._type!==Ht.MORE)break}if(!e)return null===this._token&&this.emit(),this._token}}finally{this._input.release(e)}}skip(){this._type=Ht.SKIP}more(){this._type=Ht.MORE}mode(t){this._mode=t}pushMode(t){this._interp.debug&&console.log("pushMode "+t),this._modeStack.push(this._mode),this.mode(t)}popMode(){if(0===this._modeStack.length)throw"Empty Stack";return this._interp.debug&&console.log("popMode back to "+this._modeStack.slice(0,-1)),this.mode(this._modeStack.pop()),this._mode}emitToken(t){this._token=t}emit(){const t=this._factory.create(this._tokenFactorySourcePair,this._type,this._text,this._channel,this._tokenStartCharIndex,this.getCharIndex()-1,this._tokenStartLine,this._tokenStartColumn);return this.emitToken(t),t}emitEOF(){const e=this.column,n=this.line,i=this._factory.create(this._tokenFactorySourcePair,t.EOF,null,t.DEFAULT_CHANNEL,this._input.index,this._input.index-1,n,e);return this.emitToken(i),i}getCharIndex(){return this._input.index}getAllTokens(){const e=[];let n=this.nextToken();for(;n.type!==t.EOF;)e.push(n),n=this.nextToken();return e}notifyListeners(t){const e=this._tokenStartCharIndex,n=this._input.index,i=this._input.getText(e,n),s="token recognition error at: '"+this.getErrorDisplay(i)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,s,t)}getErrorDisplay(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n]);return e.join("")}getErrorDisplayForChar(e){return e.charCodeAt(0)===t.EOF?"<EOF>":"\n"===e?"\\n":"\t"===e?"\\t":"\r"===e?"\\r":e}getCharErrorDisplay(t){return"'"+this.getErrorDisplayForChar(t)+"'"}recover(e){this._input.LA(1)!==t.EOF&&(e instanceof Mt?this._interp.consume(this._input):this._input.consume())}get inputStream(){return this._input}set inputStream(t){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=t,this._tokenFactorySourcePair=[this,this._input]}get sourceName(){return this._input.sourceName}get type(){return this._type}set type(t){this._type=t}get line(){return this._interp.line}set line(t){this._interp.line=t}get column(){return this._interp.column}set column(t){this._interp.column=t}get text(){return null!==this._text?this._text:this._interp.getText(this._input)}set text(t){this._text=t}}function Ft(t){return t.hashCodeForConfigSet()}function Bt(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}Ht.DEFAULT_MODE=0,Ht.MORE=-2,Ht.SKIP=-3,Ht.DEFAULT_TOKEN_CHANNEL=t.DEFAULT_CHANNEL,Ht.HIDDEN=t.HIDDEN_CHANNEL,Ht.MIN_CHAR_VALUE=0,Ht.MAX_CHAR_VALUE=1114111;class Vt{constructor(t){this.configLookup=new d(Ft,Bt),this.fullCtx=void 0===t||t,this.readOnly=!1,this.configs=[],this.uniqueAlt=0,this.conflictingAlts=null,this.hasSemanticContext=!1,this.dipsIntoOuterContext=!1,this.cachedHashCode=-1}add(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==p.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);const n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;const i=!this.fullCtx,s=K(n.context,t.context,i,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=s,!0}getStates(){const t=new d;for(let e=0;e<this.configs.length;e++)t.add(this.configs[e].state);return t}getPredicates(){const t=[];for(let e=0;e<this.configs.length;e++){const n=this.configs[e].semanticContext;n!==p.NONE&&t.push(n.semanticContext)}return t}optimizeConfigs(t){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(let e=0;e<this.configs.length;e++){const n=this.configs[e];n.context=t.getCachedContext(n.context)}}addAll(t){for(let e=0;e<t.length;e++)this.add(t[e]);return!1}equals(t){return this===t||t instanceof Vt&&e(this.configs,t.configs)&&this.fullCtx===t.fullCtx&&this.uniqueAlt===t.uniqueAlt&&this.conflictingAlts===t.conflictingAlts&&this.hasSemanticContext===t.hasSemanticContext&&this.dipsIntoOuterContext===t.dipsIntoOuterContext}hashCode(){const t=new s;return t.update(this.configs),t.finish()}updateHashCode(t){this.readOnly?(-1===this.cachedHashCode&&(this.cachedHashCode=this.hashCode()),t.update(this.cachedHashCode)):t.update(this.hashCode())}isEmpty(){return 0===this.configs.length}contains(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(t)}containsFast(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(t)}clear(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new d}setReadonly(t){this.readOnly=t,t&&(this.configLookup=null)}toString(){return u(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==z.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")}get items(){return this.configs}get length(){return this.configs.length}}class Wt{constructor(t,e){return null===t&&(t=-1),null===e&&(e=new Vt),this.stateNumber=t,this.configs=e,this.edges=null,this.isAcceptState=!1,this.prediction=0,this.lexerActionExecutor=null,this.requiresFullContext=!1,this.predicates=null,this}getAltSet(){const t=new d;if(null!==this.configs)for(let e=0;e<this.configs.length;e++){const n=this.configs[e];t.add(n.alt)}return 0===t.length?null:t}equals(t){return this===t||t instanceof Wt&&this.configs.equals(t.configs)}toString(){let t=this.stateNumber+":"+this.configs;return this.isAcceptState&&(t+="=>",null!==this.predicates?t+=this.predicates:t+=this.prediction),t}hashCode(){const t=new s;return t.update(this.configs),t.finish()}}class $t{constructor(t,e){return this.atn=t,this.sharedContextCache=e,this}getCachedContext(t){if(null===this.sharedContextCache)return t;const e=new $;return G(t,this.sharedContextCache,e)}}$t.ERROR=new Wt(2147483647,new Vt);class Qt extends Vt{constructor(){super(),this.configLookup=new d}}class Gt extends E{constructor(t,e){super(t,e);const n=t.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==e?e.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==e&&this.checkNonGreedyDecision(e,this.state),this.hashCodeForConfigSet=Gt.prototype.hashCode,this.equalsForConfigSet=Gt.prototype.equals,this}updateHashCode(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)}equals(t){return this===t||t instanceof Gt&&this.passedThroughNonGreedyDecision===t.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(t.lexerActionExecutor):!t.lexerActionExecutor)&&super.equals(t)}checkNonGreedyDecision(t,e){return t.passedThroughNonGreedyDecision||e instanceof J&&e.nonGreedy}}class Kt extends Et{constructor(t,e){super(e.actionType),this.offset=t,this.action=e,this.isPositionDependent=!0}execute(t){this.action.execute(t)}updateHashCode(t){t.update(this.actionType,this.offset,this.action)}equals(t){return this===t||t instanceof Kt&&this.offset===t.offset&&this.action===t.action}}class qt{constructor(t){return this.lexerActions=null===t?[]:t,this.cachedHashCode=s.hashStuff(t),this}fixOffsetBeforeMatch(t){let e=null;for(let n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof Kt||(null===e&&(e=this.lexerActions.concat([])),e[n]=new Kt(t,this.lexerActions[n]));return null===e?this:new qt(e)}execute(t,e,n){let i=!1;const s=e.index;try{for(let r=0;r<this.lexerActions.length;r++){let o=this.lexerActions[r];if(o instanceof Kt){const t=o.offset;e.seek(n+t),o=o.action,i=n+t!==s}else o.isPositionDependent&&(e.seek(s),i=!1);o.execute(t)}}finally{i&&e.seek(s)}}hashCode(){return this.cachedHashCode}updateHashCode(t){t.update(this.cachedHashCode)}equals(t){if(this===t)return!0;if(t instanceof qt){if(this.cachedHashCode!=t.cachedHashCode)return!1;if(this.lexerActions.length!=t.lexerActions.length)return!1;{const e=this.lexerActions.length;for(let n=0;n<e;++n)if(!this.lexerActions[n].equals(t.lexerActions[n]))return!1;return!0}}return!1}static append(t,e){if(null===t)return new qt([e]);const n=t.lexerActions.concat([e]);return new qt(n)}}function Yt(t){t.index=-1,t.line=0,t.column=-1,t.dfaState=null}class zt{constructor(){Yt(this)}reset(){Yt(this)}}class jt extends $t{constructor(t,e,n,i){super(e,i),this.decisionToDFA=n,this.recog=t,this.startIndex=-1,this.line=1,this.column=0,this.mode=Ht.DEFAULT_MODE,this.prevAccept=new zt}copyState(t){this.column=t.column,this.line=t.line,this.mode=t.mode,this.startIndex=t.startIndex}match(t,e){this.mode=e;const n=t.mark();try{this.startIndex=t.index,this.prevAccept.reset();const n=this.decisionToDFA[e];return null===n.s0?this.matchATN(t):this.execATN(t,n.s0)}finally{t.release(n)}}reset(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=Ht.DEFAULT_MODE}matchATN(t){const e=this.atn.modeToStartState[this.mode];jt.debug&&console.log("matchATN mode "+this.mode+" start: "+e);const n=this.mode,i=this.computeStartState(t,e),s=i.hasSemanticContext;i.hasSemanticContext=!1;const r=this.addDFAState(i);s||(this.decisionToDFA[this.mode].s0=r);const o=this.execATN(t,r);return jt.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),o}execATN(e,n){jt.debug&&console.log("start state closure="+n.configs),n.isAcceptState&&this.captureSimState(this.prevAccept,e,n);let i=e.LA(1),s=n;for(;;){jt.debug&&console.log("execATN loop starting closure: "+s.configs);let n=this.getExistingTargetState(s,i);if(null===n&&(n=this.computeTargetState(e,s,i)),n===$t.ERROR)break;if(i!==t.EOF&&this.consume(e),n.isAcceptState&&(this.captureSimState(this.prevAccept,e,n),i===t.EOF))break;i=e.LA(1),s=n}return this.failOrAccept(this.prevAccept,e,s.configs,i)}getExistingTargetState(t,e){if(null===t.edges||e<jt.MIN_DFA_EDGE||e>jt.MAX_DFA_EDGE)return null;let n=t.edges[e-jt.MIN_DFA_EDGE];return void 0===n&&(n=null),jt.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n}computeTargetState(t,e,n){const i=new Qt;return this.getReachableConfigSet(t,e.configs,i,n),0===i.items.length?(i.hasSemanticContext||this.addDFAEdge(e,n,$t.ERROR),$t.ERROR):this.addDFAEdge(e,n,null,i)}failOrAccept(e,n,i,s){if(null!==this.prevAccept.dfaState){const t=e.dfaState.lexerActionExecutor;return this.accept(n,t,this.startIndex,e.index,e.line,e.column),e.dfaState.prediction}if(s===t.EOF&&n.index===this.startIndex)return t.EOF;throw new Mt(this.recog,n,this.startIndex,i)}getReachableConfigSet(e,n,i,s){let r=z.INVALID_ALT_NUMBER;for(let o=0;o<n.items.length;o++){const a=n.items[o],l=a.alt===r;if(!l||!a.passedThroughNonGreedyDecision){jt.debug&&console.log("testing %s at %s\n",this.getTokenName(s),a.toString(this.recog,!0));for(let n=0;n<a.state.transitions.length;n++){const o=a.state.transitions[n],h=this.getReachableTarget(o,s);if(null!==h){let n=a.lexerActionExecutor;null!==n&&(n=n.fixOffsetBeforeMatch(e.index-this.startIndex));const o=s===t.EOF,u=new Gt({state:h,lexerActionExecutor:n},a);this.closure(e,u,i,l,!0,o)&&(r=a.alt)}}}}}accept(t,e,n,i,s,r){jt.debug&&console.log("ACTION %s\n",e),t.seek(i),this.line=s,this.column=r,null!==e&&null!==this.recog&&e.execute(this.recog,t,n)}getReachableTarget(t,e){return t.matches(e,0,Ht.MAX_CHAR_VALUE)?t.target:null}computeStartState(t,e){const n=H.EMPTY,i=new Qt;for(let s=0;s<e.transitions.length;s++){const r=e.transitions[s].target,o=new Gt({state:r,alt:s+1,context:n},null);this.closure(t,o,i,!1,!1,!1)}return i}closure(t,e,n,i,s,r){let o=null;if(jt.debug&&console.log("closure("+e.toString(this.recog,!0)+")"),e.state instanceof _){if(jt.debug&&(null!==this.recog?console.log("closure at %s rule stop %s\n",this.recog.ruleNames[e.state.ruleIndex],e):console.log("closure at rule stop %s\n",e)),null===e.context||e.context.hasEmptyPath()){if(null===e.context||e.context.isEmpty())return n.add(e),!0;n.add(new Gt({state:e.state,context:H.EMPTY},e)),i=!0}if(null!==e.context&&!e.context.isEmpty())for(let a=0;a<e.context.length;a++)if(e.context.getReturnState(a)!==H.EMPTY_RETURN_STATE){const l=e.context.getParent(a),h=this.atn.states[e.context.getReturnState(a)];o=new Gt({state:h,context:l},e),i=this.closure(t,o,n,i,s,r)}return i}e.state.epsilonOnlyTransitions||i&&e.passedThroughNonGreedyDecision||n.add(e);for(let a=0;a<e.state.transitions.length;a++){const l=e.state.transitions[a];o=this.getEpsilonTarget(t,e,l,n,s,r),null!==o&&(i=this.closure(t,o,n,i,s,r))}return i}getEpsilonTarget(e,n,i,s,r,o){let a=null;if(i.serializationType===A.RULE){const t=B.create(n.context,i.followState.stateNumber);a=new Gt({state:i.target,context:t},n)}else{if(i.serializationType===A.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(i.serializationType===A.PREDICATE)jt.debug&&console.log("EVAL rule "+i.ruleIndex+":"+i.predIndex),s.hasSemanticContext=!0,this.evaluatePredicate(e,i.ruleIndex,i.predIndex,r)&&(a=new Gt({state:i.target},n));else if(i.serializationType===A.ACTION)if(null===n.context||n.context.hasEmptyPath()){const t=qt.append(n.lexerActionExecutor,this.atn.lexerActions[i.actionIndex]);a=new Gt({state:i.target,lexerActionExecutor:t},n)}else a=new Gt({state:i.target},n);else i.serializationType===A.EPSILON?a=new Gt({state:i.target},n):i.serializationType!==A.ATOM&&i.serializationType!==A.RANGE&&i.serializationType!==A.SET||o&&i.matches(t.EOF,0,Ht.MAX_CHAR_VALUE)&&(a=new Gt({state:i.target},n))}return a}evaluatePredicate(t,e,n,i){if(null===this.recog)return!0;if(!i)return this.recog.sempred(null,e,n);const s=this.column,r=this.line,o=t.index,a=t.mark();try{return this.consume(t),this.recog.sempred(null,e,n)}finally{this.column=s,this.line=r,t.seek(o),t.release(a)}}captureSimState(t,e,n){t.index=e.index,t.line=this.line,t.column=this.column,t.dfaState=n}addDFAEdge(t,e,n,i){if(void 0===n&&(n=null),void 0===i&&(i=null),null===n&&null!==i){const t=i.hasSemanticContext;if(i.hasSemanticContext=!1,n=this.addDFAState(i),t)return n}return e<jt.MIN_DFA_EDGE||e>jt.MAX_DFA_EDGE||(jt.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-jt.MIN_DFA_EDGE]=n),n}addDFAState(t){const e=new Wt(null,t);let n=null;for(let e=0;e<t.items.length;e++){const i=t.items[e];if(i.state instanceof _){n=i;break}}null!==n&&(e.isAcceptState=!0,e.lexerActionExecutor=n.lexerActionExecutor,e.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);const i=this.decisionToDFA[this.mode],s=i.states.get(e);if(null!==s)return s;const r=e;return r.stateNumber=i.states.length,t.setReadonly(!0),r.configs=t,i.states.add(r),r}getDFA(t){return this.decisionToDFA[t]}getText(t){return t.getText(this.startIndex,t.index-1)}consume(t){t.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,t.consume()}getTokenName(t){return-1===t?"EOF":"'"+String.fromCharCode(t)+"'"}}jt.debug=!1,jt.dfa_debug=!1,jt.MIN_DFA_EDGE=0,jt.MAX_DFA_EDGE=127;class Jt{constructor(t,e){this.alt=e,this.pred=t}toString(){return"("+this.pred+", "+this.alt+")"}}class Xt{constructor(){this.data={}}get(t){return this.data["k-"+t]||null}set(t,e){this.data["k-"+t]=e}values(){return Object.keys(this.data).filter((t=>t.startsWith("k-"))).map((t=>this.data[t]),this)}}const Zt={SLL:0,LL:1,LL_EXACT_AMBIG_DETECTION:2,hasSLLConflictTerminatingPrediction:function(t,e){if(Zt.allConfigsInRuleStopStates(e))return!0;if(t===Zt.SLL&&e.hasSemanticContext){const t=new Vt;for(let n=0;n<e.items.length;n++){let i=e.items[n];i=new E({semanticContext:p.NONE},i),t.add(i)}e=t}const n=Zt.getConflictingAltSubsets(e);return Zt.hasConflictingAltSet(n)&&!Zt.hasStateAssociatedWithOneAlt(e)},hasConfigInRuleStopState:function(t){for(let e=0;e<t.items.length;e++)if(t.items[e].state instanceof _)return!0;return!1},allConfigsInRuleStopStates:function(t){for(let e=0;e<t.items.length;e++)if(!(t.items[e].state instanceof _))return!1;return!0},resolvesToJustOneViableAlt:function(t){return Zt.getSingleViableAlt(t)},allSubsetsConflict:function(t){return!Zt.hasNonConflictingAltSet(t)},hasNonConflictingAltSet:function(t){for(let e=0;e<t.length;e++)if(1===t[e].length)return!0;return!1},hasConflictingAltSet:function(t){for(let e=0;e<t.length;e++)if(t[e].length>1)return!0;return!1},allSubsetsEqual:function(t){let e=null;for(let n=0;n<t.length;n++){const i=t[n];if(null===e)e=i;else if(i!==e)return!1}return!0},getUniqueAlt:function(t){const e=Zt.getAlts(t);return 1===e.length?e.minValue():z.INVALID_ALT_NUMBER},getAlts:function(t){const e=new q;return t.map((function(t){e.or(t)})),e},getConflictingAltSubsets:function(t){const e=new $;return e.hashFunction=function(t){s.hashStuff(t.state.stateNumber,t.context)},e.equalsFunction=function(t,e){return t.state.stateNumber===e.state.stateNumber&&t.context.equals(e.context)},t.items.map((function(t){let n=e.get(t);null===n&&(n=new q,e.set(t,n)),n.add(t.alt)})),e.getValues()},getStateToAltMap:function(t){const e=new Xt;return t.items.map((function(t){let n=e.get(t.state);null===n&&(n=new q,e.set(t.state,n)),n.add(t.alt)})),e},hasStateAssociatedWithOneAlt:function(t){const e=Zt.getStateToAltMap(t).values();for(let t=0;t<e.length;t++)if(1===e[t].length)return!0;return!1},getSingleViableAlt:function(t){let e=null;for(let n=0;n<t.length;n++){const i=t[n].minValue();if(null===e)e=i;else if(e!==i)return z.INVALID_ALT_NUMBER}return e}},te=Zt;class ee extends Ut{constructor(t,e,n,i,s,r){r=r||t._ctx,i=i||t.getCurrentToken(),n=n||t.getCurrentToken(),e=e||t.getInputStream(),super({message:"",recognizer:t,input:e,ctx:r}),this.deadEndConfigs=s,this.startToken=n,this.offendingToken=i}}class ne{constructor(t){this.defaultMapCtor=t||$,this.cacheMap=new this.defaultMapCtor}get(t,e){const n=this.cacheMap.get(t)||null;return null===n?null:n.get(e)||null}set(t,e,n){let i=this.cacheMap.get(t)||null;null===i&&(i=new this.defaultMapCtor,this.cacheMap.set(t,i)),i.set(e,n)}}class ie extends $t{constructor(t,e,n,i){super(e,i),this.parser=t,this.decisionToDFA=n,this.predictionMode=te.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this.debug=!1,this.debug_closure=!1,this.debug_add=!1,this.trace_atn_sim=!1,this.dfa_debug=!1,this.retry_debug=!1}reset(){}adaptivePredict(t,e,n){(this.debug||this.trace_atn_sim)&&console.log("adaptivePredict decision "+e+" exec LA(1)=="+this.getLookaheadName(t)+" line "+t.LT(1).line+":"+t.LT(1).column),this._input=t,this._startIndex=t.index,this._outerContext=n;const i=this.decisionToDFA[e];this._dfa=i;const s=t.mark(),r=t.index;try{let e;if(e=i.precedenceDfa?i.getPrecedenceStartState(this.parser.getPrecedence()):i.s0,null===e){null===n&&(n=M.EMPTY),this.debug&&console.log("predictATN decision "+i.decision+" exec LA(1)=="+this.getLookaheadName(t)+", outerContext="+n.toString(this.parser.ruleNames));const s=!1;let r=this.computeStartState(i.atnStartState,M.EMPTY,s);i.precedenceDfa?(i.s0.configs=r,r=this.applyPrecedenceFilter(r),e=this.addDFAState(i,new Wt(null,r)),i.setPrecedenceStartState(this.parser.getPrecedence(),e)):(e=this.addDFAState(i,new Wt(null,r)),i.s0=e)}const s=this.execATN(i,e,t,r,n);return this.debug&&console.log("DFA after predictATN: "+i.toString(this.parser.literalNames,this.parser.symbolicNames)),s}finally{this._dfa=null,this.mergeCache=null,t.seek(r),t.release(s)}}execATN(e,n,i,s,r){let o;(this.debug||this.trace_atn_sim)&&console.log("execATN decision "+e.decision+", DFA state "+n+", LA(1)=="+this.getLookaheadName(i)+" line "+i.LT(1).line+":"+i.LT(1).column);let a=n;this.debug&&console.log("s0 = "+n);let l=i.LA(1);for(;;){let n=this.getExistingTargetState(a,l);if(null===n&&(n=this.computeTargetState(e,a,l)),n===$t.ERROR){const t=this.noViableAlt(i,r,a.configs,s);if(i.seek(s),o=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(a.configs,r),o!==z.INVALID_ALT_NUMBER)return o;throw t}if(n.requiresFullContext&&this.predictionMode!==te.SLL){let t=null;if(null!==n.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");const e=i.index;if(e!==s&&i.seek(s),t=this.evalSemanticContext(n.predicates,r,!0),1===t.length)return this.debug&&console.log("Full LL avoided"),t.minValue();e!==s&&i.seek(e)}this.dfa_debug&&console.log("ctx sensitive state "+r+" in "+n);const a=!0,l=this.computeStartState(e.atnStartState,r,a);return this.reportAttemptingFullContext(e,t,n.configs,s,i.index),o=this.execATNWithFullContext(e,n,l,i,s,r),o}if(n.isAcceptState){if(null===n.predicates)return n.prediction;const t=i.index;i.seek(s);const o=this.evalSemanticContext(n.predicates,r,!0);if(0===o.length)throw this.noViableAlt(i,r,n.configs,s);return 1===o.length||this.reportAmbiguity(e,n,s,t,!1,o,n.configs),o.minValue()}a=n,l!==t.EOF&&(i.consume(),l=i.LA(1))}}getExistingTargetState(t,e){const n=t.edges;return null===n?null:n[e+1]||null}computeTargetState(t,e,n){const i=this.computeReachSet(e.configs,n,!1);if(null===i)return this.addDFAEdge(t,e,n,$t.ERROR),$t.ERROR;let s=new Wt(null,i);const r=this.getUniqueAlt(i);if(this.debug){const t=te.getConflictingAltSubsets(i);console.log("SLL altSubSets="+u(t)+", configs="+i+", predict="+r+", allSubsetsConflict="+te.allSubsetsConflict(t)+", conflictingAlts="+this.getConflictingAlts(i))}return r!==z.INVALID_ALT_NUMBER?(s.isAcceptState=!0,s.configs.uniqueAlt=r,s.prediction=r):te.hasSLLConflictTerminatingPrediction(this.predictionMode,i)&&(s.configs.conflictingAlts=this.getConflictingAlts(i),s.requiresFullContext=!0,s.isAcceptState=!0,s.prediction=s.configs.conflictingAlts.minValue()),s.isAcceptState&&s.configs.hasSemanticContext&&(this.predicateDFAState(s,this.atn.getDecisionState(t.decision)),null!==s.predicates&&(s.prediction=z.INVALID_ALT_NUMBER)),s=this.addDFAEdge(t,e,n,s),s}predicateDFAState(t,e){const n=e.transitions.length,i=this.getConflictingAltsOrUniqueAlt(t.configs),s=this.getPredsForAmbigAlts(i,t.configs,n);null!==s?(t.predicates=this.getPredicatePredictions(i,s),t.prediction=z.INVALID_ALT_NUMBER):t.prediction=i.minValue()}execATNWithFullContext(e,n,i,s,r,o){(this.debug||this.trace_atn_sim)&&console.log("execATNWithFullContext "+i);let a,l=!1,h=i;s.seek(r);let u=s.LA(1),c=-1;for(;;){if(a=this.computeReachSet(h,u,!0),null===a){const t=this.noViableAlt(s,o,h,r);s.seek(r);const e=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(h,o);if(e!==z.INVALID_ALT_NUMBER)return e;throw t}const e=te.getConflictingAltSubsets(a);if(this.debug&&console.log("LL altSubSets="+e+", predict="+te.getUniqueAlt(e)+", resolvesToJustOneViableAlt="+te.resolvesToJustOneViableAlt(e)),a.uniqueAlt=this.getUniqueAlt(a),a.uniqueAlt!==z.INVALID_ALT_NUMBER){c=a.uniqueAlt;break}if(this.predictionMode!==te.LL_EXACT_AMBIG_DETECTION){if(c=te.resolvesToJustOneViableAlt(e),c!==z.INVALID_ALT_NUMBER)break}else if(te.allSubsetsConflict(e)&&te.allSubsetsEqual(e)){l=!0,c=te.getSingleViableAlt(e);break}h=a,u!==t.EOF&&(s.consume(),u=s.LA(1))}return a.uniqueAlt!==z.INVALID_ALT_NUMBER?(this.reportContextSensitivity(e,c,a,r,s.index),c):(this.reportAmbiguity(e,n,r,s.index,l,null,a),c)}computeReachSet(e,n,i){this.debug&&console.log("in computeReachSet, starting closure: "+e),null===this.mergeCache&&(this.mergeCache=new ne);const s=new Vt(i);let r=null;for(let o=0;o<e.items.length;o++){const a=e.items[o];if(this.debug&&console.log("testing "+this.getTokenName(n)+" at "+a),a.state instanceof _)(i||n===t.EOF)&&(null===r&&(r=[]),r.push(a),this.debug_add&&console.log("added "+a+" to skippedStopStates"));else for(let t=0;t<a.state.transitions.length;t++){const e=a.state.transitions[t],i=this.getReachableTarget(e,n);if(null!==i){const t=new E({state:i},a);s.add(t,this.mergeCache),this.debug_add&&console.log("added "+t+" to intermediate")}}}let o=null;if(null===r&&n!==t.EOF&&(1===s.items.length||this.getUniqueAlt(s)!==z.INVALID_ALT_NUMBER)&&(o=s),null===o){o=new Vt(i);const e=new d,r=n===t.EOF;for(let t=0;t<s.items.length;t++)this.closure(s.items[t],o,e,!1,i,r)}if(n===t.EOF&&(o=this.removeAllConfigsNotInRuleStopState(o,o===s)),!(null===r||i&&te.hasConfigInRuleStopState(o)))for(let t=0;t<r.length;t++)o.add(r[t],this.mergeCache);return this.trace_atn_sim&&console.log("computeReachSet "+e+" -> "+o),0===o.items.length?null:o}removeAllConfigsNotInRuleStopState(e,n){if(te.allConfigsInRuleStopStates(e))return e;const i=new Vt(e.fullCtx);for(let s=0;s<e.items.length;s++){const r=e.items[s];if(r.state instanceof _)i.add(r,this.mergeCache);else if(n&&r.state.epsilonOnlyTransitions&&this.atn.nextTokens(r.state).contains(t.EPSILON)){const t=this.atn.ruleToStopState[r.state.ruleIndex];i.add(new E({state:t},r),this.mergeCache)}}return i}computeStartState(t,e,n){const i=Q(this.atn,e),s=new Vt(n);this.trace_atn_sim&&console.log("computeStartState from ATN state "+t+" initialContext="+i.toString(this.parser));for(let e=0;e<t.transitions.length;e++){const r=t.transitions[e].target,o=new E({state:r,alt:e+1,context:i},null),a=new d;this.closure(o,s,a,!0,n,!1)}return s}applyPrecedenceFilter(t){let e;const n=[],i=new Vt(t.fullCtx);for(let s=0;s<t.items.length;s++){if(e=t.items[s],1!==e.alt)continue;const r=e.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==r&&(n[e.state.stateNumber]=e.context,r!==e.semanticContext?i.add(new E({semanticContext:r},e),this.mergeCache):i.add(e,this.mergeCache))}for(let s=0;s<t.items.length;s++)if(e=t.items[s],1!==e.alt){if(!e.precedenceFilterSuppressed){const t=n[e.state.stateNumber]||null;if(null!==t&&t.equals(e.context))continue}i.add(e,this.mergeCache)}return i}getReachableTarget(t,e){return t.matches(e,0,this.atn.maxTokenType)?t.target:null}getPredsForAmbigAlts(t,e,n){let i=[];for(let n=0;n<e.items.length;n++){const s=e.items[n];t.has(s.alt)&&(i[s.alt]=p.orContext(i[s.alt]||null,s.semanticContext))}let s=0;for(let t=1;t<n+1;t++){const e=i[t]||null;null===e?i[t]=p.NONE:e!==p.NONE&&(s+=1)}return 0===s&&(i=null),this.debug&&console.log("getPredsForAmbigAlts result "+u(i)),i}getPredicatePredictions(t,e){const n=[];let i=!1;for(let s=1;s<e.length;s++){const r=e[s];null!==t&&t.has(s)&&n.push(new Jt(r,s)),r!==p.NONE&&(i=!0)}return i?n:null}getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(t,e){const n=this.splitAccordingToSemanticValidity(t,e),i=n[0],s=n[1];let r=this.getAltThatFinishedDecisionEntryRule(i);return r!==z.INVALID_ALT_NUMBER||s.items.length>0&&(r=this.getAltThatFinishedDecisionEntryRule(s),r!==z.INVALID_ALT_NUMBER)?r:z.INVALID_ALT_NUMBER}getAltThatFinishedDecisionEntryRule(t){const e=[];for(let n=0;n<t.items.length;n++){const i=t.items[n];(i.reachesIntoOuterContext>0||i.state instanceof _&&i.context.hasEmptyPath())&&e.indexOf(i.alt)<0&&e.push(i.alt)}return 0===e.length?z.INVALID_ALT_NUMBER:Math.min.apply(null,e)}splitAccordingToSemanticValidity(t,e){const n=new Vt(t.fullCtx),i=new Vt(t.fullCtx);for(let s=0;s<t.items.length;s++){const r=t.items[s];r.semanticContext!==p.NONE?r.semanticContext.evaluate(this.parser,e)?n.add(r):i.add(r):n.add(r)}return[n,i]}evalSemanticContext(t,e,n){const i=new q;for(let s=0;s<t.length;s++){const r=t[s];if(r.pred===p.NONE){if(i.add(r.alt),!n)break;continue}const o=r.pred.evaluate(this.parser,e);if((this.debug||this.dfa_debug)&&console.log("eval pred "+r+"="+o),o&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+r.alt),i.add(r.alt),!n))break}return i}closure(t,e,n,i,s,r){this.closureCheckingStopState(t,e,n,i,s,0,r)}closureCheckingStopState(t,e,n,i,s,r,o){if((this.trace_atn_sim||this.debug_closure)&&console.log("closure("+t.toString(this.parser,!0)+")"),t.state instanceof _){if(!t.context.isEmpty()){for(let a=0;a<t.context.length;a++){if(t.context.getReturnState(a)===H.EMPTY_RETURN_STATE){if(s){e.add(new E({state:t.state,context:H.EMPTY},t),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex)),this.closure_(t,e,n,i,s,r,o);continue}const l=this.atn.states[t.context.getReturnState(a)],h=t.context.getParent(a),u={state:l,alt:t.alt,context:h,semanticContext:t.semanticContext},c=new E(u,null);c.reachesIntoOuterContext=t.reachesIntoOuterContext,this.closureCheckingStopState(c,e,n,i,s,r-1,o)}return}if(s)return void e.add(t,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex))}this.closure_(t,e,n,i,s,r,o)}closure_(t,e,n,i,s,r,o){const a=t.state;a.epsilonOnlyTransitions||e.add(t,this.mergeCache);for(let l=0;l<a.transitions.length;l++){if(0===l&&this.canDropLoopEntryEdgeInLeftRecursiveRule(t))continue;const h=a.transitions[l],u=i&&!(h instanceof ct),c=this.getEpsilonTarget(t,h,u,0===r,s,o);if(null!==c){let i=r;if(t.state instanceof _){if(null!==this._dfa&&this._dfa.precedenceDfa&&h.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(c.precedenceFilterSuppressed=!0),c.reachesIntoOuterContext+=1,n.add(c)!==c)continue;e.dipsIntoOuterContext=!0,i-=1,this.debug&&console.log("dips into outer ctx: "+c)}else{if(!h.isEpsilon&&n.add(c)!==c)continue;h instanceof C&&i>=0&&(i+=1)}this.closureCheckingStopState(c,e,n,u,s,i,o)}}}canDropLoopEntryEdgeInLeftRecursiveRule(t){const e=t.state;if(e.stateType!==S.STAR_LOOP_ENTRY)return!1;if(e.stateType!==S.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;const n=t.context.length;for(let i=0;i<n;i++)if(this.atn.states[t.context.getReturnState(i)].ruleIndex!==e.ruleIndex)return!1;const i=e.transitions[0].target.endState.stateNumber,s=this.atn.states[i];for(let i=0;i<n;i++){const n=t.context.getReturnState(i),r=this.atn.states[n];if(1!==r.transitions.length||!r.transitions[0].isEpsilon)return!1;const o=r.transitions[0].target;if(!(r.stateType===S.BLOCK_END&&o===e||r===s||o===s||o.stateType===S.BLOCK_END&&1===o.transitions.length&&o.transitions[0].isEpsilon&&o.transitions[0].target===e))return!1}return!0}getRuleName(t){return null!==this.parser&&t>=0?this.parser.ruleNames[t]:"<rule "+t+">"}getEpsilonTarget(e,n,i,s,r,o){switch(n.serializationType){case A.RULE:return this.ruleTransition(e,n);case A.PRECEDENCE:return this.precedenceTransition(e,n,i,s,r);case A.PREDICATE:return this.predTransition(e,n,i,s,r);case A.ACTION:return this.actionTransition(e,n);case A.EPSILON:return new E({state:n.target},e);case A.ATOM:case A.RANGE:case A.SET:return o&&n.matches(t.EOF,0,1)?new E({state:n.target},e):null;default:return null}}actionTransition(t,e){if(this.debug){const t=-1===e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+t)}return new E({state:e.target},t)}precedenceTransition(t,e,n,i,s){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let r=null;if(n&&i)if(s){const n=this._input.index;this._input.seek(this._startIndex);const i=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),i&&(r=new E({state:e.target},t))}else{const n=p.andContext(t.semanticContext,e.getPredicate());r=new E({state:e.target,semanticContext:n},t)}else r=new E({state:e.target},t);return this.debug&&console.log("config from pred transition="+r),r}predTransition(t,e,n,i,s){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+u(this.parser.getRuleInvocationStack())));let r=null;if(n&&(e.isCtxDependent&&i||!e.isCtxDependent))if(s){const n=this._input.index;this._input.seek(this._startIndex);const i=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(n),i&&(r=new E({state:e.target},t))}else{const n=p.andContext(t.semanticContext,e.getPredicate());r=new E({state:e.target,semanticContext:n},t)}else r=new E({state:e.target},t);return this.debug&&console.log("config from pred transition="+r),r}ruleTransition(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);const n=e.followState,i=B.create(t.context,n.stateNumber);return new E({state:e.target,context:i},t)}getConflictingAlts(t){const e=te.getConflictingAltSubsets(t);return te.getAlts(e)}getConflictingAltsOrUniqueAlt(t){let e=null;return t.uniqueAlt!==z.INVALID_ALT_NUMBER?(e=new q,e.add(t.uniqueAlt)):e=t.conflictingAlts,e}getTokenName(e){if(e===t.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(e>=this.parser.literalNames.length&&e>=this.parser.symbolicNames.length))return(this.parser.literalNames[e]||this.parser.symbolicNames[e])+"<"+e+">";console.log(e+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+e}getLookaheadName(t){return this.getTokenName(t.LA(1))}dumpDeadEndConfigs(t){console.log("dead end configs: ");const e=t.getDeadEndConfigs();for(let t=0;t<e.length;t++){const n=e[t];let i="no edges";if(n.state.transitions.length>0){const t=n.state.transitions[0];t instanceof ht?i="Atom "+this.getTokenName(t.label):t instanceof v&&(i=(t instanceof L?"~":"")+"Set "+t.set)}console.error(n.toString(this.parser,!0)+":"+i)}}noViableAlt(t,e,n,i){return new ee(this.parser,t,t.get(i),t.LT(1),n,e)}getUniqueAlt(t){let e=z.INVALID_ALT_NUMBER;for(let n=0;n<t.items.length;n++){const i=t.items[n];if(e===z.INVALID_ALT_NUMBER)e=i.alt;else if(i.alt!==e)return z.INVALID_ALT_NUMBER}return e}addDFAEdge(t,e,n,i){if(this.debug&&console.log("EDGE "+e+" -> "+i+" upon "+this.getTokenName(n)),null===i)return null;if(i=this.addDFAState(t,i),null===e||n<-1||n>this.atn.maxTokenType)return i;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=i,this.debug){const e=null===this.parser?null:this.parser.literalNames,n=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(e,n))}return i}addDFAState(t,e){if(e===$t.ERROR)return e;const n=t.states.get(e);return null!==n?(this.trace_atn_sim&&console.log("addDFAState "+e+" exists"),n):(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),this.trace_atn_sim&&console.log("addDFAState new "+e),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)}reportAttemptingFullContext(t,e,n,i,s){if(this.debug||this.retry_debug){const e=new T(i,s+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,i,s,e,n)}reportContextSensitivity(t,e,n,i,s){if(this.debug||this.retry_debug){const e=new T(i,s+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(e))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,i,s,e,n)}reportAmbiguity(t,e,n,i,s,r,o){if(this.debug||this.retry_debug){const t=new T(n,i+1);console.log("reportAmbiguity "+r+":"+o+", input="+this.parser.getTokenStream().getText(t))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,i,s,r,o)}}class se{constructor(){this.cache=new $}add(t){if(t===H.EMPTY)return H.EMPTY;const e=this.cache.get(t)||null;return null!==e?e:(this.cache.set(t,t),t)}get(t){return this.cache.get(t)||null}get length(){return this.cache.length}}const re={ATN:z,ATNDeserializer:Nt,LexerATNSimulator:jt,ParserATNSimulator:ie,PredictionMode:te,PredictionContextCache:se};class oe{constructor(t,e,n){this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[]}toString(){if(null===this.dfa.s0)return null;let t="";const e=this.dfa.sortedStates();for(let n=0;n<e.length;n++){const i=e[n];if(null!==i.edges){const e=i.edges.length;for(let n=0;n<e;n++){const e=i.edges[n]||null;null!==e&&2147483647!==e.stateNumber&&(t=t.concat(this.getStateString(i)),t=t.concat("-"),t=t.concat(this.getEdgeLabel(n)),t=t.concat("->"),t=t.concat(this.getStateString(e)),t=t.concat("\n"))}}}return 0===t.length?null:t}getEdgeLabel(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)}getStateString(t){const e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+u(t.predicates):e+"=>"+t.prediction.toString():e}}class ae extends oe{constructor(t){super(t,null)}getEdgeLabel(t){return"'"+String.fromCharCode(t)+"'"}}class le{constructor(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new d,this.s0=null,this.precedenceDfa=!1,t instanceof rt&&t.isPrecedenceDecision){this.precedenceDfa=!0;const t=new Wt(null,new Vt);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}}getPrecedenceStartState(t){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";return t<0||t>=this.s0.edges.length?null:this.s0.edges[t]||null}setPrecedenceStartState(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)}setPrecedenceDfa(t){if(this.precedenceDfa!==t){if(this._states=new d,t){const t=new Wt(null,new Vt);t.edges=[],t.isAcceptState=!1,t.requiresFullContext=!1,this.s0=t}else this.s0=null;this.precedenceDfa=t}}sortedStates(){return this._states.values().sort((function(t,e){return t.stateNumber-e.stateNumber}))}toString(t,e){return t=t||null,e=e||null,null===this.s0?"":new oe(this,t,e).toString()}toLexerString(){return null===this.s0?"":new ae(this).toString()}get states(){return this._states}}const he={DFA:le,DFASerializer:oe,LexerDFASerializer:ae,PredPrediction:Jt},ue={PredictionContext:H},ce={Interval:T,IntervalSet:R};class de{visitTerminal(t){}visitErrorNode(t){}enterEveryRule(t){}exitEveryRule(t){}}class pe{visit(t){return Array.isArray(t)?t.map((function(t){return t.accept(this)}),this):t.accept(this)}visitChildren(t){return t.children?this.visit(t.children):null}visitTerminal(t){}visitErrorNode(t){}}class ge{walk(t,e){if(e instanceof b||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof w)t.visitTerminal(e);else{this.enterRule(t,e);for(let n=0;n<e.getChildCount();n++){const i=e.getChild(n);this.walk(t,i)}this.exitRule(t,e)}}enterRule(t,e){const n=e.ruleContext;t.enterEveryRule(n),n.enterRule(t)}exitRule(t,e){const n=e.ruleContext;n.exitRule(t),t.exitEveryRule(n)}}ge.DEFAULT=new ge;const xe={Trees:U,RuleNode:P,ErrorNode:b,TerminalNode:w,ParseTreeListener:de,ParseTreeVisitor:pe,ParseTreeWalker:ge};class fe extends Ut{constructor(t){super({message:"",recognizer:t,input:t.getInputStream(),ctx:t._ctx}),this.offendingToken=t.getCurrentToken()}}class me extends Ut{constructor(t,e,n){super({message:Ee(e,n||null),recognizer:t,input:t.getInputStream(),ctx:t._ctx});const i=t._interp.atn.states[t.state].transitions[0];i instanceof gt?(this.ruleIndex=i.ruleIndex,this.predicateIndex=i.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=e,this.offendingToken=t.getCurrentToken()}}function Ee(t,e){return null!==e?e:"failed predicate: {"+t+"}?"}class Te extends It{constructor(t){super(),t=t||!0,this.exactOnly=t}reportAmbiguity(t,e,n,i,s,r,o){if(this.exactOnly&&!s)return;const a="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(r,o)+", input='"+t.getTokenStream().getText(new T(n,i))+"'";t.notifyErrorListeners(a)}reportAttemptingFullContext(t,e,n,i,s,r){const o="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new T(n,i))+"'";t.notifyErrorListeners(o)}reportContextSensitivity(t,e,n,i,s,r){const o="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new T(n,i))+"'";t.notifyErrorListeners(o)}getDecisionDescription(t,e){const n=e.decision,i=e.atnStartState.ruleIndex,s=t.ruleNames;if(i<0||i>=s.length)return""+n;const r=s[i]||null;return null===r||0===r.length?""+n:`${n} (${r})`}getConflictingAlts(t,e){if(null!==t)return t;const n=new q;for(let t=0;t<e.items.length;t++)n.add(e.items[t].alt);return`{${n.values().join(", ")}}`}}class Re extends Error{constructor(){super(),Error.captureStackTrace(this,Re)}}class Se{reset(t){}recoverInline(t){}recover(t,e){}sync(t){}inErrorRecoveryMode(t){}reportError(t){}}class _e extends Se{constructor(){super(),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this.nextTokensContext=null,this.nextTokenState=0}reset(t){this.endErrorCondition(t)}beginErrorCondition(t){this.errorRecoveryMode=!0}inErrorRecoveryMode(t){return this.errorRecoveryMode}endErrorCondition(t){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1}reportMatch(t){this.endErrorCondition(t)}reportError(t,e){this.inErrorRecoveryMode(t)||(this.beginErrorCondition(t),e instanceof ee?this.reportNoViableAlternative(t,e):e instanceof fe?this.reportInputMismatch(t,e):e instanceof me?this.reportFailedPredicate(t,e):(console.log("unknown recognition error type: "+e.constructor.name),console.log(e.stack),t.notifyErrorListeners(e.getOffendingToken(),e.getMessage(),e)))}recover(t,e){this.lastErrorIndex===t.getInputStream().index&&null!==this.lastErrorStates&&this.lastErrorStates.indexOf(t.state)>=0&&t.consume(),this.lastErrorIndex=t._input.index,null===this.lastErrorStates&&(this.lastErrorStates=[]),this.lastErrorStates.push(t.state);const n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)}sync(e){if(this.inErrorRecoveryMode(e))return;const n=e._interp.atn.states[e.state],i=e.getTokenStream().LA(1),s=e.atn.nextTokens(n);if(s.contains(i))return this.nextTokensContext=null,void(this.nextTokenState=S.INVALID_STATE_NUMBER);if(s.contains(t.EPSILON))null===this.nextTokensContext&&(this.nextTokensContext=e._ctx,this.nextTokensState=e._stateNumber);else switch(n.stateType){case S.BLOCK_START:case S.STAR_BLOCK_START:case S.PLUS_BLOCK_START:case S.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(e))return;throw new fe(e);case S.PLUS_LOOP_BACK:case S.STAR_LOOP_BACK:{this.reportUnwantedToken(e);const t=new R;t.addSet(e.getExpectedTokens());const n=t.addSet(this.getErrorRecoverySet(e));this.consumeUntil(e,n)}}}reportNoViableAlternative(e,n){const i=e.getTokenStream();let s;s=null!==i?n.startToken.type===t.EOF?"<EOF>":i.getText(new T(n.startToken.tokenIndex,n.offendingToken.tokenIndex)):"<unknown input>";const r="no viable alternative at input "+this.escapeWSAndQuote(s);e.notifyErrorListeners(r,n.offendingToken,n)}reportInputMismatch(t,e){const n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)}reportFailedPredicate(t,e){const n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)}reportUnwantedToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}reportMissingToken(t){if(this.inErrorRecoveryMode(t))return;this.beginErrorCondition(t);const e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}recoverInline(t){const e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new fe(t)}singleTokenInsertion(t){const e=t.getTokenStream().LA(1),n=t._interp.atn,i=n.states[t.state].transitions[0].target;return!!n.nextTokens(i,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)}singleTokenDeletion(t){const e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();const e=t.getCurrentToken();return this.reportMatch(t),e}return null}getMissingSymbol(e){const n=e.getCurrentToken(),i=this.getExpectedTokens(e).first();let s;s=i===t.EOF?"<missing EOF>":"<missing "+e.literalNames[i]+">";let r=n;const o=e.getTokenStream().LT(-1);return r.type===t.EOF&&null!==o&&(r=o),e.getTokenFactory().create(r.source,i,s,t.DEFAULT_CHANNEL,-1,-1,r.line,r.column)}getExpectedTokens(t){return t.getExpectedTokens()}getTokenErrorDisplay(e){if(null===e)return"<no token>";let n=e.text;return null===n&&(n=e.type===t.EOF?"<EOF>":"<"+e.type+">"),this.escapeWSAndQuote(n)}escapeWSAndQuote(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"}getErrorRecoverySet(e){const n=e._interp.atn;let i=e._ctx;const s=new R;for(;null!==i&&i.invokingState>=0;){const t=n.states[i.invokingState].transitions[0],e=n.nextTokens(t.followState);s.addSet(e),i=i.parentCtx}return s.removeOne(t.EPSILON),s}consumeUntil(e,n){let i=e.getTokenStream().LA(1);for(;i!==t.EOF&&!n.contains(i);)e.consume(),i=e.getTokenStream().LA(1)}}class Ae extends _e{constructor(){super()}recover(t,e){let n=t._ctx;for(;null!==n;)n.exception=e,n=n.parentCtx;throw new Re(e)}recoverInline(t){this.recover(t,new fe(t))}sync(t){}}const Ce={RecognitionException:Ut,NoViableAltException:ee,LexerNoViableAltException:Mt,InputMismatchException:fe,FailedPredicateException:me,DiagnosticErrorListener:Te,BailErrorStrategy:Ae,DefaultErrorStrategy:_e,ErrorListener:It};class ve{constructor(t,e){if(this.name="<empty>",this.strdata=t,this.decodeToUnicodeCodePoints=e||!1,this._index=0,this.data=[],this.decodeToUnicodeCodePoints)for(let t=0;t<this.strdata.length;){const e=this.strdata.codePointAt(t);this.data.push(e),t+=e<=65535?1:2}else{this.data=new Array(this.strdata.length);for(let t=0;t<this.strdata.length;t++)this.data[t]=this.strdata.charCodeAt(t)}this._size=this.data.length}reset(){this._index=0}consume(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1}LA(e){if(0===e)return 0;e<0&&(e+=1);const n=this._index+e-1;return n<0||n>=this._size?t.EOF:this.data[n]}LT(t){return this.LA(t)}mark(){return-1}release(t){}seek(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)}getText(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){let n="";for(let i=t;i<=e;i++)n+=String.fromCodePoint(this.data[i]);return n}return this.strdata.slice(t,e+1)}toString(){return this.strdata}get index(){return this._index}get size(){return this._size}}class Le extends ve{constructor(t,e){super(t,e)}}var ye=o(92);const Ne="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node;class Ie extends Le{static fromPath(t,e,n){if(!Ne)throw new Error("FileStream is only available when running in Node!");ye.readFile(t,e,(function(t,e){let i=null;null!==e&&(i=new ve(e,!0)),n(t,i)}))}constructor(t,e,n){if(!Ne)throw new Error("FileStream is only available when running in Node!");super(ye.readFileSync(t,e||"utf-8"),n),this.fileName=t}}const ke={fromString:function(t){return new ve(t,!0)},fromBlob:function(t,e,n,i){const s=new window.FileReader;s.onload=function(t){const e=new ve(t.target.result,!0);n(e)},s.onerror=i,s.readAsText(t,e)},fromBuffer:function(t,e){return new ve(t.toString(e),!0)},fromPath:function(t,e,n){Ie.fromPath(t,e,n)},fromPathSync:function(t,e){return new Ie(t,e)}},Oe={arrayToString:u,stringToCharArray:function(t){let e=new Uint16Array(t.length);for(let n=0;n<t.length;n++)e[n]=t.charCodeAt(n);return e}};class Pe{}class we extends Pe{constructor(t){super(),this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}mark(){return 0}release(t){}reset(){this.seek(0)}seek(t){this.lazyInit(),this.index=this.adjustSeekIndex(t)}get size(){return this.tokens.length}get(t){return this.lazyInit(),this.tokens[t]}consume(){let e=!1;if(e=this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length),!e&&this.LA(1)===t.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))}sync(t){const e=t-this.tokens.length+1;return!(e>0)||this.fetch(e)>=e}fetch(e){if(this.fetchedEOF)return 0;for(let n=0;n<e;n++){const e=this.tokenSource.nextToken();if(e.tokenIndex=this.tokens.length,this.tokens.push(e),e.type===t.EOF)return this.fetchedEOF=!0,n+1}return e}getTokens(e,n,i){if(void 0===i&&(i=null),e<0||n<0)return null;this.lazyInit();const s=[];n>=this.tokens.length&&(n=this.tokens.length-1);for(let r=e;r<n;r++){const e=this.tokens[r];if(e.type===t.EOF)break;(null===i||i.contains(e.type))&&s.push(e)}return s}LA(t){return this.LT(t).type}LB(t){return this.index-t<0?null:this.tokens[this.index-t]}LT(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);const e=this.index+t-1;return this.sync(e),e>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]}adjustSeekIndex(t){return t}lazyInit(){-1===this.index&&this.setup()}setup(){this.sync(0),this.index=this.adjustSeekIndex(0)}setTokenSource(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1}nextTokenOnChannel(e,n){if(this.sync(e),e>=this.tokens.length)return-1;let i=this.tokens[e];for(;i.channel!==this.channel;){if(i.type===t.EOF)return-1;e+=1,this.sync(e),i=this.tokens[e]}return e}previousTokenOnChannel(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t}getHiddenTokensToRight(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.nextTokenOnChannel(t+1,Ht.DEFAULT_TOKEN_CHANNEL),i=t+1,s=-1===n?this.tokens.length-1:n;return this.filterForChannel(i,s,e)}getHiddenTokensToLeft(t,e){if(void 0===e&&(e=-1),this.lazyInit(),t<0||t>=this.tokens.length)throw t+" not in 0.."+this.tokens.length-1;const n=this.previousTokenOnChannel(t-1,Ht.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;const i=n+1,s=t-1;return this.filterForChannel(i,s,e)}filterForChannel(t,e,n){const i=[];for(let s=t;s<e+1;s++){const t=this.tokens[s];-1===n?t.channel!==Ht.DEFAULT_TOKEN_CHANNEL&&i.push(t):t.channel===n&&i.push(t)}return 0===i.length?null:i}getSourceName(){return this.tokenSource.getSourceName()}getText(e){this.lazyInit(),this.fill(),e||(e=new T(0,this.tokens.length-1));let n=e.start;n instanceof t&&(n=n.tokenIndex);let i=e.stop;if(i instanceof t&&(i=i.tokenIndex),null===n||null===i||n<0||i<0)return"";i>=this.tokens.length&&(i=this.tokens.length-1);let s="";for(let e=n;e<i+1;e++){const n=this.tokens[e];if(n.type===t.EOF)break;s+=n.text}return s}fill(){for(this.lazyInit();1e3===this.fetch(1e3););}}Object.defineProperty(we,"size",{get:function(){return this.tokens.length}});class be extends we{constructor(e,n){super(e),this.channel=void 0===n?t.DEFAULT_CHANNEL:n}adjustSeekIndex(t){return this.nextTokenOnChannel(t,this.channel)}LB(t){if(0===t||this.index-t<0)return null;let e=this.index,n=1;for(;n<=t;)e=this.previousTokenOnChannel(e-1,this.channel),n+=1;return e<0?null:this.tokens[e]}LT(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);let e=this.index,n=1;for(;n<t;)this.sync(e+1)&&(e=this.nextTokenOnChannel(e+1,this.channel)),n+=1;return this.tokens[e]}getNumberOfOnChannelTokens(){let e=0;this.fill();for(let n=0;n<this.tokens.length;n++){const i=this.tokens[n];if(i.channel===this.channel&&(e+=1),i.type===t.EOF)break}return e}}class De extends de{constructor(t){super(),this.parser=t}enterEveryRule(t){console.log("enter "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}visitTerminal(t){console.log("consume "+t.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])}exitEveryRule(t){console.log("exit "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)}}class Ue extends Pt{constructor(t){super(),this._input=null,this._errHandler=new _e,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(t)}reset(){null!==this._input&&this._input.seek(0),this._errHandler.reset(this),this._ctx=null,this._syntaxErrors=0,this.setTrace(!1),this._precedenceStack=[],this._precedenceStack.push(0),null!==this._interp&&this._interp.reset()}match(t){let e=this.getCurrentToken();return e.type===t?(this._errHandler.reportMatch(this),this.consume()):(e=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===e.tokenIndex&&this._ctx.addErrorNode(e)),e}matchWildcard(){let t=this.getCurrentToken();return t.type>0?(this._errHandler.reportMatch(this),this.consume()):(t=this._errHandler.recoverInline(this),this.buildParseTrees&&-1===t.tokenIndex&&this._ctx.addErrorNode(t)),t}getParseListeners(){return this._parseListeners||[]}addParseListener(t){if(null===t)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(t)}removeParseListener(t){if(null!==this._parseListeners){const e=this._parseListeners.indexOf(t);e>=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}}removeParseListeners(){this._parseListeners=null}triggerEnterRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.forEach((function(e){e.enterEveryRule(t),t.enterRule(e)}))}}triggerExitRuleEvent(){if(null!==this._parseListeners){const t=this._ctx;this._parseListeners.slice(0).reverse().forEach((function(e){t.exitRule(e),e.exitEveryRule(t)}))}}getTokenFactory(){return this._input.tokenSource._factory}setTokenFactory(t){this._input.tokenSource._factory=t}getATNWithBypassAlts(){const t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";let e=this.bypassAltsAtnCache[t];if(null===e){const n=new mt;n.generateRuleBypassTransitions=!0,e=new Nt(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e}getInputStream(){return this.getTokenStream()}setInputStream(t){this.setTokenStream(t)}getTokenStream(){return this._input}setTokenStream(t){this._input=null,this.reset(),this._input=t}get syntaxErrorsCount(){return this._syntaxErrors}getCurrentToken(){return this._input.LT(1)}notifyErrorListeners(t,e,n){n=n||null,null===(e=e||null)&&(e=this.getCurrentToken()),this._syntaxErrors+=1;const i=e.line,s=e.column;this.getErrorListenerDispatch().syntaxError(this,e,i,s,t,n)}consume(){const e=this.getCurrentToken();e.type!==t.EOF&&this.getInputStream().consume();const n=null!==this._parseListeners&&this._parseListeners.length>0;if(this.buildParseTrees||n){let t;t=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(e):this._ctx.addTokenNode(e),t.invokingState=this.state,n&&this._parseListeners.forEach((function(e){t instanceof b||void 0!==t.isErrorNode&&t.isErrorNode()?e.visitErrorNode(t):t instanceof w&&e.visitTerminal(t)}))}return e}addContextToParseTree(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)}enterRule(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),this.triggerEnterRuleEvent()}exitRule(){this._ctx.stop=this._input.LT(-1),this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx}enterOuterAlt(t,e){t.setAltNumber(e),this.buildParseTrees&&this._ctx!==t&&null!==this._ctx.parentCtx&&(this._ctx.parentCtx.removeLastChild(),this._ctx.parentCtx.addChild(t)),this._ctx=t}getPrecedence(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]}enterRecursionRule(t,e,n,i){this.state=e,this._precedenceStack.push(i),this._ctx=t,this._ctx.start=this._input.LT(1),this.triggerEnterRuleEvent()}pushNewRecursionContext(t,e,n){const i=this._ctx;i.parentCtx=t,i.invokingState=e,i.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=i.start,this.buildParseTrees&&this._ctx.addChild(i),this.triggerEnterRuleEvent()}unrollRecursionContexts(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);const e=this._ctx,n=this.getParseListeners();if(null!==n&&n.length>0)for(;this._ctx!==t;)this.triggerExitRuleEvent(),this._ctx=this._ctx.parentCtx;else this._ctx=t;e.parentCtx=t,this.buildParseTrees&&null!==t&&t.addChild(e)}getInvokingContext(t){let e=this._ctx;for(;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null}precpred(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]}inContext(t){return!1}isExpectedToken(e){const n=this._interp.atn;let i=this._ctx;const s=n.states[this.state];let r=n.nextTokens(s);if(r.contains(e))return!0;if(!r.contains(t.EPSILON))return!1;for(;null!==i&&i.invokingState>=0&&r.contains(t.EPSILON);){const t=n.states[i.invokingState].transitions[0];if(r=n.nextTokens(t.followState),r.contains(e))return!0;i=i.parentCtx}return!(!r.contains(t.EPSILON)||e!==t.EOF)}getExpectedTokens(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)}getExpectedTokensWithinCurrentRule(){const t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)}getRuleIndex(t){const e=this.getRuleIndexMap()[t];return null!==e?e:-1}getRuleInvocationStack(t){null===(t=t||null)&&(t=this._ctx);const e=[];for(;null!==t;){const n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e}getDFAStrings(){return this._interp.decisionToDFA.toString()}dumpDFA(){let t=!1;for(let e=0;e<this._interp.decisionToDFA.length;e++){const n=this._interp.decisionToDFA[e];n.states.length>0&&(t&&console.log(),this.printer.println("Decision "+n.decision+":"),this.printer.print(n.toString(this.literalNames,this.symbolicNames)),t=!0)}}getSourceName(){return this._input.sourceName}setTrace(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new De(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)}}Ue.bypassAltsAtnCache={};class Me extends w{constructor(t){super(),this.parentCtx=null,this.symbol=t}getChild(t){return null}getSymbol(){return this.symbol}getParent(){return this.parentCtx}getPayload(){return this.symbol}getSourceInterval(){if(null===this.symbol)return T.INVALID_INTERVAL;const t=this.symbol.tokenIndex;return new T(t,t)}getChildCount(){return 0}accept(t){return t.visitTerminal(this)}getText(){return this.symbol.text}toString(){return this.symbol.type===t.EOF?"<EOF>":this.symbol.text}}class He extends Me{constructor(t){super(t)}isErrorNode(){return!0}accept(t){return t.visitErrorNode(this)}}class Fe extends M{constructor(t,e){super(t,e),this.children=null,this.start=null,this.stop=null,this.exception=null}copyFrom(t){this.parentCtx=t.parentCtx,this.invokingState=t.invokingState,this.children=null,this.start=t.start,this.stop=t.stop,t.children&&(this.children=[],t.children.map((function(t){t instanceof He&&(this.children.push(t),t.parentCtx=this)}),this))}enterRule(t){}exitRule(t){}addChild(t){return null===this.children&&(this.children=[]),this.children.push(t),t}removeLastChild(){null!==this.children&&this.children.pop()}addTokenNode(t){const e=new Me(t);return this.addChild(e),e.parentCtx=this,e}addErrorNode(t){const e=new He(t);return this.addChild(e),e.parentCtx=this,e}getChild(t,e){if(e=e||null,null===this.children||t<0||t>=this.children.length)return null;if(null===e)return this.children[t];for(let n=0;n<this.children.length;n++){const i=this.children[n];if(i instanceof e){if(0===t)return i;t-=1}}return null}getToken(t,e){if(null===this.children||e<0||e>=this.children.length)return null;for(let n=0;n<this.children.length;n++){const i=this.children[n];if(i instanceof w&&i.symbol.type===t){if(0===e)return i;e-=1}}return null}getTokens(t){if(null===this.children)return[];{const e=[];for(let n=0;n<this.children.length;n++){const i=this.children[n];i instanceof w&&i.symbol.type===t&&e.push(i)}return e}}getTypedRuleContext(t,e){return this.getChild(e,t)}getTypedRuleContexts(t){if(null===this.children)return[];{const e=[];for(let n=0;n<this.children.length;n++){const i=this.children[n];i instanceof t&&e.push(i)}return e}}getChildCount(){return null===this.children?0:this.children.length}getSourceInterval(){return null===this.start||null===this.stop?T.INVALID_INTERVAL:new T(this.start.tokenIndex,this.stop.tokenIndex)}}M.EMPTY=new Fe;class Be{constructor(t){this.tokens=t,this.programs=new Map}getTokenStream(){return this.tokens}insertAfter(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;n="number"==typeof t?t:t.tokenIndex;let s=this.getProgram(i),r=new Ke(this.tokens,n,s.length,e);s.push(r)}insertBefore(t,e){let n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;n="number"==typeof t?t:t.tokenIndex;const s=this.getProgram(i),r=new Ge(this.tokens,n,s.length,e);s.push(r)}replaceSingle(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;this.replace(t,t,e,n)}replace(t,e,n){let i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Be.DEFAULT_PROGRAM_NAME;if("number"!=typeof t&&(t=t.tokenIndex),"number"!=typeof e&&(e=e.tokenIndex),t>e||t<0||e<0||e>=this.tokens.size)throw new RangeError(`replace: range invalid: ${t}..${e}(size=${this.tokens.size})`);let s=this.getProgram(i),r=new qe(this.tokens,t,e,s.length,n);s.push(r)}delete(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Be.DEFAULT_PROGRAM_NAME;void 0===e&&(e=t),this.replace(t,e,null,n)}getProgram(t){let e=this.programs.get(t);return null==e&&(e=this.initializeProgram(t)),e}initializeProgram(t){const e=[];return this.programs.set(t,e),e}getText(e){let n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Be.DEFAULT_PROGRAM_NAME;n=e instanceof T?e:new T(0,this.tokens.size-1),"string"==typeof e&&(i=e);const s=this.programs.get(i);let r=n.start,o=n.stop;if(o>this.tokens.size-1&&(o=this.tokens.size-1),r<0&&(r=0),null==s||0===s.length)return this.tokens.getText(new T(r,o));let a=[],l=this.reduceToSingleOperationPerIndex(s),h=r;for(;h<=o&&h<this.tokens.size;){let e=l.get(h);l.delete(h);let n=this.tokens.get(h);null==e?(n.type!==t.EOF&&a.push(String(n.text)),h++):h=e.execute(a)}if(o===this.tokens.size-1)for(const t of l.values())t.index>=this.tokens.size-1&&a.push(t.text.toString());return a.join("")}reduceToSingleOperationPerIndex(t){for(let e=0;e<t.length;e++){let n=t[e];if(null==n)continue;if(!(n instanceof qe))continue;let i=n,s=this.getKindOfOps(t,Ge,e);for(let e of s)e.index===i.index?(t[e.instructionIndex]=void 0,i.text=e.text.toString()+(null!=i.text?i.text.toString():"")):e.index>i.index&&e.index<=i.lastIndex&&(t[e.instructionIndex]=void 0);let r=this.getKindOfOps(t,qe,e);for(let e of r){if(e.index>=i.index&&e.lastIndex<=i.lastIndex){t[e.instructionIndex]=void 0;continue}let n=e.lastIndex<i.index||e.index>i.lastIndex;if(null!=e.text||null!=i.text||n){if(!n)throw new Error(`replace op boundaries of ${i} overlap with previous ${e}`)}else t[e.instructionIndex]=void 0,i.index=Math.min(e.index,i.index),i.lastIndex=Math.max(e.lastIndex,i.lastIndex)}}for(let e=0;e<t.length;e++){let n=t[e];if(null==n)continue;if(!(n instanceof Ge))continue;let i=n,s=this.getKindOfOps(t,Ge,e);for(let e of s)e.index===i.index&&(e instanceof Ke?(i.text=this.catOpText(e.text,i.text),t[e.instructionIndex]=void 0):e instanceof Ge&&(i.text=this.catOpText(i.text,e.text),t[e.instructionIndex]=void 0));let r=this.getKindOfOps(t,qe,e);for(let n of r)if(i.index!==n.index){if(i.index>=n.index&&i.index<=n.lastIndex)throw new Error(`insert op ${i} within boundaries of previous ${n}`)}else n.text=this.catOpText(i.text,n.text),t[e]=void 0}let e=new Map;for(let n of t)if(null!=n){if(null!=e.get(n.index))throw new Error("should only be one op per index");e.set(n.index,n)}return e}catOpText(t,e){let n="",i="";return null!=t&&(n=t.toString()),null!=e&&(i=e.toString()),n+i}getKindOfOps(t,e,n){return t.slice(0,n).filter((t=>t&&t instanceof e))}}var Ve,We,$e;Ve=Be,$e="default",(We=function(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:String(e)}(We="DEFAULT_PROGRAM_NAME"))in Ve?Object.defineProperty(Ve,We,{value:$e,enumerable:!0,configurable:!0,writable:!0}):Ve[We]=$e;class Qe{constructor(t,e,n,i){this.tokens=t,this.instructionIndex=n,this.index=e,this.text=void 0===i?"":i}toString(){let t=this.constructor.name;const e=t.indexOf("$");return t=t.substring(e+1,t.length),"<"+t+"@"+this.tokens.get(this.index)+':"'+this.text+'">'}}class Ge extends Qe{constructor(t,e,n,i){super(t,e,n,i)}execute(e){return this.text&&e.push(this.text.toString()),this.tokens.get(this.index).type!==t.EOF&&e.push(String(this.tokens.get(this.index).text)),this.index+1}}class Ke extends Ge{constructor(t,e,n,i){super(t,e+1,n,i)}}class qe extends Qe{constructor(t,e,n,i,s){super(t,e,i,s),this.lastIndex=n}execute(t){return this.text&&t.push(this.text.toString()),this.lastIndex+1}toString(){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+'">'}}const Ye={atn:re,dfa:he,context:ue,misc:ce,tree:xe,error:Ce,Token:t,CommonToken:wt,CharStreams:ke,CharStream:Le,InputStream:Le,CommonTokenStream:be,Lexer:Ht,Parser:Ue,ParserRuleContext:Fe,Interval:T,IntervalSet:R,LL1Analyzer:Y,Utils:Oe,TokenStreamRewriter:Be}})();var l=a.ZP;class h extends l.Lexer{constructor(t){super(t),this.currentDepth=0}reset(){super.reset()}IsInTemplateString(){return this.currentDepth>0}ProcessTemplateOpen(){this.currentDepth++}ProcessTemplateClose(){this.currentDepth--}}const u=(new l.atn.ATNDeserializer).deserialize([4,0,82,855,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7,66,2,67,7,67,2,68,7,68,2,69,7,69,2,70,7,70,2,71,7,71,2,72,7,72,2,73,7,73,2,74,7,74,2,75,7,75,2,76,7,76,2,77,7,77,2,78,7,78,2,79,7,79,2,80,7,80,2,81,7,81,2,82,7,82,2,83,7,83,2,84,7,84,2,85,7,85,2,86,7,86,2,87,7,87,2,88,7,88,2,89,7,89,2,90,7,90,2,91,7,91,2,92,7,92,2,93,7,93,2,94,7,94,2,95,7,95,2,96,7,96,2,97,7,97,2,98,7,98,2,99,7,99,2,100,7,100,2,101,7,101,2,102,7,102,2,103,7,103,2,104,7,104,2,105,7,105,2,106,7,106,2,107,7,107,2,108,7,108,2,109,7,109,2,110,7,110,2,111,7,111,2,112,7,112,2,113,7,113,1,0,1,0,5,0,237,8,0,10,0,12,0,240,9,0,1,0,3,0,243,8,0,1,0,1,0,1,0,1,1,1,1,1,1,1,1,1,1,4,1,253,8,1,11,1,12,1,254,1,1,3,1,258,8,1,1,1,1,1,4,1,262,8,1,11,1,12,1,263,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,282,8,1,10,1,12,1,285,9,1,1,1,5,1,288,8,1,10,1,12,1,291,9,1,1,2,1,2,1,2,1,2,1,2,3,2,298,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,313,8,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,3,2,362,8,2,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,1,3,3,3,401,8,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,5,1,6,1,6,1,6,1,6,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,1,8,3,8,442,8,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,3,9,452,8,9,1,10,1,10,1,10,1,11,3,11,458,8,11,1,11,1,11,1,11,1,11,1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,13,1,14,1,14,1,14,1,14,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,16,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,20,1,21,1,21,1,21,1,21,1,21,1,22,1,22,1,22,1,22,1,22,1,23,1,23,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,25,1,25,1,25,1,25,1,26,1,26,1,26,1,26,1,26,3,26,543,8,26,1,27,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,29,1,30,1,30,1,30,1,31,1,31,1,32,4,32,562,8,32,11,32,12,32,563,1,33,1,33,1,33,1,33,1,34,1,34,1,35,1,35,1,35,1,36,1,36,1,36,1,37,1,37,1,37,1,38,1,38,1,38,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,41,1,41,1,41,1,41,1,42,1,42,1,42,1,42,1,43,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,45,1,45,1,46,1,46,1,47,1,47,1,47,3,47,620,8,47,1,47,1,47,1,47,5,47,625,8,47,10,47,12,47,628,9,47,1,48,1,48,1,49,1,49,1,50,1,50,1,51,1,51,1,52,1,52,1,53,1,53,1,54,1,54,1,55,1,55,1,56,1,56,1,57,1,57,1,58,1,58,1,59,1,59,1,60,1,60,1,61,1,61,1,62,1,62,1,63,1,63,1,64,1,64,1,65,1,65,1,66,1,66,1,67,1,67,1,68,1,68,1,69,1,69,1,70,1,70,1,71,1,71,1,72,1,72,1,73,1,73,1,74,1,74,1,75,1,75,1,76,1,76,1,77,1,77,1,78,1,78,1,79,1,79,1,79,1,79,3,79,696,8,79,1,80,1,80,1,81,1,81,1,81,1,81,3,81,704,8,81,1,82,1,82,1,82,1,83,1,83,1,84,1,84,1,85,1,85,1,85,1,85,1,85,1,86,1,86,5,86,720,8,86,10,86,12,86,723,9,86,1,86,1,86,1,86,1,86,1,87,1,87,1,87,1,87,3,87,733,8,87,1,87,1,87,5,87,737,8,87,10,87,12,87,740,9,87,1,87,1,87,1,88,1,88,1,89,1,89,1,90,1,90,1,90,1,90,1,91,1,91,1,92,1,92,1,93,1,93,1,94,1,94,1,95,3,95,761,8,95,1,95,1,95,4,95,765,8,95,11,95,12,95,766,1,96,4,96,770,8,96,11,96,12,96,771,1,96,1,96,1,97,1,97,5,97,778,8,97,10,97,12,97,781,9,97,1,97,1,97,1,97,1,97,1,98,1,98,1,99,1,99,1,99,1,100,1,100,1,100,1,100,1,100,1,100,1,100,1,101,1,101,1,101,1,101,1,101,1,102,1,102,1,103,1,103,1,103,1,104,1,104,1,104,1,104,1,104,1,105,1,105,1,105,1,105,1,105,1,105,1,105,1,106,1,106,1,107,1,107,1,107,1,107,1,107,1,107,1,108,1,108,1,109,1,109,1,109,1,109,1,109,1,110,1,110,1,110,1,110,1,111,1,111,1,112,3,112,843,8,112,1,112,1,112,4,112,847,8,112,11,112,12,112,848,1,112,1,112,1,112,1,113,1,113,1,738,0,114,6,1,8,2,10,3,12,4,14,5,16,6,18,7,20,8,22,9,24,10,26,11,28,12,30,13,32,14,34,15,36,16,38,17,40,18,42,19,44,20,46,21,48,22,50,23,52,24,54,25,56,26,58,27,60,28,62,29,64,30,66,31,68,32,70,33,72,34,74,35,76,36,78,37,80,38,82,39,84,40,86,41,88,42,90,43,92,44,94,45,96,0,98,0,100,46,102,0,104,0,106,0,108,0,110,0,112,0,114,0,116,0,118,0,120,0,122,0,124,0,126,0,128,0,130,0,132,0,134,0,136,0,138,0,140,0,142,0,144,0,146,0,148,0,150,0,152,47,154,48,156,49,158,50,160,51,162,52,164,53,166,54,168,55,170,56,172,57,174,58,176,59,178,60,180,61,182,62,184,63,186,64,188,65,190,66,192,67,194,68,196,69,198,70,200,71,202,72,204,73,206,74,208,0,210,75,212,76,214,0,216,77,218,78,220,0,222,79,224,0,226,80,228,81,230,0,232,82,6,0,1,2,3,4,5,32,1,0,48,57,1,0,97,122,1,0,65,90,2,0,48,57,95,95,2,0,65,65,97,97,2,0,66,66,98,98,2,0,67,67,99,99,2,0,68,68,100,100,2,0,69,69,101,101,2,0,70,70,102,102,2,0,71,71,103,103,2,0,72,72,104,104,2,0,73,73,105,105,2,0,74,74,106,106,2,0,75,75,107,107,2,0,76,76,108,108,2,0,77,77,109,109,2,0,78,78,110,110,2,0,79,79,111,111,2,0,80,80,112,112,2,0,82,82,114,114,2,0,83,83,115,115,2,0,84,84,116,116,2,0,85,85,117,117,2,0,86,86,118,118,2,0,87,87,119,119,2,0,88,88,120,120,2,0,89,89,121,121,2,0,90,90,122,122,2,0,9,9,32,32,1,0,39,39,1,0,34,34,866,0,6,1,0,0,0,0,8,1,0,0,0,0,10,1,0,0,0,0,12,1,0,0,0,0,14,1,0,0,0,0,16,1,0,0,0,0,18,1,0,0,0,0,20,1,0,0,0,0,22,1,0,0,0,0,24,1,0,0,0,0,26,1,0,0,0,0,28,1,0,0,0,0,30,1,0,0,0,0,32,1,0,0,0,0,34,1,0,0,0,0,36,1,0,0,0,0,38,1,0,0,0,0,40,1,0,0,0,0,42,1,0,0,0,0,44,1,0,0,0,0,46,1,0,0,0,0,48,1,0,0,0,0,50,1,0,0,0,0,52,1,0,0,0,0,54,1,0,0,0,0,56,1,0,0,0,0,58,1,0,0,0,0,60,1,0,0,0,0,62,1,0,0,0,0,64,1,0,0,0,0,66,1,0,0,0,0,68,1,0,0,0,0,70,1,0,0,0,0,72,1,0,0,0,0,74,1,0,0,0,0,76,1,0,0,0,0,78,1,0,0,0,0,80,1,0,0,0,0,82,1,0,0,0,0,84,1,0,0,0,0,86,1,0,0,0,0,88,1,0,0,0,0,90,1,0,0,0,0,92,1,0,0,0,0,94,1,0,0,0,0,100,1,0,0,0,0,152,1,0,0,0,0,154,1,0,0,0,0,156,1,0,0,0,0,158,1,0,0,0,0,160,1,0,0,0,0,162,1,0,0,0,0,164,1,0,0,0,0,166,1,0,0,0,0,168,1,0,0,0,0,170,1,0,0,0,0,172,1,0,0,0,0,174,1,0,0,0,0,176,1,0,0,0,0,178,1,0,0,0,0,180,1,0,0,0,0,182,1,0,0,0,0,184,1,0,0,0,0,186,1,0,0,0,0,188,1,0,0,0,0,190,1,0,0,0,0,192,1,0,0,0,0,194,1,0,0,0,0,196,1,0,0,0,0,198,1,0,0,0,0,200,1,0,0,0,0,202,1,0,0,0,1,204,1,0,0,0,1,206,1,0,0,0,1,208,1,0,0,0,1,210,1,0,0,0,2,212,1,0,0,0,2,214,1,0,0,0,2,216,1,0,0,0,2,218,1,0,0,0,3,220,1,0,0,0,3,222,1,0,0,0,4,224,1,0,0,0,4,226,1,0,0,0,4,228,1,0,0,0,5,230,1,0,0,0,5,232,1,0,0,0,6,234,1,0,0,0,8,247,1,0,0,0,10,361,1,0,0,0,12,400,1,0,0,0,14,402,1,0,0,0,16,409,1,0,0,0,18,417,1,0,0,0,20,424,1,0,0,0,22,441,1,0,0,0,24,451,1,0,0,0,26,453,1,0,0,0,28,457,1,0,0,0,30,465,1,0,0,0,32,470,1,0,0,0,34,478,1,0,0,0,36,482,1,0,0,0,38,491,1,0,0,0,40,496,1,0,0,0,42,498,1,0,0,0,44,501,1,0,0,0,46,504,1,0,0,0,48,513,1,0,0,0,50,518,1,0,0,0,52,523,1,0,0,0,54,527,1,0,0,0,56,530,1,0,0,0,58,537,1,0,0,0,60,544,1,0,0,0,62,548,1,0,0,0,64,551,1,0,0,0,66,555,1,0,0,0,68,558,1,0,0,0,70,561,1,0,0,0,72,565,1,0,0,0,74,569,1,0,0,0,76,571,1,0,0,0,78,574,1,0,0,0,80,577,1,0,0,0,82,580,1,0,0,0,84,583,1,0,0,0,86,586,1,0,0,0,88,594,1,0,0,0,90,598,1,0,0,0,92,602,1,0,0,0,94,608,1,0,0,0,96,612,1,0,0,0,98,614,1,0,0,0,100,619,1,0,0,0,102,629,1,0,0,0,104,631,1,0,0,0,106,633,1,0,0,0,108,635,1,0,0,0,110,637,1,0,0,0,112,639,1,0,0,0,114,641,1,0,0,0,116,643,1,0,0,0,118,645,1,0,0,0,120,647,1,0,0,0,122,649,1,0,0,0,124,651,1,0,0,0,126,653,1,0,0,0,128,655,1,0,0,0,130,657,1,0,0,0,132,659,1,0,0,0,134,661,1,0,0,0,136,663,1,0,0,0,138,665,1,0,0,0,140,667,1,0,0,0,142,669,1,0,0,0,144,671,1,0,0,0,146,673,1,0,0,0,148,675,1,0,0,0,150,677,1,0,0,0,152,679,1,0,0,0,154,681,1,0,0,0,156,683,1,0,0,0,158,685,1,0,0,0,160,687,1,0,0,0,162,689,1,0,0,0,164,695,1,0,0,0,166,697,1,0,0,0,168,703,1,0,0,0,170,705,1,0,0,0,172,708,1,0,0,0,174,710,1,0,0,0,176,712,1,0,0,0,178,717,1,0,0,0,180,728,1,0,0,0,182,743,1,0,0,0,184,745,1,0,0,0,186,747,1,0,0,0,188,751,1,0,0,0,190,753,1,0,0,0,192,755,1,0,0,0,194,757,1,0,0,0,196,764,1,0,0,0,198,769,1,0,0,0,200,775,1,0,0,0,202,786,1,0,0,0,204,788,1,0,0,0,206,791,1,0,0,0,208,798,1,0,0,0,210,803,1,0,0,0,212,805,1,0,0,0,214,808,1,0,0,0,216,813,1,0,0,0,218,820,1,0,0,0,220,822,1,0,0,0,222,828,1,0,0,0,224,830,1,0,0,0,226,835,1,0,0,0,228,839,1,0,0,0,230,846,1,0,0,0,232,853,1,0,0,0,234,238,5,35,0,0,235,237,5,32,0,0,236,235,1,0,0,0,237,240,1,0,0,0,238,236,1,0,0,0,238,239,1,0,0,0,239,242,1,0,0,0,240,238,1,0,0,0,241,243,3,172,83,0,242,241,1,0,0,0,242,243,1,0,0,0,243,244,1,0,0,0,244,245,3,100,47,0,245,246,3,196,95,0,246,7,1,0,0,0,247,248,5,45,0,0,248,249,5,45,0,0,249,250,5,45,0,0,250,252,1,0,0,0,251,253,5,32,0,0,252,251,1,0,0,0,253,254,1,0,0,0,254,252,1,0,0,0,254,255,1,0,0,0,255,257,1,0,0,0,256,258,3,172,83,0,257,256,1,0,0,0,257,258,1,0,0,0,258,259,1,0,0,0,259,261,3,100,47,0,260,262,5,32,0,0,261,260,1,0,0,0,262,263,1,0,0,0,263,261,1,0,0,0,263,264,1,0,0,0,264,265,1,0,0,0,265,266,5,45,0,0,266,267,5,45,0,0,267,268,5,45,0,0,268,269,5,45,0,0,269,270,5,45,0,0,270,271,5,45,0,0,271,272,5,45,0,0,272,273,5,45,0,0,273,274,5,45,0,0,274,275,5,45,0,0,275,276,5,45,0,0,276,277,5,45,0,0,277,278,5,45,0,0,278,279,5,45,0,0,279,283,1,0,0,0,280,282,5,45,0,0,281,280,1,0,0,0,282,285,1,0,0,0,283,281,1,0,0,0,283,284,1,0,0,0,284,289,1,0,0,0,285,283,1,0,0,0,286,288,3,196,95,0,287,286,1,0,0,0,288,291,1,0,0,0,289,287,1,0,0,0,289,290,1,0,0,0,290,9,1,0,0,0,291,289,1,0,0,0,292,293,3,106,50,0,293,294,3,124,59,0,294,295,3,102,48,0,295,362,1,0,0,0,296,298,3,152,73,0,297,296,1,0,0,0,297,298,1,0,0,0,298,299,1,0,0,0,299,300,3,106,50,0,300,301,3,124,59,0,301,302,3,110,52,0,302,303,3,102,48,0,303,304,3,134,64,0,304,362,1,0,0,0,305,306,3,106,50,0,306,307,3,124,59,0,307,308,3,130,62,0,308,309,3,136,65,0,309,310,3,110,52,0,310,362,1,0,0,0,311,313,3,152,73,0,312,311,1,0,0,0,312,313,1,0,0,0,313,314,1,0,0,0,314,315,3,106,50,0,315,316,3,124,59,0,316,317,3,134,64,0,317,362,1,0,0,0,318,319,3,106,50,0,319,320,3,124,59,0,320,321,3,136,65,0,321,362,1,0,0,0,322,323,3,106,50,0,323,324,3,126,60,0,324,325,3,108,51,0,325,326,3,106,50,0,326,327,3,124,59,0,327,328,3,110,52,0,328,329,3,102,48,0,329,330,3,134,64,0,330,362,1,0,0,0,331,332,3,106,50,0,332,333,3,126,60,0,333,334,3,108,51,0,334,335,3,106,50,0,335,336,3,124,59,0,336,337,3,134,64,0,337,362,1,0,0,0,338,339,3,106,50,0,339,340,3,124,59,0,340,341,3,130,62,0,341,342,3,136,65,0,342,343,3,110,52,0,343,344,5,32,0,0,344,345,3,102,48,0,345,346,3,124,59,0,346,347,3,124,59,0,347,362,1,0,0,0,348,349,3,110,52,0,349,350,3,146,70,0,350,351,3,118,56,0,351,352,3,138,66,0,352,362,1,0,0,0,353,354,3,122,58,0,354,355,3,118,56,0,355,356,3,124,59,0,356,357,3,124,59,0,357,358,3,102,48,0,358,359,3,124,59,0,359,360,3,124,59,0,360,362,1,0,0,0,361,292,1,0,0,0,361,297,1,0,0,0,361,305,1,0,0,0,361,312,1,0,0,0,361,318,1,0,0,0,361,322,1,0,0,0,361,331,1,0,0,0,361,338,1,0,0,0,361,348,1,0,0,0,361,353,1,0,0,0,362,11,1,0,0,0,363,364,3,136,65,0,364,365,3,116,55,0,365,366,3,130,62,0,366,367,3,144,69,0,367,368,3,136,65,0,368,369,3,138,66,0,369,370,3,102,48,0,370,371,3,138,66,0,371,401,1,0,0,0,372,373,3,136,65,0,373,374,3,116,55,0,374,375,3,130,62,0,375,376,3,144,69,0,376,377,3,130,62,0,377,378,3,104,49,0,378,379,3,120,57,0,379,380,3,136,65,0,380,401,1,0,0,0,381,382,3,136,65,0,382,383,3,116,55,0,383,384,3,130,62,0,384,385,3,144,69,0,385,386,3,118,56,0,386,387,3,128,61,0,387,388,3,132,63,0,388,389,3,140,67,0,389,390,3,138,66,0,390,401,1,0,0,0,391,392,3,136,65,0,392,393,3,116,55,0,393,394,3,130,62,0,394,395,3,144,69,0,395,396,3,102,48,0,396,397,3,106,50,0,397,398,3,138,66,0,398,399,3,136,65,0,399,401,1,0,0,0,400,363,1,0,0,0,400,372,1,0,0,0,400,381,1,0,0,0,400,391,1,0,0,0,401,13,1,0,0,0,402,403,3,102,48,0,403,404,3,108,51,0,404,405,3,108,51,0,405,406,3,130,62,0,406,407,3,104,49,0,407,408,3,120,57,0,408,15,1,0,0,0,409,410,3,106,50,0,410,411,3,130,62,0,411,412,3,132,63,0,412,413,3,148,71,0,413,414,3,102,48,0,414,415,3,134,64,0,415,416,3,134,64,0,416,17,1,0,0,0,417,418,3,108,51,0,418,419,3,110,52,0,419,420,3,124,59,0,420,421,3,102,48,0,421,422,3,106,50,0,422,423,3,138,66,0,423,19,1,0,0,0,424,425,3,108,51,0,425,426,3,148,71,0,426,427,3,128,61,0,427,428,3,102,48,0,428,429,3,126,60,0,429,430,3,118,56,0,430,431,3,106,50,0,431,21,1,0,0,0,432,433,3,114,54,0,433,434,3,136,65,0,434,442,1,0,0,0,435,436,3,114,54,0,436,437,3,130,62,0,437,438,3,136,65,0,438,439,3,140,67,0,439,440,3,104,49,0,440,442,1,0,0,0,441,432,1,0,0,0,441,435,1,0,0,0,442,23,1,0,0,0,443,444,3,114,54,0,444,445,3,138,66,0,445,452,1,0,0,0,446,447,3,114,54,0,447,448,3,130,62,0,448,449,3,138,66,0,449,450,3,130,62,0,450,452,1,0,0,0,451,443,1,0,0,0,451,446,1,0,0,0,452,25,1,0,0,0,453,454,3,146,70,0,454,455,3,24,9,0,455,27,1,0,0,0,456,458,5,36,0,0,457,456,1,0,0,0,457,458,1,0,0,0,458,459,1,0,0,0,459,460,3,118,56,0,460,461,3,128,61,0,461,462,3,132,63,0,462,463,3,140,67,0,463,464,3,138,66,0,464,29,1,0,0,0,465,466,3,120,57,0,466,467,3,140,67,0,467,468,3,126,60,0,468,469,3,132,63,0,469,31,1,0,0,0,470,471,3,122,58,0,471,472,3,118,56,0,472,473,3,124,59,0,473,474,3,124,59,0,474,475,3,142,68,0,475,476,3,102,48,0,476,477,3,134,64,0,477,33,1,0,0,0,478,479,3,126,60,0,479,480,3,136,65,0,480,481,3,114,54,0,481,35,1,0,0,0,482,483,3,130,62,0,483,484,3,132,63,0,484,485,3,110,52,0,485,486,3,128,61,0,486,487,3,114,54,0,487,488,3,102,48,0,488,489,3,126,60,0,489,490,3,110,52,0,490,37,1,0,0,0,491,492,3,132,63,0,492,493,3,124,59,0,493,494,3,102,48,0,494,495,3,148,71,0,495,39,1,0,0,0,496,497,3,132,63,0,497,41,1,0,0,0,498,499,3,132,63,0,499,500,3,124,59,0,500,43,1,0,0,0,501,502,3,128,61,0,502,503,3,124,59,0,503,45,1,0,0,0,504,505,3,136,65,0,505,506,3,102,48,0,506,507,3,142,68,0,507,508,3,110,52,0,508,509,3,114,54,0,509,510,3,102,48,0,510,511,3,126,60,0,511,512,3,110,52,0,512,47,1,0,0,0,513,514,3,142,68,0,514,515,3,118,56,0,515,516,3,110,52,0,516,517,3,144,69,0,517,49,1,0,0,0,518,519,3,144,69,0,519,520,3,102,48,0,520,521,3,118,56,0,521,522,3,138,66,0,522,51,1,0,0,0,523,524,3,102,48,0,524,525,3,106,50,0,525,526,3,138,66,0,526,53,1,0,0,0,527,528,3,118,56,0,528,529,3,112,53,0,529,55,1,0,0,0,530,531,3,110,52,0,531,532,3,124,59,0,532,533,3,136,65,0,533,534,3,110,52,0,534,535,3,118,56,0,535,536,3,112,53,0,536,57,1,0,0,0,537,538,3,110,52,0,538,539,3,124,59,0,539,540,3,136,65,0,540,542,3,110,52,0,541,543,3,154,74,0,542,541,1,0,0,0,542,543,1,0,0,0,543,59,1,0,0,0,544,545,3,110,52,0,545,546,3,128,61,0,546,547,3,108,51,0,547,61,1,0,0,0,548,549,3,128,61,0,549,550,3,130,62,0,550,63,1,0,0,0,551,552,3,102,48,0,552,553,3,128,61,0,553,554,3,108,51,0,554,65,1,0,0,0,555,556,3,130,62,0,556,557,3,134,64,0,557,67,1,0,0,0,558,559,5,38,0,0,559,69,1,0,0,0,560,562,7,0,0,0,561,560,1,0,0,0,562,563,1,0,0,0,563,561,1,0,0,0,563,564,1,0,0,0,564,71,1,0,0,0,565,566,3,136,65,0,566,567,3,110,52,0,567,568,3,138,66,0,568,73,1,0,0,0,569,570,5,61,0,0,570,75,1,0,0,0,571,572,5,43,0,0,572,573,5,61,0,0,573,77,1,0,0,0,574,575,5,45,0,0,575,576,5,61,0,0,576,79,1,0,0,0,577,578,5,47,0,0,578,579,5,61,0,0,579,81,1,0,0,0,580,581,5,42,0,0,581,582,5,61,0,0,582,83,1,0,0,0,583,584,5,116,0,0,584,585,5,111,0,0,585,85,1,0,0,0,586,587,4,40,0,0,587,588,5,62,0,0,588,589,5,62,0,0,589,590,1,0,0,0,590,591,6,40,0,0,591,592,1,0,0,0,592,593,6,40,1,0,593,87,1,0,0,0,594,595,5,34,0,0,595,596,1,0,0,0,596,597,6,41,2,0,597,89,1,0,0,0,598,599,5,39,0,0,599,600,1,0,0,0,600,601,6,42,3,0,601,91,1,0,0,0,602,603,4,43,1,0,603,604,5,39,0,0,604,605,5,39,0,0,605,606,1,0,0,0,606,607,6,43,4,0,607,93,1,0,0,0,608,609,3,126,60,0,609,610,3,130,62,0,610,611,3,108,51,0,611,95,1,0,0,0,612,613,7,1,0,0,613,97,1,0,0,0,614,615,7,2,0,0,615,99,1,0,0,0,616,620,3,96,45,0,617,620,3,98,46,0,618,620,5,95,0,0,619,616,1,0,0,0,619,617,1,0,0,0,619,618,1,0,0,0,620,626,1,0,0,0,621,625,3,96,45,0,622,625,3,98,46,0,623,625,7,3,0,0,624,621,1,0,0,0,624,622,1,0,0,0,624,623,1,0,0,0,625,628,1,0,0,0,626,624,1,0,0,0,626,627,1,0,0,0,627,101,1,0,0,0,628,626,1,0,0,0,629,630,7,4,0,0,630,103,1,0,0,0,631,632,7,5,0,0,632,105,1,0,0,0,633,634,7,6,0,0,634,107,1,0,0,0,635,636,7,7,0,0,636,109,1,0,0,0,637,638,7,8,0,0,638,111,1,0,0,0,639,640,7,9,0,0,640,113,1,0,0,0,641,642,7,10,0,0,642,115,1,0,0,0,643,644,7,11,0,0,644,117,1,0,0,0,645,646,7,12,0,0,646,119,1,0,0,0,647,648,7,13,0,0,648,121,1,0,0,0,649,650,7,14,0,0,650,123,1,0,0,0,651,652,7,15,0,0,652,125,1,0,0,0,653,654,7,16,0,0,654,127,1,0,0,0,655,656,7,17,0,0,656,129,1,0,0,0,657,658,7,18,0,0,658,131,1,0,0,0,659,660,7,19,0,0,660,133,1,0,0,0,661,662,7,20,0,0,662,135,1,0,0,0,663,664,7,21,0,0,664,137,1,0,0,0,665,666,7,22,0,0,666,139,1,0,0,0,667,668,7,23,0,0,668,141,1,0,0,0,669,670,7,24,0,0,670,143,1,0,0,0,671,672,7,25,0,0,672,145,1,0,0,0,673,674,7,26,0,0,674,147,1,0,0,0,675,676,7,27,0,0,676,149,1,0,0,0,677,678,7,28,0,0,678,151,1,0,0,0,679,680,5,42,0,0,680,153,1,0,0,0,681,682,5,58,0,0,682,155,1,0,0,0,683,684,5,43,0,0,684,157,1,0,0,0,685,686,5,45,0,0,686,159,1,0,0,0,687,688,5,47,0,0,688,161,1,0,0,0,689,690,5,62,0,0,690,163,1,0,0,0,691,692,5,62,0,0,692,696,5,61,0,0,693,694,5,61,0,0,694,696,5,62,0,0,695,691,1,0,0,0,695,693,1,0,0,0,696,165,1,0,0,0,697,698,5,60,0,0,698,167,1,0,0,0,699,700,5,60,0,0,700,704,5,61,0,0,701,702,5,61,0,0,702,704,5,60,0,0,703,699,1,0,0,0,703,701,1,0,0,0,704,169,1,0,0,0,705,706,5,60,0,0,706,707,5,62,0,0,707,171,1,0,0,0,708,709,5,36,0,0,709,173,1,0,0,0,710,711,5,33,0,0,711,175,1,0,0,0,712,713,5,33,0,0,713,714,5,33,0,0,714,715,1,0,0,0,715,716,6,85,5,0,716,177,1,0,0,0,717,721,5,38,0,0,718,720,5,32,0,0,719,718,1,0,0,0,720,723,1,0,0,0,721,719,1,0,0,0,721,722,1,0,0,0,722,724,1,0,0,0,723,721,1,0,0,0,724,725,5,33,0,0,725,726,1,0,0,0,726,727,6,86,5,0,727,179,1,0,0,0,728,729,5,33,0,0,729,730,5,33,0,0,730,732,1,0,0,0,731,733,3,198,96,0,732,731,1,0,0,0,732,733,1,0,0,0,733,734,1,0,0,0,734,738,5,123,0,0,735,737,9,0,0,0,736,735,1,0,0,0,737,740,1,0,0,0,738,739,1,0,0,0,738,736,1,0,0,0,739,741,1,0,0,0,740,738,1,0,0,0,741,742,5,125,0,0,742,181,1,0,0,0,743,744,5,91,0,0,744,183,1,0,0,0,745,746,5,93,0,0,746,185,1,0,0,0,747,748,5,123,0,0,748,749,1,0,0,0,749,750,6,90,6,0,750,187,1,0,0,0,751,752,5,40,0,0,752,189,1,0,0,0,753,754,5,41,0,0,754,191,1,0,0,0,755,756,5,44,0,0,756,193,1,0,0,0,757,758,5,63,0,0,758,195,1,0,0,0,759,761,5,13,0,0,760,759,1,0,0,0,760,761,1,0,0,0,761,762,1,0,0,0,762,765,5,10,0,0,763,765,5,13,0,0,764,760,1,0,0,0,764,763,1,0,0,0,765,766,1,0,0,0,766,764,1,0,0,0,766,767,1,0,0,0,767,197,1,0,0,0,768,770,7,29,0,0,769,768,1,0,0,0,770,771,1,0,0,0,771,769,1,0,0,0,771,772,1,0,0,0,772,773,1,0,0,0,773,774,6,96,7,0,774,199,1,0,0,0,775,779,5,95,0,0,776,778,3,198,96,0,777,776,1,0,0,0,778,781,1,0,0,0,779,777,1,0,0,0,779,780,1,0,0,0,780,782,1,0,0,0,781,779,1,0,0,0,782,783,3,196,95,0,783,784,1,0,0,0,784,785,6,97,7,0,785,201,1,0,0,0,786,787,9,0,0,0,787,203,1,0,0,0,788,789,5,39,0,0,789,790,5,39,0,0,790,205,1,0,0,0,791,792,5,60,0,0,792,793,5,60,0,0,793,794,1,0,0,0,794,795,6,100,8,0,795,796,1,0,0,0,796,797,6,100,9,0,797,207,1,0,0,0,798,799,5,39,0,0,799,800,1,0,0,0,800,801,6,101,10,0,801,802,6,101,1,0,802,209,1,0,0,0,803,804,8,30,0,0,804,211,1,0,0,0,805,806,5,34,0,0,806,807,5,34,0,0,807,213,1,0,0,0,808,809,5,34,0,0,809,810,1,0,0,0,810,811,6,104,11,0,811,812,6,104,1,0,812,215,1,0,0,0,813,814,5,60,0,0,814,815,5,60,0,0,815,816,1,0,0,0,816,817,6,105,12,0,817,818,1,0,0,0,818,819,6,105,9,0,819,217,1,0,0,0,820,821,8,31,0,0,821,219,1,0,0,0,822,823,5,39,0,0,823,824,5,39,0,0,824,825,1,0,0,0,825,826,6,107,13,0,826,827,6,107,1,0,827,221,1,0,0,0,828,829,9,0,0,0,829,223,1,0,0,0,830,831,5,123,0,0,831,832,1,0,0,0,832,833,6,109,14,0,833,834,6,109,6,0,834,225,1,0,0,0,835,836,5,125,0,0,836,837,1,0,0,0,837,838,6,110,1,0,838,227,1,0,0,0,839,840,9,0,0,0,840,229,1,0,0,0,841,843,5,13,0,0,842,841,1,0,0,0,842,843,1,0,0,0,843,844,1,0,0,0,844,847,5,10,0,0,845,847,5,13,0,0,846,842,1,0,0,0,846,845,1,0,0,0,847,848,1,0,0,0,848,846,1,0,0,0,848,849,1,0,0,0,849,850,1,0,0,0,850,851,6,112,15,0,851,852,6,112,1,0,852,231,1,0,0,0,853,854,9,0,0,0,854,233,1,0,0,0,38,0,1,2,3,4,5,238,242,254,257,263,283,289,297,312,361,400,441,451,457,542,563,619,624,626,695,703,721,732,738,760,764,766,771,779,842,846,848,16,1,40,0,4,0,0,5,2,0,5,1,0,5,3,0,5,5,0,5,4,0,6,0,0,1,100,1,5,0,0,7,43,0,7,42,0,1,105,2,7,44,0,7,64,0,7,69,0]),c=u.decisionToState.map(((t,e)=>new l.dfa.DFA(t,e)));class d extends h{static grammarFileName="qsrcLexer.g4";static channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"];static modeNames=["DEFAULT_MODE","InString","inDQString","InEscapedString","MultiLine","COMMENT"];static literalNames=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"'&'",null,null,"'='","'+='","'-='","'/='","'*='","'to'",null,null,null,null,null,null,"'*'","':'","'+'","'-'","'/'","'>'",null,"'<'",null,"'<>'","'$'","'!'","'!!'",null,null,"'['","']'","'{'","'('","')'","','","'?'",null,null,null,null,null,null,null,"'\"\"'",null,null,null,"'}'"];static symbolicNames=[null,"PassageIdentifier","PassageEndMarker","SYSCALL","SYSSETTING","ADDOBJ","COPYARR","DELACT","DYNAMIC","GOSUB","GOTO","XGOTO","INPUT","JUMP","KILLVAR","MSG","OPENGAME","PLAY","Print","PrintNewline","PrintNewlinepre","SAVEGAME","VIEW","WAIT","ACT","IF","ELSEIF","ELSE","END","INVERT","AND","OR","CommandConnect","NumberLiteral","SET","EqualOperator","IncrementOperator","DecrementOperator","DivideSelfOperator","MultSelfOperator","SetToOperator","TemplateStringEndExpression","DOUBLEQUOTE","SINGLEQUOTE","TemplateDoubleSingleQuote","MOD","WORD","STAR","DPOINT","PLUS","MINUS","DIVIDE","GREATER_THAN","GREAT_EQUAL_THAN","LOWER_THAN","LOWER_EQUAL_THAN","NEQ","DOLLAR","EXCLAMATIONMARK","CommentStart","AttachedComment","Multilinecomment","ARRAYBRACKOPEN","ARRAYBRACKCLOSE","BRACK_OPEN","ParenthesisLeft","ParenthesisRight","Comma","Questionmark","NEWLINE","WHITESPACE","LINEBREAK","AnythingElse","EscapedSingleQuote","TemplateStringStartExpression","StringAtom","EscapedDoubleQuote","DQTemplateStringStartExpression","DQStringAtom","InEscapedStringAtom","BRACK_CLOSE","AnythingElseInMultiLine","InComment"];static ruleNames=["PassageIdentifier","PassageEndMarker","SYSCALL","SYSSETTING","ADDOBJ","COPYARR","DELACT","DYNAMIC","GOSUB","GOTO","XGOTO","INPUT","JUMP","KILLVAR","MSG","OPENGAME","PLAY","Print","PrintNewline","PrintNewlinepre","SAVEGAME","VIEW","WAIT","ACT","IF","ELSEIF","ELSE","END","INVERT","AND","OR","CommandConnect","NumberLiteral","SET","EqualOperator","IncrementOperator","DecrementOperator","DivideSelfOperator","MultSelfOperator","SetToOperator","TemplateStringEndExpression","DOUBLEQUOTE","SINGLEQUOTE","TemplateDoubleSingleQuote","MOD","LOWERCASE","UPPERCASE","WORD","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","R","S","T","U","V","W","X","Y","Z","STAR","DPOINT","PLUS","MINUS","DIVIDE","GREATER_THAN","GREAT_EQUAL_THAN","LOWER_THAN","LOWER_EQUAL_THAN","NEQ","DOLLAR","EXCLAMATIONMARK","CommentStart","AttachedComment","Multilinecomment","ARRAYBRACKOPEN","ARRAYBRACKCLOSE","BRACK_OPEN","ParenthesisLeft","ParenthesisRight","Comma","Questionmark","NEWLINE","WHITESPACE","LINEBREAK","AnythingElse","EscapedSingleQuote","TemplateStringStartExpression","SINGLEQUOTEINSIDE","StringAtom","EscapedDoubleQuote","DOUBLEQUOTEINSIDE","DQTemplateStringStartExpression","DQStringAtom","DoubleSINGLEQUOTEINSIDE","InEscapedStringAtom","BRACK_OPEN_INSIDE","BRACK_CLOSE","AnythingElseInMultiLine","COMMENNEWLINE","InComment"];constructor(t){super(t),this._interp=new l.atn.LexerATNSimulator(this,u,c,new l.atn.PredictionContextCache)}}d.EOF=l.Token.EOF,d.PassageIdentifier=1,d.PassageEndMarker=2,d.SYSCALL=3,d.SYSSETTING=4,d.ADDOBJ=5,d.COPYARR=6,d.DELACT=7,d.DYNAMIC=8,d.GOSUB=9,d.GOTO=10,d.XGOTO=11,d.INPUT=12,d.JUMP=13,d.KILLVAR=14,d.MSG=15,d.OPENGAME=16,d.PLAY=17,d.Print=18,d.PrintNewline=19,d.PrintNewlinepre=20,d.SAVEGAME=21,d.VIEW=22,d.WAIT=23,d.ACT=24,d.IF=25,d.ELSEIF=26,d.ELSE=27,d.END=28,d.INVERT=29,d.AND=30,d.OR=31,d.CommandConnect=32,d.NumberLiteral=33,d.SET=34,d.EqualOperator=35,d.IncrementOperator=36,d.DecrementOperator=37,d.DivideSelfOperator=38,d.MultSelfOperator=39,d.SetToOperator=40,d.TemplateStringEndExpression=41,d.DOUBLEQUOTE=42,d.SINGLEQUOTE=43,d.TemplateDoubleSingleQuote=44,d.MOD=45,d.WORD=46,d.STAR=47,d.DPOINT=48,d.PLUS=49,d.MINUS=50,d.DIVIDE=51,d.GREATER_THAN=52,d.GREAT_EQUAL_THAN=53,d.LOWER_THAN=54,d.LOWER_EQUAL_THAN=55,d.NEQ=56,d.DOLLAR=57,d.EXCLAMATIONMARK=58,d.CommentStart=59,d.AttachedComment=60,d.Multilinecomment=61,d.ARRAYBRACKOPEN=62,d.ARRAYBRACKCLOSE=63,d.BRACK_OPEN=64,d.ParenthesisLeft=65,d.ParenthesisRight=66,d.Comma=67,d.Questionmark=68,d.NEWLINE=69,d.WHITESPACE=70,d.LINEBREAK=71,d.AnythingElse=72,d.EscapedSingleQuote=73,d.TemplateStringStartExpression=74,d.StringAtom=75,d.EscapedDoubleQuote=76,d.DQTemplateStringStartExpression=77,d.DQStringAtom=78,d.InEscapedStringAtom=79,d.BRACK_CLOSE=80,d.AnythingElseInMultiLine=81,d.InComment=82,d.InString=1,d.inDQString=2,d.InEscapedString=3,d.MultiLine=4,d.COMMENT=5,d.prototype.action=function(t,e,n){switch(e){case 40:this.TemplateStringEndExpression_action(t,n);break;case 100:this.TemplateStringStartExpression_action(t,n);break;case 105:this.DQTemplateStringStartExpression_action(t,n);break;default:throw"No registered action for:"+e}},d.prototype.TemplateStringEndExpression_action=function(t,e){if(0!==e)throw"No registered action for:"+e;this.ProcessTemplateClose()},d.prototype.TemplateStringStartExpression_action=function(t,e){if(1!==e)throw"No registered action for:"+e;this.ProcessTemplateOpen()},d.prototype.DQTemplateStringStartExpression_action=function(t,e){if(2!==e)throw"No registered action for:"+e;this.ProcessTemplateOpen()},d.prototype.sempred=function(t,e,n){switch(e){case 40:return this.TemplateStringEndExpression_sempred(t,n);case 43:return this.TemplateDoubleSingleQuote_sempred(t,n);default:throw"No registered predicate for:"+e}},d.prototype.TemplateStringEndExpression_sempred=function(t,e){if(0===e)return this.IsInTemplateString();throw"No predicate with index:"+e},d.prototype.TemplateDoubleSingleQuote_sempred=function(t,e){if(1===e)return this.IsInTemplateString();throw"No predicate with index:"+e};class p extends l.tree.ParseTreeListener{enterPassage(t){}exitPassage(t){}enterBlock(t){}exitBlock(t){}enterStatementLine(t){}exitStatementLine(t){}enterEmptyLine(t){}exitEmptyLine(t){}enterActBlock(t){}exitActBlock(t){}enterActInline(t){}exitActInline(t){}enterActPicture(t){}exitActPicture(t){}enterIfInline(t){}exitIfInline(t){}enterIfBlock(t){}exitIfBlock(t){}enterElseIfBlock(t){}exitElseIfBlock(t){}enterElseBlock(t){}exitElseBlock(t){}enterCommand(t){}exitCommand(t){}enterCommandLine(t){}exitCommandLine(t){}enterCommandAppended(t){}exitCommandAppended(t){}enterAddobj(t){}exitAddobj(t){}enterAssignment(t){}exitAssignment(t){}enterAssignmentNumber(t){}exitAssignmentNumber(t){}enterAssignmentString(t){}exitAssignmentString(t){}enterAssignmentoperator(t){}exitAssignmentoperator(t){}enterComment(t){}exitComment(t){}enterCommentAttached(t){}exitCommentAttached(t){}enterCopyarr(t){}exitCopyarr(t){}enterDelact(t){}exitDelact(t){}enterDynamic(t){}exitDynamic(t){}enterGosub(t){}exitGosub(t){}enterGt(t){}exitGt(t){}enterXgt(t){}exitXgt(t){}enterJump(t){}exitJump(t){}enterJumpmarker(t){}exitJumpmarker(t){}enterKillvar(t){}exitKillvar(t){}enterMsg(t){}exitMsg(t){}enterMultilineBlock(t){}exitMultilineBlock(t){}enterInnerMultilineBlock(t){}exitInnerMultilineBlock(t){}enterOpengame(t){}exitOpengame(t){}enterPlay(t){}exitPlay(t){}enterPrint(t){}exitPrint(t){}enterPrintMain(t){}exitPrintMain(t){}enterPrintNewlineMain(t){}exitPrintNewlineMain(t){}enterPrintNewlinepreMain(t){}exitPrintNewlinepreMain(t){}enterPrintEmptyLineMain(t){}exitPrintEmptyLineMain(t){}enterPrintSide(t){}exitPrintSide(t){}enterPrintNewlineSide(t){}exitPrintNewlineSide(t){}enterPrintNewlinepreSide(t){}exitPrintNewlinepreSide(t){}enterPrintEmptyLineSide(t){}exitPrintEmptyLineSide(t){}enterSavegame(t){}exitSavegame(t){}enterSyscall(t){}exitSyscall(t){}enterSyssetting(t){}exitSyssetting(t){}enterView(t){}exitView(t){}enterWait(t){}exitWait(t){}enterIdentifier(t){}exitIdentifier(t){}enterIdentifierNumber(t){}exitIdentifierNumber(t){}enterIdentifierString(t){}exitIdentifierString(t){}enterArrayIndex(t){}exitArrayIndex(t){}enterCompareOperator(t){}exitCompareOperator(t){}enterNotEqual(t){}exitNotEqual(t){}enterValue(t){}exitValue(t){}enterNumberLiteralWithOptionalSign(t){}exitNumberLiteralWithOptionalSign(t){}enterFunctionWithNumberReturn(t){}exitFunctionWithNumberReturn(t){}enterInvert(t){}exitInvert(t){}enterNumberOperator(t){}exitNumberOperator(t){}enterFunctionWithStringReturn(t){}exitFunctionWithStringReturn(t){}enterFunctionArguments(t){}exitFunctionArguments(t){}enterEscapedString(t){}exitEscapedString(t){}enterStringAtom(t){}exitStringAtom(t){}enterStringTemplateVar(t){}exitStringTemplateVar(t){}enterStringTemplateVarSuffix(t){}exitStringTemplateVarSuffix(t){}enterDoubleQuoteAtom(t){}exitDoubleQuoteAtom(t){}enterStringTemplateVarDQ(t){}exitStringTemplateVarDQ(t){}enterStringDQTemplateVarSuffix(t){}exitStringDQTemplateVarSuffix(t){}}class g extends l.tree.ParseTreeVisitor{visitPassage(t){return this.visitChildren(t)}visitBlock(t){return this.visitChildren(t)}visitStatementLine(t){return this.visitChildren(t)}visitEmptyLine(t){return this.visitChildren(t)}visitActBlock(t){return this.visitChildren(t)}visitActInline(t){return this.visitChildren(t)}visitActPicture(t){return this.visitChildren(t)}visitIfInline(t){return this.visitChildren(t)}visitIfBlock(t){return this.visitChildren(t)}visitElseIfBlock(t){return this.visitChildren(t)}visitElseBlock(t){return this.visitChildren(t)}visitCommand(t){return this.visitChildren(t)}visitCommandLine(t){return this.visitChildren(t)}visitCommandAppended(t){return this.visitChildren(t)}visitAddobj(t){return this.visitChildren(t)}visitAssignment(t){return this.visitChildren(t)}visitAssignmentNumber(t){return this.visitChildren(t)}visitAssignmentString(t){return this.visitChildren(t)}visitAssignmentoperator(t){return this.visitChildren(t)}visitComment(t){return this.visitChildren(t)}visitCommentAttached(t){return this.visitChildren(t)}visitCopyarr(t){return this.visitChildren(t)}visitDelact(t){return this.visitChildren(t)}visitDynamic(t){return this.visitChildren(t)}visitGosub(t){return this.visitChildren(t)}visitGt(t){return this.visitChildren(t)}visitXgt(t){return this.visitChildren(t)}visitJump(t){return this.visitChildren(t)}visitJumpmarker(t){return this.visitChildren(t)}visitKillvar(t){return this.visitChildren(t)}visitMsg(t){return this.visitChildren(t)}visitMultilineBlock(t){return this.visitChildren(t)}visitInnerMultilineBlock(t){return this.visitChildren(t)}visitOpengame(t){return this.visitChildren(t)}visitPlay(t){return this.visitChildren(t)}visitPrint(t){return this.visitChildren(t)}visitPrintMain(t){return this.visitChildren(t)}visitPrintNewlineMain(t){return this.visitChildren(t)}visitPrintNewlinepreMain(t){return this.visitChildren(t)}visitPrintEmptyLineMain(t){return this.visitChildren(t)}visitPrintSide(t){return this.visitChildren(t)}visitPrintNewlineSide(t){return this.visitChildren(t)}visitPrintNewlinepreSide(t){return this.visitChildren(t)}visitPrintEmptyLineSide(t){return this.visitChildren(t)}visitSavegame(t){return this.visitChildren(t)}visitSyscall(t){return this.visitChildren(t)}visitSyssetting(t){return this.visitChildren(t)}visitView(t){return this.visitChildren(t)}visitWait(t){return this.visitChildren(t)}visitIdentifier(t){return this.visitChildren(t)}visitIdentifierNumber(t){return this.visitChildren(t)}visitIdentifierString(t){return this.visitChildren(t)}visitArrayIndex(t){return this.visitChildren(t)}visitCompareOperator(t){return this.visitChildren(t)}visitNotEqual(t){return this.visitChildren(t)}visitValue(t){return this.visitChildren(t)}visitNumberLiteralWithOptionalSign(t){return this.visitChildren(t)}visitFunctionWithNumberReturn(t){return this.visitChildren(t)}visitInvert(t){return this.visitChildren(t)}visitNumberOperator(t){return this.visitChildren(t)}visitFunctionWithStringReturn(t){return this.visitChildren(t)}visitFunctionArguments(t){return this.visitChildren(t)}visitEscapedString(t){return this.visitChildren(t)}visitStringAtom(t){return this.visitChildren(t)}visitStringTemplateVar(t){return this.visitChildren(t)}visitStringTemplateVarSuffix(t){return this.visitChildren(t)}visitDoubleQuoteAtom(t){return this.visitChildren(t)}visitStringTemplateVarDQ(t){return this.visitChildren(t)}visitStringDQTemplateVarSuffix(t){return this.visitChildren(t)}}const x=(new l.atn.ATNDeserializer).deserialize([4,1,82,618,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7,66,2,67,7,67,2,68,7,68,1,0,1,0,1,0,1,0,1,0,5,0,144,8,0,10,0,12,0,147,9,0,1,0,1,0,1,1,5,1,152,8,1,10,1,12,1,155,9,1,1,2,1,2,1,2,1,2,3,2,161,8,2,1,3,1,3,1,4,1,4,1,4,1,4,1,4,1,4,1,4,3,4,172,8,4,1,4,3,4,175,8,4,1,4,1,4,1,5,1,5,1,5,3,5,182,8,5,1,5,1,5,1,5,1,6,1,6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,3,7,196,8,7,1,8,1,8,1,8,1,8,1,8,1,8,5,8,204,8,8,10,8,12,8,207,9,8,1,8,3,8,210,8,8,1,8,1,8,3,8,214,8,8,1,8,3,8,217,8,8,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,1,11,3,11,255,8,11,1,11,5,11,258,8,11,10,11,12,11,261,9,11,1,11,1,11,1,11,3,11,266,8,11,1,12,1,12,3,12,270,8,12,1,12,3,12,273,8,12,1,12,1,12,1,13,1,13,3,13,279,8,13,1,13,1,13,1,14,1,14,1,14,1,15,3,15,287,8,15,1,15,1,15,3,15,291,8,15,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,3,17,301,8,17,1,18,1,18,1,19,1,19,5,19,307,8,19,10,19,12,19,310,9,19,1,19,1,19,5,19,314,8,19,10,19,12,19,317,9,19,1,19,3,19,320,8,19,1,20,1,20,5,20,324,8,20,10,20,12,20,327,9,20,1,21,1,21,1,21,1,21,1,21,1,21,1,21,3,21,336,8,21,1,22,1,22,1,22,1,23,1,23,1,23,1,23,1,23,1,23,1,23,3,23,348,8,23,1,24,1,24,1,24,1,25,1,25,1,25,1,26,1,26,1,26,1,27,1,27,1,27,1,28,1,28,1,28,1,29,1,29,1,29,1,29,3,29,369,8,29,3,29,371,8,29,1,30,1,30,1,30,1,31,1,31,5,31,378,8,31,10,31,12,31,381,9,31,1,31,3,31,384,8,31,1,31,1,31,1,32,1,32,5,32,390,8,32,10,32,12,32,393,9,32,1,33,1,33,3,33,397,8,33,1,34,1,34,1,34,1,35,1,35,1,35,1,35,1,35,1,35,1,35,1,35,3,35,410,8,35,1,36,1,36,1,36,1,36,3,36,416,8,36,1,37,1,37,1,37,1,37,1,38,1,38,1,38,1,38,1,39,1,39,1,39,1,40,1,40,1,40,1,41,1,41,1,41,1,42,1,42,1,42,1,43,1,43,1,44,1,44,1,44,1,45,1,45,1,46,1,46,1,46,1,47,1,47,3,47,450,8,47,1,48,1,48,1,48,1,49,1,49,3,49,457,8,49,1,50,1,50,3,50,461,8,50,1,51,1,51,1,51,3,51,466,8,51,1,52,1,52,1,52,1,52,1,52,1,52,3,52,474,8,52,1,53,1,53,1,53,1,53,1,53,1,53,3,53,482,8,53,1,54,1,54,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,3,55,505,8,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,1,55,5,55,515,8,55,10,55,12,55,518,9,55,1,56,3,56,521,8,56,1,56,1,56,1,57,1,57,1,57,1,57,1,57,1,58,1,58,1,59,5,59,533,8,59,10,59,12,59,536,9,59,1,59,1,59,1,60,1,60,1,60,1,60,1,60,1,60,1,61,1,61,1,61,5,61,549,8,61,10,61,12,61,552,9,61,1,62,1,62,5,62,556,8,62,10,62,12,62,559,9,62,1,62,1,62,1,62,5,62,564,8,62,10,62,12,62,567,9,62,1,62,5,62,570,8,62,10,62,12,62,573,9,62,1,62,1,62,1,62,5,62,578,8,62,10,62,12,62,581,9,62,1,62,5,62,584,8,62,10,62,12,62,587,9,62,1,62,3,62,590,8,62,1,63,1,63,1,64,1,64,1,64,1,64,1,65,1,65,5,65,600,8,65,10,65,12,65,603,9,65,1,66,1,66,1,67,1,67,1,67,1,67,1,68,1,68,5,68,613,8,68,10,68,12,68,616,9,68,1,68,0,1,110,69,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,76,78,80,82,84,86,88,90,92,94,96,98,100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,0,8,1,0,35,40,1,0,69,69,1,0,19,20,2,0,56,56,58,58,1,0,49,50,4,0,30,31,45,45,47,47,49,51,2,0,73,73,75,75,2,0,76,76,78,78,647,0,138,1,0,0,0,2,153,1,0,0,0,4,160,1,0,0,0,6,162,1,0,0,0,8,164,1,0,0,0,10,178,1,0,0,0,12,186,1,0,0,0,14,189,1,0,0,0,16,197,1,0,0,0,18,220,1,0,0,0,20,226,1,0,0,0,22,265,1,0,0,0,24,267,1,0,0,0,26,276,1,0,0,0,28,282,1,0,0,0,30,286,1,0,0,0,32,292,1,0,0,0,34,296,1,0,0,0,36,302,1,0,0,0,38,319,1,0,0,0,40,321,1,0,0,0,42,335,1,0,0,0,44,337,1,0,0,0,46,347,1,0,0,0,48,349,1,0,0,0,50,352,1,0,0,0,52,355,1,0,0,0,54,358,1,0,0,0,56,361,1,0,0,0,58,364,1,0,0,0,60,372,1,0,0,0,62,375,1,0,0,0,64,387,1,0,0,0,66,394,1,0,0,0,68,398,1,0,0,0,70,409,1,0,0,0,72,415,1,0,0,0,74,417,1,0,0,0,76,421,1,0,0,0,78,425,1,0,0,0,80,428,1,0,0,0,82,431,1,0,0,0,84,434,1,0,0,0,86,437,1,0,0,0,88,439,1,0,0,0,90,442,1,0,0,0,92,444,1,0,0,0,94,447,1,0,0,0,96,451,1,0,0,0,98,456,1,0,0,0,100,458,1,0,0,0,102,462,1,0,0,0,104,473,1,0,0,0,106,481,1,0,0,0,108,483,1,0,0,0,110,504,1,0,0,0,112,520,1,0,0,0,114,524,1,0,0,0,116,529,1,0,0,0,118,534,1,0,0,0,120,539,1,0,0,0,122,545,1,0,0,0,124,589,1,0,0,0,126,591,1,0,0,0,128,593,1,0,0,0,130,597,1,0,0,0,132,604,1,0,0,0,134,606,1,0,0,0,136,610,1,0,0,0,138,139,5,1,0,0,139,140,3,2,1,0,140,145,5,2,0,0,141,144,5,69,0,0,142,144,3,38,19,0,143,141,1,0,0,0,143,142,1,0,0,0,144,147,1,0,0,0,145,143,1,0,0,0,145,146,1,0,0,0,146,148,1,0,0,0,147,145,1,0,0,0,148,149,5,0,0,1,149,1,1,0,0,0,150,152,3,4,2,0,151,150,1,0,0,0,152,155,1,0,0,0,153,151,1,0,0,0,153,154,1,0,0,0,154,3,1,0,0,0,155,153,1,0,0,0,156,161,3,8,4,0,157,161,3,24,12,0,158,161,3,16,8,0,159,161,3,6,3,0,160,156,1,0,0,0,160,157,1,0,0,0,160,158,1,0,0,0,160,159,1,0,0,0,161,5,1,0,0,0,162,163,5,69,0,0,163,7,1,0,0,0,164,165,5,24,0,0,165,166,3,110,55,0,166,167,5,48,0,0,167,168,5,69,0,0,168,169,3,2,1,0,169,171,5,28,0,0,170,172,3,26,13,0,171,170,1,0,0,0,171,172,1,0,0,0,172,174,1,0,0,0,173,175,3,40,20,0,174,173,1,0,0,0,174,175,1,0,0,0,175,176,1,0,0,0,176,177,5,69,0,0,177,9,1,0,0,0,178,179,5,24,0,0,179,181,3,110,55,0,180,182,3,12,6,0,181,180,1,0,0,0,181,182,1,0,0,0,182,183,1,0,0,0,183,184,5,48,0,0,184,185,3,22,11,0,185,11,1,0,0,0,186,187,5,67,0,0,187,188,3,110,55,0,188,13,1,0,0,0,189,190,5,25,0,0,190,191,3,110,55,0,191,192,5,48,0,0,192,195,3,22,11,0,193,194,5,27,0,0,194,196,3,22,11,0,195,193,1,0,0,0,195,196,1,0,0,0,196,15,1,0,0,0,197,198,5,25,0,0,198,199,3,110,55,0,199,200,5,48,0,0,200,201,5,69,0,0,201,205,3,2,1,0,202,204,3,18,9,0,203,202,1,0,0,0,204,207,1,0,0,0,205,203,1,0,0,0,205,206,1,0,0,0,206,209,1,0,0,0,207,205,1,0,0,0,208,210,3,20,10,0,209,208,1,0,0,0,209,210,1,0,0,0,210,211,1,0,0,0,211,213,5,28,0,0,212,214,3,26,13,0,213,212,1,0,0,0,213,214,1,0,0,0,214,216,1,0,0,0,215,217,3,40,20,0,216,215,1,0,0,0,216,217,1,0,0,0,217,218,1,0,0,0,218,219,5,69,0,0,219,17,1,0,0,0,220,221,5,26,0,0,221,222,3,110,55,0,222,223,5,48,0,0,223,224,5,69,0,0,224,225,3,2,1,0,225,19,1,0,0,0,226,227,5,27,0,0,227,228,5,69,0,0,228,229,3,2,1,0,229,21,1,0,0,0,230,231,5,65,0,0,231,232,3,22,11,0,232,233,5,66,0,0,233,255,1,0,0,0,234,255,3,28,14,0,235,255,3,30,15,0,236,255,3,42,21,0,237,255,3,44,22,0,238,255,3,46,23,0,239,255,3,48,24,0,240,255,3,50,25,0,241,255,3,52,26,0,242,255,3,54,27,0,243,255,3,56,28,0,244,255,3,58,29,0,245,255,3,60,30,0,246,255,3,66,33,0,247,255,3,68,34,0,248,255,3,70,35,0,249,255,3,88,44,0,250,255,3,90,45,0,251,255,3,92,46,0,252,255,3,94,47,0,253,255,3,96,48,0,254,230,1,0,0,0,254,234,1,0,0,0,254,235,1,0,0,0,254,236,1,0,0,0,254,237,1,0,0,0,254,238,1,0,0,0,254,239,1,0,0,0,254,240,1,0,0,0,254,241,1,0,0,0,254,242,1,0,0,0,254,243,1,0,0,0,254,244,1,0,0,0,254,245,1,0,0,0,254,246,1,0,0,0,254,247,1,0,0,0,254,248,1,0,0,0,254,249,1,0,0,0,254,250,1,0,0,0,254,251,1,0,0,0,254,252,1,0,0,0,254,253,1,0,0,0,255,259,1,0,0,0,256,258,3,26,13,0,257,256,1,0,0,0,258,261,1,0,0,0,259,257,1,0,0,0,259,260,1,0,0,0,260,266,1,0,0,0,261,259,1,0,0,0,262,266,3,10,5,0,263,266,3,38,19,0,264,266,3,14,7,0,265,254,1,0,0,0,265,262,1,0,0,0,265,263,1,0,0,0,265,264,1,0,0,0,266,23,1,0,0,0,267,269,3,22,11,0,268,270,3,26,13,0,269,268,1,0,0,0,269,270,1,0,0,0,270,272,1,0,0,0,271,273,3,40,20,0,272,271,1,0,0,0,272,273,1,0,0,0,273,274,1,0,0,0,274,275,5,69,0,0,275,25,1,0,0,0,276,278,5,32,0,0,277,279,5,32,0,0,278,277,1,0,0,0,278,279,1,0,0,0,279,280,1,0,0,0,280,281,3,22,11,0,281,27,1,0,0,0,282,283,5,5,0,0,283,284,3,110,55,0,284,29,1,0,0,0,285,287,5,34,0,0,286,285,1,0,0,0,286,287,1,0,0,0,287,290,1,0,0,0,288,291,3,32,16,0,289,291,3,34,17,0,290,288,1,0,0,0,290,289,1,0,0,0,291,31,1,0,0,0,292,293,3,100,50,0,293,294,3,36,18,0,294,295,3,110,55,0,295,33,1,0,0,0,296,297,3,102,51,0,297,300,3,36,18,0,298,301,3,110,55,0,299,301,3,62,31,0,300,298,1,0,0,0,300,299,1,0,0,0,301,35,1,0,0,0,302,303,7,0,0,0,303,37,1,0,0,0,304,308,5,58,0,0,305,307,8,1,0,0,306,305,1,0,0,0,307,310,1,0,0,0,308,306,1,0,0,0,308,309,1,0,0,0,309,320,1,0,0,0,310,308,1,0,0,0,311,315,5,59,0,0,312,314,5,82,0,0,313,312,1,0,0,0,314,317,1,0,0,0,315,313,1,0,0,0,315,316,1,0,0,0,316,320,1,0,0,0,317,315,1,0,0,0,318,320,5,61,0,0,319,304,1,0,0,0,319,311,1,0,0,0,319,318,1,0,0,0,320,39,1,0,0,0,321,325,5,60,0,0,322,324,5,82,0,0,323,322,1,0,0,0,324,327,1,0,0,0,325,323,1,0,0,0,325,326,1,0,0,0,326,41,1,0,0,0,327,325,1,0,0,0,328,329,5,6,0,0,329,336,3,122,61,0,330,331,5,6,0,0,331,332,5,65,0,0,332,333,3,122,61,0,333,334,5,66,0,0,334,336,1,0,0,0,335,328,1,0,0,0,335,330,1,0,0,0,336,43,1,0,0,0,337,338,5,7,0,0,338,339,3,110,55,0,339,45,1,0,0,0,340,341,5,8,0,0,341,348,3,122,61,0,342,343,5,8,0,0,343,344,5,65,0,0,344,345,3,122,61,0,345,346,5,66,0,0,346,348,1,0,0,0,347,340,1,0,0,0,347,342,1,0,0,0,348,47,1,0,0,0,349,350,5,9,0,0,350,351,3,122,61,0,351,49,1,0,0,0,352,353,5,10,0,0,353,354,3,122,61,0,354,51,1,0,0,0,355,356,5,11,0,0,356,357,3,122,61,0,357,53,1,0,0,0,358,359,5,13,0,0,359,360,3,110,55,0,360,55,1,0,0,0,361,362,5,48,0,0,362,363,5,46,0,0,363,57,1,0,0,0,364,370,5,14,0,0,365,368,3,110,55,0,366,367,5,67,0,0,367,369,3,110,55,0,368,366,1,0,0,0,368,369,1,0,0,0,369,371,1,0,0,0,370,365,1,0,0,0,370,371,1,0,0,0,371,59,1,0,0,0,372,373,5,15,0,0,373,374,3,110,55,0,374,61,1,0,0,0,375,379,5,64,0,0,376,378,5,81,0,0,377,376,1,0,0,0,378,381,1,0,0,0,379,377,1,0,0,0,379,380,1,0,0,0,380,383,1,0,0,0,381,379,1,0,0,0,382,384,3,64,32,0,383,382,1,0,0,0,383,384,1,0,0,0,384,385,1,0,0,0,385,386,5,80,0,0,386,63,1,0,0,0,387,391,3,62,31,0,388,390,5,81,0,0,389,388,1,0,0,0,390,393,1,0,0,0,391,389,1,0,0,0,391,392,1,0,0,0,392,65,1,0,0,0,393,391,1,0,0,0,394,396,5,16,0,0,395,397,3,110,55,0,396,395,1,0,0,0,396,397,1,0,0,0,397,67,1,0,0,0,398,399,5,17,0,0,399,400,3,122,61,0,400,69,1,0,0,0,401,410,3,72,36,0,402,410,3,74,37,0,403,410,3,76,38,0,404,410,3,78,39,0,405,410,3,80,40,0,406,410,3,82,41,0,407,410,3,84,42,0,408,410,3,86,43,0,409,401,1,0,0,0,409,402,1,0,0,0,409,403,1,0,0,0,409,404,1,0,0,0,409,405,1,0,0,0,409,406,1,0,0,0,409,407,1,0,0,0,409,408,1,0,0,0,410,71,1,0,0,0,411,416,3,110,55,0,412,413,5,47,0,0,413,414,5,18,0,0,414,416,3,110,55,0,415,411,1,0,0,0,415,412,1,0,0,0,416,73,1,0,0,0,417,418,5,47,0,0,418,419,5,19,0,0,419,420,3,110,55,0,420,75,1,0,0,0,421,422,5,47,0,0,422,423,5,20,0,0,423,424,3,110,55,0,424,77,1,0,0,0,425,426,5,47,0,0,426,427,7,2,0,0,427,79,1,0,0,0,428,429,5,18,0,0,429,430,3,110,55,0,430,81,1,0,0,0,431,432,5,19,0,0,432,433,3,110,55,0,433,83,1,0,0,0,434,435,5,20,0,0,435,436,3,110,55,0,436,85,1,0,0,0,437,438,7,2,0,0,438,87,1,0,0,0,439,440,5,21,0,0,440,441,3,110,55,0,441,89,1,0,0,0,442,443,5,3,0,0,443,91,1,0,0,0,444,445,5,4,0,0,445,446,3,110,55,0,446,93,1,0,0,0,447,449,5,22,0,0,448,450,3,110,55,0,449,448,1,0,0,0,449,450,1,0,0,0,450,95,1,0,0,0,451,452,5,23,0,0,452,453,3,110,55,0,453,97,1,0,0,0,454,457,3,102,51,0,455,457,3,100,50,0,456,454,1,0,0,0,456,455,1,0,0,0,457,99,1,0,0,0,458,460,5,46,0,0,459,461,3,104,52,0,460,459,1,0,0,0,460,461,1,0,0,0,461,101,1,0,0,0,462,463,5,57,0,0,463,465,5,46,0,0,464,466,3,104,52,0,465,464,1,0,0,0,465,466,1,0,0,0,466,103,1,0,0,0,467,468,5,62,0,0,468,469,3,110,55,0,469,470,5,63,0,0,470,474,1,0,0,0,471,472,5,62,0,0,472,474,5,63,0,0,473,467,1,0,0,0,473,471,1,0,0,0,474,105,1,0,0,0,475,482,5,53,0,0,476,482,5,52,0,0,477,482,5,55,0,0,478,482,5,54,0,0,479,482,5,35,0,0,480,482,3,108,54,0,481,475,1,0,0,0,481,476,1,0,0,0,481,477,1,0,0,0,481,478,1,0,0,0,481,479,1,0,0,0,481,480,1,0,0,0,482,107,1,0,0,0,483,484,7,3,0,0,484,109,1,0,0,0,485,486,6,55,-1,0,486,487,5,65,0,0,487,488,3,110,55,0,488,489,5,66,0,0,489,505,1,0,0,0,490,505,3,112,56,0,491,505,3,100,50,0,492,493,5,12,0,0,493,505,3,110,55,10,494,495,3,116,58,0,495,496,3,110,55,9,496,505,1,0,0,0,497,505,3,114,57,0,498,505,3,124,62,0,499,505,3,102,51,0,500,505,3,120,60,0,501,505,3,62,31,0,502,503,5,50,0,0,503,505,3,110,55,1,504,485,1,0,0,0,504,490,1,0,0,0,504,491,1,0,0,0,504,492,1,0,0,0,504,494,1,0,0,0,504,497,1,0,0,0,504,498,1,0,0,0,504,499,1,0,0,0,504,500,1,0,0,0,504,501,1,0,0,0,504,502,1,0,0,0,505,516,1,0,0,0,506,507,10,7,0,0,507,508,3,118,59,0,508,509,3,110,55,8,509,515,1,0,0,0,510,511,10,6,0,0,511,512,3,106,53,0,512,513,3,110,55,7,513,515,1,0,0,0,514,506,1,0,0,0,514,510,1,0,0,0,515,518,1,0,0,0,516,514,1,0,0,0,516,517,1,0,0,0,517,111,1,0,0,0,518,516,1,0,0,0,519,521,7,4,0,0,520,519,1,0,0,0,520,521,1,0,0,0,521,522,1,0,0,0,522,523,5,33,0,0,523,113,1,0,0,0,524,525,5,46,0,0,525,526,5,65,0,0,526,527,3,122,61,0,527,528,5,66,0,0,528,115,1,0,0,0,529,530,5,29,0,0,530,117,1,0,0,0,531,533,5,69,0,0,532,531,1,0,0,0,533,536,1,0,0,0,534,532,1,0,0,0,534,535,1,0,0,0,535,537,1,0,0,0,536,534,1,0,0,0,537,538,7,5,0,0,538,119,1,0,0,0,539,540,5,57,0,0,540,541,5,46,0,0,541,542,5,65,0,0,542,543,3,122,61,0,543,544,5,66,0,0,544,121,1,0,0,0,545,550,3,110,55,0,546,547,5,67,0,0,547,549,3,110,55,0,548,546,1,0,0,0,549,552,1,0,0,0,550,548,1,0,0,0,550,551,1,0,0,0,551,123,1,0,0,0,552,550,1,0,0,0,553,557,5,44,0,0,554,556,5,79,0,0,555,554,1,0,0,0,556,559,1,0,0,0,557,555,1,0,0,0,557,558,1,0,0,0,558,560,1,0,0,0,559,557,1,0,0,0,560,590,5,44,0,0,561,565,5,43,0,0,562,564,3,126,63,0,563,562,1,0,0,0,564,567,1,0,0,0,565,563,1,0,0,0,565,566,1,0,0,0,566,571,1,0,0,0,567,565,1,0,0,0,568,570,3,130,65,0,569,568,1,0,0,0,570,573,1,0,0,0,571,569,1,0,0,0,571,572,1,0,0,0,572,574,1,0,0,0,573,571,1,0,0,0,574,590,5,43,0,0,575,579,5,42,0,0,576,578,3,132,66,0,577,576,1,0,0,0,578,581,1,0,0,0,579,577,1,0,0,0,579,580,1,0,0,0,580,585,1,0,0,0,581,579,1,0,0,0,582,584,3,136,68,0,583,582,1,0,0,0,584,587,1,0,0,0,585,583,1,0,0,0,585,586,1,0,0,0,586,588,1,0,0,0,587,585,1,0,0,0,588,590,5,42,0,0,589,553,1,0,0,0,589,561,1,0,0,0,589,575,1,0,0,0,590,125,1,0,0,0,591,592,7,6,0,0,592,127,1,0,0,0,593,594,5,74,0,0,594,595,3,110,55,0,595,596,5,41,0,0,596,129,1,0,0,0,597,601,3,128,64,0,598,600,3,126,63,0,599,598,1,0,0,0,600,603,1,0,0,0,601,599,1,0,0,0,601,602,1,0,0,0,602,131,1,0,0,0,603,601,1,0,0,0,604,605,7,7,0,0,605,133,1,0,0,0,606,607,5,77,0,0,607,608,3,110,55,0,608,609,5,41,0,0,609,135,1,0,0,0,610,614,3,134,67,0,611,613,3,132,66,0,612,611,1,0,0,0,613,616,1,0,0,0,614,612,1,0,0,0,614,615,1,0,0,0,615,137,1,0,0,0,616,614,1,0,0,0,55,143,145,153,160,171,174,181,195,205,209,213,216,254,259,265,269,272,278,286,290,300,308,315,319,325,335,347,368,370,379,383,391,396,409,415,449,456,460,465,473,481,504,514,516,520,534,550,557,565,571,579,585,589,601,614]),f=x.decisionToState.map(((t,e)=>new l.dfa.DFA(t,e))),m=new l.atn.PredictionContextCache;class E extends l.Parser{static grammarFileName="qsrcParser.g4";static literalNames=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"'&'",null,null,"'='","'+='","'-='","'/='","'*='","'to'",null,null,null,null,null,null,"'*'","':'","'+'","'-'","'/'","'>'",null,"'<'",null,"'<>'","'$'","'!'","'!!'",null,null,"'['","']'","'{'","'('","')'","','","'?'",null,null,null,null,null,null,null,"'\"\"'",null,null,null,"'}'"];static symbolicNames=[null,"PassageIdentifier","PassageEndMarker","SYSCALL","SYSSETTING","ADDOBJ","COPYARR","DELACT","DYNAMIC","GOSUB","GOTO","XGOTO","INPUT","JUMP","KILLVAR","MSG","OPENGAME","PLAY","Print","PrintNewline","PrintNewlinepre","SAVEGAME","VIEW","WAIT","ACT","IF","ELSEIF","ELSE","END","INVERT","AND","OR","CommandConnect","NumberLiteral","SET","EqualOperator","IncrementOperator","DecrementOperator","DivideSelfOperator","MultSelfOperator","SetToOperator","TemplateStringEndExpression","DOUBLEQUOTE","SINGLEQUOTE","TemplateDoubleSingleQuote","MOD","WORD","STAR","DPOINT","PLUS","MINUS","DIVIDE","GREATER_THAN","GREAT_EQUAL_THAN","LOWER_THAN","LOWER_EQUAL_THAN","NEQ","DOLLAR","EXCLAMATIONMARK","CommentStart","AttachedComment","Multilinecomment","ARRAYBRACKOPEN","ARRAYBRACKCLOSE","BRACK_OPEN","ParenthesisLeft","ParenthesisRight","Comma","Questionmark","NEWLINE","WHITESPACE","LINEBREAK","AnythingElse","EscapedSingleQuote","TemplateStringStartExpression","StringAtom","EscapedDoubleQuote","DQTemplateStringStartExpression","DQStringAtom","InEscapedStringAtom","BRACK_CLOSE","AnythingElseInMultiLine","InComment"];static ruleNames=["passage","block","statementLine","emptyLine","actBlock","actInline","actPicture","ifInline","ifBlock","elseIfBlock","elseBlock","command","commandLine","commandAppended","addobj","assignment","assignmentNumber","assignmentString","assignmentoperator","comment","commentAttached","copyarr","delact","dynamic","gosub","gt","xgt","jump","jumpmarker","killvar","msg","multilineBlock","innerMultilineBlock","opengame","play","print","printMain","printNewlineMain","printNewlinepreMain","printEmptyLineMain","printSide","printNewlineSide","printNewlinepreSide","printEmptyLineSide","savegame","syscall","syssetting","view","wait","identifier","identifierNumber","identifierString","arrayIndex","compareOperator","notEqual","value","numberLiteralWithOptionalSign","functionWithNumberReturn","invert","numberOperator","functionWithStringReturn","functionArguments","escapedString","stringAtom","stringTemplateVar","stringTemplateVarSuffix","doubleQuoteAtom","stringTemplateVarDQ","stringDQTemplateVarSuffix"];constructor(t){super(t),this._interp=new l.atn.ParserATNSimulator(this,x,f,m),this.ruleNames=E.ruleNames,this.literalNames=E.literalNames,this.symbolicNames=E.symbolicNames}sempred(t,e,n){if(55===e)return this.value_sempred(t,n);throw"No predicate with index:"+e}value_sempred(t,e){switch(e){case 0:return this.precpred(this._ctx,7);case 1:return this.precpred(this._ctx,6);default:throw"No predicate with index:"+e}}passage(){let t=new T(this,this._ctx,this.state);this.enterRule(t,0,E.RULE_passage);var e=0;try{for(this.enterOuterAlt(t,1),this.state=138,this.match(E.PassageIdentifier),this.state=139,this.block(),this.state=140,this.match(E.PassageEndMarker),this.state=145,this._errHandler.sync(this),e=this._input.LA(1);!(e-58&-32)&&1<<e-58&2059;){switch(this.state=143,this._errHandler.sync(this),this._input.LA(1)){case 69:this.state=141,this.match(E.NEWLINE);break;case 58:case 59:case 61:this.state=142,this.comment();break;default:throw new l.error.NoViableAltException(this)}this.state=147,this._errHandler.sync(this),e=this._input.LA(1)}this.state=148,this.match(E.EOF)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}block(){let t=new R(this,this._ctx,this.state);this.enterRule(t,2,E.RULE_block);var e=0;try{for(this.enterOuterAlt(t,1),this.state=153,this._errHandler.sync(this),e=this._input.LA(1);!(e-3&-32)&&1<<e-3&3296722943||!(e-42&-32)&&1<<e-42&147554807;)this.state=150,this.statementLine(),this.state=155,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}statementLine(){let t=new S(this,this._ctx,this.state);this.enterRule(t,4,E.RULE_statementLine);try{switch(this.state=160,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,3,this._ctx)){case 1:this.enterOuterAlt(t,1),this.state=156,this.actBlock();break;case 2:this.enterOuterAlt(t,2),this.state=157,this.commandLine();break;case 3:this.enterOuterAlt(t,3),this.state=158,this.ifBlock();break;case 4:this.enterOuterAlt(t,4),this.state=159,this.emptyLine()}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}emptyLine(){let t=new _(this,this._ctx,this.state);this.enterRule(t,6,E.RULE_emptyLine);try{this.enterOuterAlt(t,1),this.state=162,this.match(E.NEWLINE)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}actBlock(){let t=new A(this,this._ctx,this.state);this.enterRule(t,8,E.RULE_actBlock);try{this.enterOuterAlt(t,1),this.state=164,this.match(E.ACT),this.state=165,this.value(0),this.state=166,this.match(E.DPOINT),this.state=167,this.match(E.NEWLINE),this.state=168,this.block(),this.state=169,this.match(E.END),this.state=171,this._errHandler.sync(this),32===this._input.LA(1)&&(this.state=170,this.commandAppended()),this.state=174,this._errHandler.sync(this),60===this._input.LA(1)&&(this.state=173,this.commentAttached()),this.state=176,this.match(E.NEWLINE)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}actInline(){let t=new C(this,this._ctx,this.state);this.enterRule(t,10,E.RULE_actInline);try{this.enterOuterAlt(t,1),this.state=178,this.match(E.ACT),this.state=179,this.value(0),this.state=181,this._errHandler.sync(this),67===this._input.LA(1)&&(this.state=180,this.actPicture()),this.state=183,this.match(E.DPOINT),this.state=184,this.command()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}actPicture(){let t=new v(this,this._ctx,this.state);this.enterRule(t,12,E.RULE_actPicture);try{this.enterOuterAlt(t,1),this.state=186,this.match(E.Comma),this.state=187,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}ifInline(){let t=new L(this,this._ctx,this.state);this.enterRule(t,14,E.RULE_ifInline);try{this.enterOuterAlt(t,1),this.state=189,this.match(E.IF),this.state=190,this.value(0),this.state=191,this.match(E.DPOINT),this.state=192,this.command(),this.state=195,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,7,this._ctx)&&(this.state=193,this.match(E.ELSE),this.state=194,this.command())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}ifBlock(){let t=new y(this,this._ctx,this.state);this.enterRule(t,16,E.RULE_ifBlock);var e=0;try{for(this.enterOuterAlt(t,1),this.state=197,this.match(E.IF),this.state=198,this.value(0),this.state=199,this.match(E.DPOINT),this.state=200,this.match(E.NEWLINE),this.state=201,this.block(),this.state=205,this._errHandler.sync(this),e=this._input.LA(1);26===e;)this.state=202,this.elseIfBlock(),this.state=207,this._errHandler.sync(this),e=this._input.LA(1);this.state=209,this._errHandler.sync(this),27===(e=this._input.LA(1))&&(this.state=208,this.elseBlock()),this.state=211,this.match(E.END),this.state=213,this._errHandler.sync(this),32===(e=this._input.LA(1))&&(this.state=212,this.commandAppended()),this.state=216,this._errHandler.sync(this),60===(e=this._input.LA(1))&&(this.state=215,this.commentAttached()),this.state=218,this.match(E.NEWLINE)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}elseIfBlock(){let t=new N(this,this._ctx,this.state);this.enterRule(t,18,E.RULE_elseIfBlock);try{this.enterOuterAlt(t,1),this.state=220,this.match(E.ELSEIF),this.state=221,this.value(0),this.state=222,this.match(E.DPOINT),this.state=223,this.match(E.NEWLINE),this.state=224,this.block()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}elseBlock(){let t=new I(this,this._ctx,this.state);this.enterRule(t,20,E.RULE_elseBlock);try{this.enterOuterAlt(t,1),this.state=226,this.match(E.ELSE),this.state=227,this.match(E.NEWLINE),this.state=228,this.block()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}command(){let t=new k(this,this._ctx,this.state);this.enterRule(t,22,E.RULE_command);try{switch(this.state=265,this._errHandler.sync(this),this._input.LA(1)){case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 29:case 33:case 34:case 42:case 43:case 44:case 46:case 47:case 48:case 49:case 50:case 57:case 64:case 65:switch(this.enterOuterAlt(t,1),this.state=254,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,12,this._ctx)){case 1:this.state=230,this.match(E.ParenthesisLeft),this.state=231,this.command(),this.state=232,this.match(E.ParenthesisRight);break;case 2:this.state=234,this.addobj();break;case 3:this.state=235,this.assignment();break;case 4:this.state=236,this.copyarr();break;case 5:this.state=237,this.delact();break;case 6:this.state=238,this.dynamic();break;case 7:this.state=239,this.gosub();break;case 8:this.state=240,this.gt();break;case 9:this.state=241,this.xgt();break;case 10:this.state=242,this.jump();break;case 11:this.state=243,this.jumpmarker();break;case 12:this.state=244,this.killvar();break;case 13:this.state=245,this.msg();break;case 14:this.state=246,this.opengame();break;case 15:this.state=247,this.play();break;case 16:this.state=248,this.print();break;case 17:this.state=249,this.savegame();break;case 18:this.state=250,this.syscall();break;case 19:this.state=251,this.syssetting();break;case 20:this.state=252,this.view();break;case 21:this.state=253,this.wait()}this.state=259,this._errHandler.sync(this);for(var e=this._interp.adaptivePredict(this._input,13,this._ctx);2!=e&&e!=l.atn.ATN.INVALID_ALT_NUMBER;)1===e&&(this.state=256,this.commandAppended()),this.state=261,this._errHandler.sync(this),e=this._interp.adaptivePredict(this._input,13,this._ctx);break;case 24:this.enterOuterAlt(t,2),this.state=262,this.actInline();break;case 58:case 59:case 61:this.enterOuterAlt(t,3),this.state=263,this.comment();break;case 25:this.enterOuterAlt(t,4),this.state=264,this.ifInline();break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}commandLine(){let t=new O(this,this._ctx,this.state);this.enterRule(t,24,E.RULE_commandLine);try{this.enterOuterAlt(t,1),this.state=267,this.command(),this.state=269,this._errHandler.sync(this),32===this._input.LA(1)&&(this.state=268,this.commandAppended()),this.state=272,this._errHandler.sync(this),60===this._input.LA(1)&&(this.state=271,this.commentAttached()),this.state=274,this.match(E.NEWLINE)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}commandAppended(){let t=new P(this,this._ctx,this.state);this.enterRule(t,26,E.RULE_commandAppended);try{this.enterOuterAlt(t,1),this.state=276,this.match(E.CommandConnect),this.state=278,this._errHandler.sync(this),32===this._input.LA(1)&&(this.state=277,this.match(E.CommandConnect)),this.state=280,this.command()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}addobj(){let t=new w(this,this._ctx,this.state);this.enterRule(t,28,E.RULE_addobj);try{this.enterOuterAlt(t,1),this.state=282,this.match(E.ADDOBJ),this.state=283,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}assignment(){let t=new b(this,this._ctx,this.state);this.enterRule(t,30,E.RULE_assignment);try{switch(this.enterOuterAlt(t,1),this.state=286,this._errHandler.sync(this),34===this._input.LA(1)&&(this.state=285,this.match(E.SET)),this.state=290,this._errHandler.sync(this),this._input.LA(1)){case 46:this.state=288,this.assignmentNumber();break;case 57:this.state=289,this.assignmentString();break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}assignmentNumber(){let t=new D(this,this._ctx,this.state);this.enterRule(t,32,E.RULE_assignmentNumber);try{this.enterOuterAlt(t,1),this.state=292,this.identifierNumber(),this.state=293,this.assignmentoperator(),this.state=294,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}assignmentString(){let t=new U(this,this._ctx,this.state);this.enterRule(t,34,E.RULE_assignmentString);try{switch(this.enterOuterAlt(t,1),this.state=296,this.identifierString(),this.state=297,this.assignmentoperator(),this.state=300,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,20,this._ctx)){case 1:this.state=298,this.value(0);break;case 2:this.state=299,this.multilineBlock()}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}assignmentoperator(){let t=new M(this,this._ctx,this.state);this.enterRule(t,36,E.RULE_assignmentoperator);var e=0;try{this.enterOuterAlt(t,1),this.state=302,(e=this._input.LA(1))-35&-32||!(1<<e-35&63)?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}comment(){let t=new H(this,this._ctx,this.state);this.enterRule(t,38,E.RULE_comment);var e=0;try{switch(this.state=319,this._errHandler.sync(this),this._input.LA(1)){case 58:this.enterOuterAlt(t,1),this.state=304,this.match(E.EXCLAMATIONMARK),this.state=308,this._errHandler.sync(this);for(var n=this._interp.adaptivePredict(this._input,21,this._ctx);2!=n&&n!=l.atn.ATN.INVALID_ALT_NUMBER;)1===n&&(this.state=305,(e=this._input.LA(1))<=0||69===e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())),this.state=310,this._errHandler.sync(this),n=this._interp.adaptivePredict(this._input,21,this._ctx);break;case 59:for(this.enterOuterAlt(t,2),this.state=311,this.match(E.CommentStart),this.state=315,this._errHandler.sync(this),e=this._input.LA(1);82===e;)this.state=312,this.match(E.InComment),this.state=317,this._errHandler.sync(this),e=this._input.LA(1);break;case 61:this.enterOuterAlt(t,3),this.state=318,this.match(E.Multilinecomment);break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}commentAttached(){let t=new F(this,this._ctx,this.state);this.enterRule(t,40,E.RULE_commentAttached);var e=0;try{for(this.enterOuterAlt(t,1),this.state=321,this.match(E.AttachedComment),this.state=325,this._errHandler.sync(this),e=this._input.LA(1);82===e;)this.state=322,this.match(E.InComment),this.state=327,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}copyarr(){let t=new B(this,this._ctx,this.state);this.enterRule(t,42,E.RULE_copyarr);try{switch(this.state=335,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,25,this._ctx)){case 1:this.enterOuterAlt(t,1),this.state=328,this.match(E.COPYARR),this.state=329,this.functionArguments();break;case 2:this.enterOuterAlt(t,2),this.state=330,this.match(E.COPYARR),this.state=331,this.match(E.ParenthesisLeft),this.state=332,this.functionArguments(),this.state=333,this.match(E.ParenthesisRight)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}delact(){let t=new V(this,this._ctx,this.state);this.enterRule(t,44,E.RULE_delact);try{this.enterOuterAlt(t,1),this.state=337,this.match(E.DELACT),this.state=338,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}dynamic(){let t=new W(this,this._ctx,this.state);this.enterRule(t,46,E.RULE_dynamic);try{switch(this.state=347,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,26,this._ctx)){case 1:this.enterOuterAlt(t,1),this.state=340,this.match(E.DYNAMIC),this.state=341,this.functionArguments();break;case 2:this.enterOuterAlt(t,2),this.state=342,this.match(E.DYNAMIC),this.state=343,this.match(E.ParenthesisLeft),this.state=344,this.functionArguments(),this.state=345,this.match(E.ParenthesisRight)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}gosub(){let t=new $(this,this._ctx,this.state);this.enterRule(t,48,E.RULE_gosub);try{this.enterOuterAlt(t,1),this.state=349,this.match(E.GOSUB),this.state=350,this.functionArguments()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}gt(){let t=new Q(this,this._ctx,this.state);this.enterRule(t,50,E.RULE_gt);try{this.enterOuterAlt(t,1),this.state=352,this.match(E.GOTO),this.state=353,this.functionArguments()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}xgt(){let t=new G(this,this._ctx,this.state);this.enterRule(t,52,E.RULE_xgt);try{this.enterOuterAlt(t,1),this.state=355,this.match(E.XGOTO),this.state=356,this.functionArguments()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}jump(){let t=new K(this,this._ctx,this.state);this.enterRule(t,54,E.RULE_jump);try{this.enterOuterAlt(t,1),this.state=358,this.match(E.JUMP),this.state=359,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}jumpmarker(){let t=new q(this,this._ctx,this.state);this.enterRule(t,56,E.RULE_jumpmarker);try{this.enterOuterAlt(t,1),this.state=361,this.match(E.DPOINT),this.state=362,this.match(E.WORD)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}killvar(){let t=new Y(this,this._ctx,this.state);this.enterRule(t,58,E.RULE_killvar);var e=0;try{this.enterOuterAlt(t,1),this.state=364,this.match(E.KILLVAR),this.state=370,this._errHandler.sync(this),(!((e=this._input.LA(1))-12&-32)&&1<<e-12&3223453697||!(e-44&-32)&&1<<e-44&3154021)&&(this.state=365,this.value(0),this.state=368,this._errHandler.sync(this),67===(e=this._input.LA(1))&&(this.state=366,this.match(E.Comma),this.state=367,this.value(0)))}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}msg(){let t=new z(this,this._ctx,this.state);this.enterRule(t,60,E.RULE_msg);try{this.enterOuterAlt(t,1),this.state=372,this.match(E.MSG),this.state=373,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}multilineBlock(){let t=new j(this,this._ctx,this.state);this.enterRule(t,62,E.RULE_multilineBlock);var e=0;try{for(this.enterOuterAlt(t,1),this.state=375,this.match(E.BRACK_OPEN),this.state=379,this._errHandler.sync(this),e=this._input.LA(1);81===e;)this.state=376,this.match(E.AnythingElseInMultiLine),this.state=381,this._errHandler.sync(this),e=this._input.LA(1);this.state=383,this._errHandler.sync(this),64===(e=this._input.LA(1))&&(this.state=382,this.innerMultilineBlock()),this.state=385,this.match(E.BRACK_CLOSE)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}innerMultilineBlock(){let t=new J(this,this._ctx,this.state);this.enterRule(t,64,E.RULE_innerMultilineBlock);var e=0;try{for(this.enterOuterAlt(t,1),this.state=387,this.multilineBlock(),this.state=391,this._errHandler.sync(this),e=this._input.LA(1);81===e;)this.state=388,this.match(E.AnythingElseInMultiLine),this.state=393,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}opengame(){let t=new X(this,this._ctx,this.state);this.enterRule(t,66,E.RULE_opengame);var e=0;try{this.enterOuterAlt(t,1),this.state=394,this.match(E.OPENGAME),this.state=396,this._errHandler.sync(this),(!((e=this._input.LA(1))-12&-32)&&1<<e-12&3223453697||!(e-44&-32)&&1<<e-44&3154021)&&(this.state=395,this.value(0))}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}play(){let t=new Z(this,this._ctx,this.state);this.enterRule(t,68,E.RULE_play);try{this.enterOuterAlt(t,1),this.state=398,this.match(E.PLAY),this.state=399,this.functionArguments()}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}print(){let t=new tt(this,this._ctx,this.state);this.enterRule(t,70,E.RULE_print);try{switch(this.state=409,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,33,this._ctx)){case 1:this.enterOuterAlt(t,1),this.state=401,this.printMain();break;case 2:this.enterOuterAlt(t,2),this.state=402,this.printNewlineMain();break;case 3:this.enterOuterAlt(t,3),this.state=403,this.printNewlinepreMain();break;case 4:this.enterOuterAlt(t,4),this.state=404,this.printEmptyLineMain();break;case 5:this.enterOuterAlt(t,5),this.state=405,this.printSide();break;case 6:this.enterOuterAlt(t,6),this.state=406,this.printNewlineSide();break;case 7:this.enterOuterAlt(t,7),this.state=407,this.printNewlinepreSide();break;case 8:this.enterOuterAlt(t,8),this.state=408,this.printEmptyLineSide()}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printMain(){let t=new et(this,this._ctx,this.state);this.enterRule(t,72,E.RULE_printMain);try{switch(this.state=415,this._errHandler.sync(this),this._input.LA(1)){case 12:case 29:case 33:case 42:case 43:case 44:case 46:case 49:case 50:case 57:case 64:case 65:this.enterOuterAlt(t,1),this.state=411,this.value(0);break;case 47:this.enterOuterAlt(t,2),this.state=412,this.match(E.STAR),this.state=413,this.match(E.Print),this.state=414,this.value(0);break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printNewlineMain(){let t=new nt(this,this._ctx,this.state);this.enterRule(t,74,E.RULE_printNewlineMain);try{this.enterOuterAlt(t,1),this.state=417,this.match(E.STAR),this.state=418,this.match(E.PrintNewline),this.state=419,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printNewlinepreMain(){let t=new it(this,this._ctx,this.state);this.enterRule(t,76,E.RULE_printNewlinepreMain);try{this.enterOuterAlt(t,1),this.state=421,this.match(E.STAR),this.state=422,this.match(E.PrintNewlinepre),this.state=423,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printEmptyLineMain(){let t=new st(this,this._ctx,this.state);this.enterRule(t,78,E.RULE_printEmptyLineMain);var e=0;try{this.enterOuterAlt(t,1),this.state=425,this.match(E.STAR),this.state=426,19!==(e=this._input.LA(1))&&20!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printSide(){let t=new rt(this,this._ctx,this.state);this.enterRule(t,80,E.RULE_printSide);try{this.enterOuterAlt(t,1),this.state=428,this.match(E.Print),this.state=429,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printNewlineSide(){let t=new ot(this,this._ctx,this.state);this.enterRule(t,82,E.RULE_printNewlineSide);try{this.enterOuterAlt(t,1),this.state=431,this.match(E.PrintNewline),this.state=432,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printNewlinepreSide(){let t=new at(this,this._ctx,this.state);this.enterRule(t,84,E.RULE_printNewlinepreSide);try{this.enterOuterAlt(t,1),this.state=434,this.match(E.PrintNewlinepre),this.state=435,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}printEmptyLineSide(){let t=new lt(this,this._ctx,this.state);this.enterRule(t,86,E.RULE_printEmptyLineSide);var e=0;try{this.enterOuterAlt(t,1),this.state=437,19!==(e=this._input.LA(1))&&20!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}savegame(){let t=new ht(this,this._ctx,this.state);this.enterRule(t,88,E.RULE_savegame);try{this.enterOuterAlt(t,1),this.state=439,this.match(E.SAVEGAME),this.state=440,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}syscall(){let t=new ut(this,this._ctx,this.state);this.enterRule(t,90,E.RULE_syscall);try{this.enterOuterAlt(t,1),this.state=442,this.match(E.SYSCALL)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}syssetting(){let t=new ct(this,this._ctx,this.state);this.enterRule(t,92,E.RULE_syssetting);try{this.enterOuterAlt(t,1),this.state=444,this.match(E.SYSSETTING),this.state=445,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}view(){let t=new dt(this,this._ctx,this.state);this.enterRule(t,94,E.RULE_view);var e=0;try{this.enterOuterAlt(t,1),this.state=447,this.match(E.VIEW),this.state=449,this._errHandler.sync(this),(!((e=this._input.LA(1))-12&-32)&&1<<e-12&3223453697||!(e-44&-32)&&1<<e-44&3154021)&&(this.state=448,this.value(0))}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}wait(){let t=new pt(this,this._ctx,this.state);this.enterRule(t,96,E.RULE_wait);try{this.enterOuterAlt(t,1),this.state=451,this.match(E.WAIT),this.state=452,this.value(0)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}identifier(){let t=new gt(this,this._ctx,this.state);this.enterRule(t,98,E.RULE_identifier);try{switch(this.state=456,this._errHandler.sync(this),this._input.LA(1)){case 57:this.enterOuterAlt(t,1),this.state=454,this.identifierString();break;case 46:this.enterOuterAlt(t,2),this.state=455,this.identifierNumber();break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}identifierNumber(){let t=new xt(this,this._ctx,this.state);this.enterRule(t,100,E.RULE_identifierNumber);try{this.enterOuterAlt(t,1),this.state=458,this.match(E.WORD),this.state=460,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,37,this._ctx)&&(this.state=459,this.arrayIndex())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}identifierString(){let t=new ft(this,this._ctx,this.state);this.enterRule(t,102,E.RULE_identifierString);try{this.enterOuterAlt(t,1),this.state=462,this.match(E.DOLLAR),this.state=463,this.match(E.WORD),this.state=465,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,38,this._ctx)&&(this.state=464,this.arrayIndex())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}arrayIndex(){let t=new mt(this,this._ctx,this.state);this.enterRule(t,104,E.RULE_arrayIndex);try{switch(this.state=473,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,39,this._ctx)){case 1:this.enterOuterAlt(t,1),this.state=467,this.match(E.ARRAYBRACKOPEN),this.state=468,this.value(0),this.state=469,this.match(E.ARRAYBRACKCLOSE);break;case 2:this.enterOuterAlt(t,2),this.state=471,this.match(E.ARRAYBRACKOPEN),this.state=472,this.match(E.ARRAYBRACKCLOSE)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}compareOperator(){let t=new Et(this,this._ctx,this.state);this.enterRule(t,106,E.RULE_compareOperator);try{switch(this.state=481,this._errHandler.sync(this),this._input.LA(1)){case 53:this.enterOuterAlt(t,1),this.state=475,this.match(E.GREAT_EQUAL_THAN);break;case 52:this.enterOuterAlt(t,2),this.state=476,this.match(E.GREATER_THAN);break;case 55:this.enterOuterAlt(t,3),this.state=477,this.match(E.LOWER_EQUAL_THAN);break;case 54:this.enterOuterAlt(t,4),this.state=478,this.match(E.LOWER_THAN);break;case 35:this.enterOuterAlt(t,5),this.state=479,this.match(E.EqualOperator);break;case 56:case 58:this.enterOuterAlt(t,6),this.state=480,this.notEqual();break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}notEqual(){let t=new Tt(this,this._ctx,this.state);this.enterRule(t,108,E.RULE_notEqual);var e=0;try{this.enterOuterAlt(t,1),this.state=483,56!==(e=this._input.LA(1))&&58!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}value(t){void 0===t&&(t=0);const e=this._ctx,n=this.state;let i=new Rt(this,this._ctx,n),s=i;this.enterRecursionRule(i,110,E.RULE_value,t);try{switch(this.enterOuterAlt(i,1),this.state=504,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,41,this._ctx)){case 1:this.state=486,this.match(E.ParenthesisLeft),this.state=487,this.value(0),this.state=488,this.match(E.ParenthesisRight);break;case 2:this.state=490,this.numberLiteralWithOptionalSign();break;case 3:this.state=491,this.identifierNumber();break;case 4:this.state=492,this.match(E.INPUT),this.state=493,this.value(10);break;case 5:this.state=494,this.invert(),this.state=495,this.value(9);break;case 6:this.state=497,this.functionWithNumberReturn();break;case 7:this.state=498,this.escapedString();break;case 8:this.state=499,this.identifierString();break;case 9:this.state=500,this.functionWithStringReturn();break;case 10:this.state=501,this.multilineBlock();break;case 11:this.state=502,this.match(E.MINUS),this.state=503,this.value(1)}this._ctx.stop=this._input.LT(-1),this.state=516,this._errHandler.sync(this);for(var r=this._interp.adaptivePredict(this._input,43,this._ctx);2!=r&&r!=l.atn.ATN.INVALID_ALT_NUMBER;){if(1===r)switch(null!==this._parseListeners&&this.triggerExitRuleEvent(),s=i,this.state=514,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,42,this._ctx)){case 1:if(i=new Rt(this,e,n),this.pushNewRecursionContext(i,110,E.RULE_value),this.state=506,!this.precpred(this._ctx,7))throw new l.error.FailedPredicateException(this,"this.precpred(this._ctx, 7)");this.state=507,this.numberOperator(),this.state=508,this.value(8);break;case 2:if(i=new Rt(this,e,n),this.pushNewRecursionContext(i,110,E.RULE_value),this.state=510,!this.precpred(this._ctx,6))throw new l.error.FailedPredicateException(this,"this.precpred(this._ctx, 6)");this.state=511,this.compareOperator(),this.state=512,this.value(7)}this.state=518,this._errHandler.sync(this),r=this._interp.adaptivePredict(this._input,43,this._ctx)}}catch(t){if(!(t instanceof l.error.RecognitionException))throw t;i.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.unrollRecursionContexts(e)}return i}numberLiteralWithOptionalSign(){let t=new St(this,this._ctx,this.state);this.enterRule(t,112,E.RULE_numberLiteralWithOptionalSign);var e=0;try{this.enterOuterAlt(t,1),this.state=520,this._errHandler.sync(this),49!==(e=this._input.LA(1))&&50!==e||(this.state=519,49!==(e=this._input.LA(1))&&50!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())),this.state=522,this.match(E.NumberLiteral)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}functionWithNumberReturn(){let t=new _t(this,this._ctx,this.state);this.enterRule(t,114,E.RULE_functionWithNumberReturn);try{this.enterOuterAlt(t,1),this.state=524,this.match(E.WORD),this.state=525,this.match(E.ParenthesisLeft),this.state=526,this.functionArguments(),this.state=527,this.match(E.ParenthesisRight)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}invert(){let t=new At(this,this._ctx,this.state);this.enterRule(t,116,E.RULE_invert);try{this.enterOuterAlt(t,1),this.state=529,this.match(E.INVERT)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}numberOperator(){let t=new Ct(this,this._ctx,this.state);this.enterRule(t,118,E.RULE_numberOperator);var e=0;try{for(this.enterOuterAlt(t,1),this.state=534,this._errHandler.sync(this),e=this._input.LA(1);69===e;)this.state=531,this.match(E.NEWLINE),this.state=536,this._errHandler.sync(this),e=this._input.LA(1);this.state=537,(e=this._input.LA(1))-30&-32||!(1<<e-30&3833859)?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}functionWithStringReturn(){let t=new vt(this,this._ctx,this.state);this.enterRule(t,120,E.RULE_functionWithStringReturn);try{this.enterOuterAlt(t,1),this.state=539,this.match(E.DOLLAR),this.state=540,this.match(E.WORD),this.state=541,this.match(E.ParenthesisLeft),this.state=542,this.functionArguments(),this.state=543,this.match(E.ParenthesisRight)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}functionArguments(){let t=new Lt(this,this._ctx,this.state);this.enterRule(t,122,E.RULE_functionArguments);var e=0;try{for(this.enterOuterAlt(t,1),this.state=545,this.value(0),this.state=550,this._errHandler.sync(this),e=this._input.LA(1);67===e;)this.state=546,this.match(E.Comma),this.state=547,this.value(0),this.state=552,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}escapedString(){let t=new yt(this,this._ctx,this.state);this.enterRule(t,124,E.RULE_escapedString);var e=0;try{switch(this.state=589,this._errHandler.sync(this),this._input.LA(1)){case 44:for(this.enterOuterAlt(t,1),this.state=553,this.match(E.TemplateDoubleSingleQuote),this.state=557,this._errHandler.sync(this),e=this._input.LA(1);79===e;)this.state=554,this.match(E.InEscapedStringAtom),this.state=559,this._errHandler.sync(this),e=this._input.LA(1);this.state=560,this.match(E.TemplateDoubleSingleQuote);break;case 43:for(this.enterOuterAlt(t,2),this.state=561,this.match(E.SINGLEQUOTE),this.state=565,this._errHandler.sync(this),e=this._input.LA(1);73===e||75===e;)this.state=562,this.stringAtom(),this.state=567,this._errHandler.sync(this),e=this._input.LA(1);for(this.state=571,this._errHandler.sync(this),e=this._input.LA(1);74===e;)this.state=568,this.stringTemplateVarSuffix(),this.state=573,this._errHandler.sync(this),e=this._input.LA(1);this.state=574,this.match(E.SINGLEQUOTE);break;case 42:for(this.enterOuterAlt(t,3),this.state=575,this.match(E.DOUBLEQUOTE),this.state=579,this._errHandler.sync(this),e=this._input.LA(1);76===e||78===e;)this.state=576,this.doubleQuoteAtom(),this.state=581,this._errHandler.sync(this),e=this._input.LA(1);for(this.state=585,this._errHandler.sync(this),e=this._input.LA(1);77===e;)this.state=582,this.stringDQTemplateVarSuffix(),this.state=587,this._errHandler.sync(this),e=this._input.LA(1);this.state=588,this.match(E.DOUBLEQUOTE);break;default:throw new l.error.NoViableAltException(this)}}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}stringAtom(){let t=new Nt(this,this._ctx,this.state);this.enterRule(t,126,E.RULE_stringAtom);var e=0;try{this.enterOuterAlt(t,1),this.state=591,73!==(e=this._input.LA(1))&&75!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}stringTemplateVar(){let t=new It(this,this._ctx,this.state);this.enterRule(t,128,E.RULE_stringTemplateVar);try{this.enterOuterAlt(t,1),this.state=593,this.match(E.TemplateStringStartExpression),this.state=594,this.value(0),this.state=595,this.match(E.TemplateStringEndExpression)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}stringTemplateVarSuffix(){let t=new kt(this,this._ctx,this.state);this.enterRule(t,130,E.RULE_stringTemplateVarSuffix);var e=0;try{for(this.enterOuterAlt(t,1),this.state=597,this.stringTemplateVar(),this.state=601,this._errHandler.sync(this),e=this._input.LA(1);73===e||75===e;)this.state=598,this.stringAtom(),this.state=603,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}doubleQuoteAtom(){let t=new Ot(this,this._ctx,this.state);this.enterRule(t,132,E.RULE_doubleQuoteAtom);var e=0;try{this.enterOuterAlt(t,1),this.state=604,76!==(e=this._input.LA(1))&&78!==e?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume())}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}stringTemplateVarDQ(){let t=new Pt(this,this._ctx,this.state);this.enterRule(t,134,E.RULE_stringTemplateVarDQ);try{this.enterOuterAlt(t,1),this.state=606,this.match(E.DQTemplateStringStartExpression),this.state=607,this.value(0),this.state=608,this.match(E.TemplateStringEndExpression)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}stringDQTemplateVarSuffix(){let t=new wt(this,this._ctx,this.state);this.enterRule(t,136,E.RULE_stringDQTemplateVarSuffix);var e=0;try{for(this.enterOuterAlt(t,1),this.state=610,this.stringTemplateVarDQ(),this.state=614,this._errHandler.sync(this),e=this._input.LA(1);76===e||78===e;)this.state=611,this.doubleQuoteAtom(),this.state=616,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof l.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t}}E.EOF=l.Token.EOF,E.PassageIdentifier=1,E.PassageEndMarker=2,E.SYSCALL=3,E.SYSSETTING=4,E.ADDOBJ=5,E.COPYARR=6,E.DELACT=7,E.DYNAMIC=8,E.GOSUB=9,E.GOTO=10,E.XGOTO=11,E.INPUT=12,E.JUMP=13,E.KILLVAR=14,E.MSG=15,E.OPENGAME=16,E.PLAY=17,E.Print=18,E.PrintNewline=19,E.PrintNewlinepre=20,E.SAVEGAME=21,E.VIEW=22,E.WAIT=23,E.ACT=24,E.IF=25,E.ELSEIF=26,E.ELSE=27,E.END=28,E.INVERT=29,E.AND=30,E.OR=31,E.CommandConnect=32,E.NumberLiteral=33,E.SET=34,E.EqualOperator=35,E.IncrementOperator=36,E.DecrementOperator=37,E.DivideSelfOperator=38,E.MultSelfOperator=39,E.SetToOperator=40,E.TemplateStringEndExpression=41,E.DOUBLEQUOTE=42,E.SINGLEQUOTE=43,E.TemplateDoubleSingleQuote=44,E.MOD=45,E.WORD=46,E.STAR=47,E.DPOINT=48,E.PLUS=49,E.MINUS=50,E.DIVIDE=51,E.GREATER_THAN=52,E.GREAT_EQUAL_THAN=53,E.LOWER_THAN=54,E.LOWER_EQUAL_THAN=55,E.NEQ=56,E.DOLLAR=57,E.EXCLAMATIONMARK=58,E.CommentStart=59,E.AttachedComment=60,E.Multilinecomment=61,E.ARRAYBRACKOPEN=62,E.ARRAYBRACKCLOSE=63,E.BRACK_OPEN=64,E.ParenthesisLeft=65,E.ParenthesisRight=66,E.Comma=67,E.Questionmark=68,E.NEWLINE=69,E.WHITESPACE=70,E.LINEBREAK=71,E.AnythingElse=72,E.EscapedSingleQuote=73,E.TemplateStringStartExpression=74,E.StringAtom=75,E.EscapedDoubleQuote=76,E.DQTemplateStringStartExpression=77,E.DQStringAtom=78,E.InEscapedStringAtom=79,E.BRACK_CLOSE=80,E.AnythingElseInMultiLine=81,E.InComment=82,E.RULE_passage=0,E.RULE_block=1,E.RULE_statementLine=2,E.RULE_emptyLine=3,E.RULE_actBlock=4,E.RULE_actInline=5,E.RULE_actPicture=6,E.RULE_ifInline=7,E.RULE_ifBlock=8,E.RULE_elseIfBlock=9,E.RULE_elseBlock=10,E.RULE_command=11,E.RULE_commandLine=12,E.RULE_commandAppended=13,E.RULE_addobj=14,E.RULE_assignment=15,E.RULE_assignmentNumber=16,E.RULE_assignmentString=17,E.RULE_assignmentoperator=18,E.RULE_comment=19,E.RULE_commentAttached=20,E.RULE_copyarr=21,E.RULE_delact=22,E.RULE_dynamic=23,E.RULE_gosub=24,E.RULE_gt=25,E.RULE_xgt=26,E.RULE_jump=27,E.RULE_jumpmarker=28,E.RULE_killvar=29,E.RULE_msg=30,E.RULE_multilineBlock=31,E.RULE_innerMultilineBlock=32,E.RULE_opengame=33,E.RULE_play=34,E.RULE_print=35,E.RULE_printMain=36,E.RULE_printNewlineMain=37,E.RULE_printNewlinepreMain=38,E.RULE_printEmptyLineMain=39,E.RULE_printSide=40,E.RULE_printNewlineSide=41,E.RULE_printNewlinepreSide=42,E.RULE_printEmptyLineSide=43,E.RULE_savegame=44,E.RULE_syscall=45,E.RULE_syssetting=46,E.RULE_view=47,E.RULE_wait=48,E.RULE_identifier=49,E.RULE_identifierNumber=50,E.RULE_identifierString=51,E.RULE_arrayIndex=52,E.RULE_compareOperator=53,E.RULE_notEqual=54,E.RULE_value=55,E.RULE_numberLiteralWithOptionalSign=56,E.RULE_functionWithNumberReturn=57,E.RULE_invert=58,E.RULE_numberOperator=59,E.RULE_functionWithStringReturn=60,E.RULE_functionArguments=61,E.RULE_escapedString=62,E.RULE_stringAtom=63,E.RULE_stringTemplateVar=64,E.RULE_stringTemplateVarSuffix=65,E.RULE_doubleQuoteAtom=66,E.RULE_stringTemplateVarDQ=67,E.RULE_stringDQTemplateVarSuffix=68;class T extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_passage}PassageIdentifier(){return this.getToken(E.PassageIdentifier,0)}block(){return this.getTypedRuleContext(R,0)}PassageEndMarker(){return this.getToken(E.PassageEndMarker,0)}EOF(){return this.getToken(E.EOF,0)}NEWLINE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.NEWLINE):this.getToken(E.NEWLINE,t)};comment=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(H):this.getTypedRuleContext(H,t)};enterRule(t){t instanceof p&&t.enterPassage(this)}exitRule(t){t instanceof p&&t.exitPassage(this)}accept(t){return t instanceof g?t.visitPassage(this):t.visitChildren(this)}}class R extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_block}statementLine=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(S):this.getTypedRuleContext(S,t)};enterRule(t){t instanceof p&&t.enterBlock(this)}exitRule(t){t instanceof p&&t.exitBlock(this)}accept(t){return t instanceof g?t.visitBlock(this):t.visitChildren(this)}}class S extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_statementLine}actBlock(){return this.getTypedRuleContext(A,0)}commandLine(){return this.getTypedRuleContext(O,0)}ifBlock(){return this.getTypedRuleContext(y,0)}emptyLine(){return this.getTypedRuleContext(_,0)}enterRule(t){t instanceof p&&t.enterStatementLine(this)}exitRule(t){t instanceof p&&t.exitStatementLine(this)}accept(t){return t instanceof g?t.visitStatementLine(this):t.visitChildren(this)}}class _ extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_emptyLine}NEWLINE(){return this.getToken(E.NEWLINE,0)}enterRule(t){t instanceof p&&t.enterEmptyLine(this)}exitRule(t){t instanceof p&&t.exitEmptyLine(this)}accept(t){return t instanceof g?t.visitEmptyLine(this):t.visitChildren(this)}}class A extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_actBlock}ACT(){return this.getToken(E.ACT,0)}value(){return this.getTypedRuleContext(Rt,0)}DPOINT(){return this.getToken(E.DPOINT,0)}NEWLINE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.NEWLINE):this.getToken(E.NEWLINE,t)};block(){return this.getTypedRuleContext(R,0)}END(){return this.getToken(E.END,0)}commandAppended(){return this.getTypedRuleContext(P,0)}commentAttached(){return this.getTypedRuleContext(F,0)}enterRule(t){t instanceof p&&t.enterActBlock(this)}exitRule(t){t instanceof p&&t.exitActBlock(this)}accept(t){return t instanceof g?t.visitActBlock(this):t.visitChildren(this)}}class C extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_actInline}ACT(){return this.getToken(E.ACT,0)}value(){return this.getTypedRuleContext(Rt,0)}DPOINT(){return this.getToken(E.DPOINT,0)}command(){return this.getTypedRuleContext(k,0)}actPicture(){return this.getTypedRuleContext(v,0)}enterRule(t){t instanceof p&&t.enterActInline(this)}exitRule(t){t instanceof p&&t.exitActInline(this)}accept(t){return t instanceof g?t.visitActInline(this):t.visitChildren(this)}}class v extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_actPicture}Comma(){return this.getToken(E.Comma,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterActPicture(this)}exitRule(t){t instanceof p&&t.exitActPicture(this)}accept(t){return t instanceof g?t.visitActPicture(this):t.visitChildren(this)}}class L extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_ifInline}IF(){return this.getToken(E.IF,0)}value(){return this.getTypedRuleContext(Rt,0)}DPOINT(){return this.getToken(E.DPOINT,0)}command=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(k):this.getTypedRuleContext(k,t)};ELSE(){return this.getToken(E.ELSE,0)}enterRule(t){t instanceof p&&t.enterIfInline(this)}exitRule(t){t instanceof p&&t.exitIfInline(this)}accept(t){return t instanceof g?t.visitIfInline(this):t.visitChildren(this)}}class y extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_ifBlock}IF(){return this.getToken(E.IF,0)}value(){return this.getTypedRuleContext(Rt,0)}DPOINT(){return this.getToken(E.DPOINT,0)}NEWLINE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.NEWLINE):this.getToken(E.NEWLINE,t)};block(){return this.getTypedRuleContext(R,0)}END(){return this.getToken(E.END,0)}elseIfBlock=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(N):this.getTypedRuleContext(N,t)};elseBlock(){return this.getTypedRuleContext(I,0)}commandAppended(){return this.getTypedRuleContext(P,0)}commentAttached(){return this.getTypedRuleContext(F,0)}enterRule(t){t instanceof p&&t.enterIfBlock(this)}exitRule(t){t instanceof p&&t.exitIfBlock(this)}accept(t){return t instanceof g?t.visitIfBlock(this):t.visitChildren(this)}}class N extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_elseIfBlock}ELSEIF(){return this.getToken(E.ELSEIF,0)}value(){return this.getTypedRuleContext(Rt,0)}DPOINT(){return this.getToken(E.DPOINT,0)}NEWLINE(){return this.getToken(E.NEWLINE,0)}block(){return this.getTypedRuleContext(R,0)}enterRule(t){t instanceof p&&t.enterElseIfBlock(this)}exitRule(t){t instanceof p&&t.exitElseIfBlock(this)}accept(t){return t instanceof g?t.visitElseIfBlock(this):t.visitChildren(this)}}class I extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_elseBlock}ELSE(){return this.getToken(E.ELSE,0)}NEWLINE(){return this.getToken(E.NEWLINE,0)}block(){return this.getTypedRuleContext(R,0)}enterRule(t){t instanceof p&&t.enterElseBlock(this)}exitRule(t){t instanceof p&&t.exitElseBlock(this)}accept(t){return t instanceof g?t.visitElseBlock(this):t.visitChildren(this)}}class k extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_command}addobj(){return this.getTypedRuleContext(w,0)}assignment(){return this.getTypedRuleContext(b,0)}copyarr(){return this.getTypedRuleContext(B,0)}delact(){return this.getTypedRuleContext(V,0)}dynamic(){return this.getTypedRuleContext(W,0)}gosub(){return this.getTypedRuleContext($,0)}gt(){return this.getTypedRuleContext(Q,0)}xgt(){return this.getTypedRuleContext(G,0)}jump(){return this.getTypedRuleContext(K,0)}jumpmarker(){return this.getTypedRuleContext(q,0)}killvar(){return this.getTypedRuleContext(Y,0)}msg(){return this.getTypedRuleContext(z,0)}opengame(){return this.getTypedRuleContext(X,0)}play(){return this.getTypedRuleContext(Z,0)}print(){return this.getTypedRuleContext(tt,0)}savegame(){return this.getTypedRuleContext(ht,0)}syscall(){return this.getTypedRuleContext(ut,0)}syssetting(){return this.getTypedRuleContext(ct,0)}view(){return this.getTypedRuleContext(dt,0)}wait(){return this.getTypedRuleContext(pt,0)}commandAppended=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(P):this.getTypedRuleContext(P,t)};ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}command(){return this.getTypedRuleContext(k,0)}ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}actInline(){return this.getTypedRuleContext(C,0)}comment(){return this.getTypedRuleContext(H,0)}ifInline(){return this.getTypedRuleContext(L,0)}enterRule(t){t instanceof p&&t.enterCommand(this)}exitRule(t){t instanceof p&&t.exitCommand(this)}accept(t){return t instanceof g?t.visitCommand(this):t.visitChildren(this)}}class O extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_commandLine}command(){return this.getTypedRuleContext(k,0)}NEWLINE(){return this.getToken(E.NEWLINE,0)}commandAppended(){return this.getTypedRuleContext(P,0)}commentAttached(){return this.getTypedRuleContext(F,0)}enterRule(t){t instanceof p&&t.enterCommandLine(this)}exitRule(t){t instanceof p&&t.exitCommandLine(this)}accept(t){return t instanceof g?t.visitCommandLine(this):t.visitChildren(this)}}class P extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_commandAppended}CommandConnect=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.CommandConnect):this.getToken(E.CommandConnect,t)};command(){return this.getTypedRuleContext(k,0)}enterRule(t){t instanceof p&&t.enterCommandAppended(this)}exitRule(t){t instanceof p&&t.exitCommandAppended(this)}accept(t){return t instanceof g?t.visitCommandAppended(this):t.visitChildren(this)}}class w extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_addobj}ADDOBJ(){return this.getToken(E.ADDOBJ,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterAddobj(this)}exitRule(t){t instanceof p&&t.exitAddobj(this)}accept(t){return t instanceof g?t.visitAddobj(this):t.visitChildren(this)}}class b extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_assignment}assignmentNumber(){return this.getTypedRuleContext(D,0)}assignmentString(){return this.getTypedRuleContext(U,0)}SET(){return this.getToken(E.SET,0)}enterRule(t){t instanceof p&&t.enterAssignment(this)}exitRule(t){t instanceof p&&t.exitAssignment(this)}accept(t){return t instanceof g?t.visitAssignment(this):t.visitChildren(this)}}class D extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_assignmentNumber}identifierNumber(){return this.getTypedRuleContext(xt,0)}assignmentoperator(){return this.getTypedRuleContext(M,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterAssignmentNumber(this)}exitRule(t){t instanceof p&&t.exitAssignmentNumber(this)}accept(t){return t instanceof g?t.visitAssignmentNumber(this):t.visitChildren(this)}}class U extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_assignmentString}identifierString(){return this.getTypedRuleContext(ft,0)}assignmentoperator(){return this.getTypedRuleContext(M,0)}value(){return this.getTypedRuleContext(Rt,0)}multilineBlock(){return this.getTypedRuleContext(j,0)}enterRule(t){t instanceof p&&t.enterAssignmentString(this)}exitRule(t){t instanceof p&&t.exitAssignmentString(this)}accept(t){return t instanceof g?t.visitAssignmentString(this):t.visitChildren(this)}}class M extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_assignmentoperator}EqualOperator(){return this.getToken(E.EqualOperator,0)}IncrementOperator(){return this.getToken(E.IncrementOperator,0)}DecrementOperator(){return this.getToken(E.DecrementOperator,0)}SetToOperator(){return this.getToken(E.SetToOperator,0)}MultSelfOperator(){return this.getToken(E.MultSelfOperator,0)}DivideSelfOperator(){return this.getToken(E.DivideSelfOperator,0)}enterRule(t){t instanceof p&&t.enterAssignmentoperator(this)}exitRule(t){t instanceof p&&t.exitAssignmentoperator(this)}accept(t){return t instanceof g?t.visitAssignmentoperator(this):t.visitChildren(this)}}class H extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_comment}EXCLAMATIONMARK(){return this.getToken(E.EXCLAMATIONMARK,0)}NEWLINE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.NEWLINE):this.getToken(E.NEWLINE,t)};CommentStart(){return this.getToken(E.CommentStart,0)}InComment=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.InComment):this.getToken(E.InComment,t)};Multilinecomment(){return this.getToken(E.Multilinecomment,0)}enterRule(t){t instanceof p&&t.enterComment(this)}exitRule(t){t instanceof p&&t.exitComment(this)}accept(t){return t instanceof g?t.visitComment(this):t.visitChildren(this)}}class F extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_commentAttached}AttachedComment(){return this.getToken(E.AttachedComment,0)}InComment=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.InComment):this.getToken(E.InComment,t)};enterRule(t){t instanceof p&&t.enterCommentAttached(this)}exitRule(t){t instanceof p&&t.exitCommentAttached(this)}accept(t){return t instanceof g?t.visitCommentAttached(this):t.visitChildren(this)}}class B extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_copyarr}COPYARR(){return this.getToken(E.COPYARR,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}enterRule(t){t instanceof p&&t.enterCopyarr(this)}exitRule(t){t instanceof p&&t.exitCopyarr(this)}accept(t){return t instanceof g?t.visitCopyarr(this):t.visitChildren(this)}}class V extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_delact}DELACT(){return this.getToken(E.DELACT,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterDelact(this)}exitRule(t){t instanceof p&&t.exitDelact(this)}accept(t){return t instanceof g?t.visitDelact(this):t.visitChildren(this)}}class W extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_dynamic}DYNAMIC(){return this.getToken(E.DYNAMIC,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}enterRule(t){t instanceof p&&t.enterDynamic(this)}exitRule(t){t instanceof p&&t.exitDynamic(this)}accept(t){return t instanceof g?t.visitDynamic(this):t.visitChildren(this)}}class $ extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_gosub}GOSUB(){return this.getToken(E.GOSUB,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}enterRule(t){t instanceof p&&t.enterGosub(this)}exitRule(t){t instanceof p&&t.exitGosub(this)}accept(t){return t instanceof g?t.visitGosub(this):t.visitChildren(this)}}class Q extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_gt}GOTO(){return this.getToken(E.GOTO,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}enterRule(t){t instanceof p&&t.enterGt(this)}exitRule(t){t instanceof p&&t.exitGt(this)}accept(t){return t instanceof g?t.visitGt(this):t.visitChildren(this)}}class G extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_xgt}XGOTO(){return this.getToken(E.XGOTO,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}enterRule(t){t instanceof p&&t.enterXgt(this)}exitRule(t){t instanceof p&&t.exitXgt(this)}accept(t){return t instanceof g?t.visitXgt(this):t.visitChildren(this)}}class K extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_jump}JUMP(){return this.getToken(E.JUMP,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterJump(this)}exitRule(t){t instanceof p&&t.exitJump(this)}accept(t){return t instanceof g?t.visitJump(this):t.visitChildren(this)}}class q extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_jumpmarker}DPOINT(){return this.getToken(E.DPOINT,0)}WORD(){return this.getToken(E.WORD,0)}enterRule(t){t instanceof p&&t.enterJumpmarker(this)}exitRule(t){t instanceof p&&t.exitJumpmarker(this)}accept(t){return t instanceof g?t.visitJumpmarker(this):t.visitChildren(this)}}class Y extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_killvar}KILLVAR(){return this.getToken(E.KILLVAR,0)}value=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Rt):this.getTypedRuleContext(Rt,t)};Comma(){return this.getToken(E.Comma,0)}enterRule(t){t instanceof p&&t.enterKillvar(this)}exitRule(t){t instanceof p&&t.exitKillvar(this)}accept(t){return t instanceof g?t.visitKillvar(this):t.visitChildren(this)}}class z extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_msg}MSG(){return this.getToken(E.MSG,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterMsg(this)}exitRule(t){t instanceof p&&t.exitMsg(this)}accept(t){return t instanceof g?t.visitMsg(this):t.visitChildren(this)}}class j extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_multilineBlock}BRACK_OPEN(){return this.getToken(E.BRACK_OPEN,0)}BRACK_CLOSE(){return this.getToken(E.BRACK_CLOSE,0)}AnythingElseInMultiLine=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.AnythingElseInMultiLine):this.getToken(E.AnythingElseInMultiLine,t)};innerMultilineBlock(){return this.getTypedRuleContext(J,0)}enterRule(t){t instanceof p&&t.enterMultilineBlock(this)}exitRule(t){t instanceof p&&t.exitMultilineBlock(this)}accept(t){return t instanceof g?t.visitMultilineBlock(this):t.visitChildren(this)}}class J extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_innerMultilineBlock}multilineBlock(){return this.getTypedRuleContext(j,0)}AnythingElseInMultiLine=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.AnythingElseInMultiLine):this.getToken(E.AnythingElseInMultiLine,t)};enterRule(t){t instanceof p&&t.enterInnerMultilineBlock(this)}exitRule(t){t instanceof p&&t.exitInnerMultilineBlock(this)}accept(t){return t instanceof g?t.visitInnerMultilineBlock(this):t.visitChildren(this)}}class X extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_opengame}OPENGAME(){return this.getToken(E.OPENGAME,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterOpengame(this)}exitRule(t){t instanceof p&&t.exitOpengame(this)}accept(t){return t instanceof g?t.visitOpengame(this):t.visitChildren(this)}}class Z extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_play}PLAY(){return this.getToken(E.PLAY,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}enterRule(t){t instanceof p&&t.enterPlay(this)}exitRule(t){t instanceof p&&t.exitPlay(this)}accept(t){return t instanceof g?t.visitPlay(this):t.visitChildren(this)}}class tt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_print}printMain(){return this.getTypedRuleContext(et,0)}printNewlineMain(){return this.getTypedRuleContext(nt,0)}printNewlinepreMain(){return this.getTypedRuleContext(it,0)}printEmptyLineMain(){return this.getTypedRuleContext(st,0)}printSide(){return this.getTypedRuleContext(rt,0)}printNewlineSide(){return this.getTypedRuleContext(ot,0)}printNewlinepreSide(){return this.getTypedRuleContext(at,0)}printEmptyLineSide(){return this.getTypedRuleContext(lt,0)}enterRule(t){t instanceof p&&t.enterPrint(this)}exitRule(t){t instanceof p&&t.exitPrint(this)}accept(t){return t instanceof g?t.visitPrint(this):t.visitChildren(this)}}class et extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printMain}value(){return this.getTypedRuleContext(Rt,0)}STAR(){return this.getToken(E.STAR,0)}Print(){return this.getToken(E.Print,0)}enterRule(t){t instanceof p&&t.enterPrintMain(this)}exitRule(t){t instanceof p&&t.exitPrintMain(this)}accept(t){return t instanceof g?t.visitPrintMain(this):t.visitChildren(this)}}class nt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printNewlineMain}STAR(){return this.getToken(E.STAR,0)}PrintNewline(){return this.getToken(E.PrintNewline,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterPrintNewlineMain(this)}exitRule(t){t instanceof p&&t.exitPrintNewlineMain(this)}accept(t){return t instanceof g?t.visitPrintNewlineMain(this):t.visitChildren(this)}}class it extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printNewlinepreMain}STAR(){return this.getToken(E.STAR,0)}PrintNewlinepre(){return this.getToken(E.PrintNewlinepre,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterPrintNewlinepreMain(this)}exitRule(t){t instanceof p&&t.exitPrintNewlinepreMain(this)}accept(t){return t instanceof g?t.visitPrintNewlinepreMain(this):t.visitChildren(this)}}class st extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printEmptyLineMain}STAR(){return this.getToken(E.STAR,0)}PrintNewline(){return this.getToken(E.PrintNewline,0)}PrintNewlinepre(){return this.getToken(E.PrintNewlinepre,0)}enterRule(t){t instanceof p&&t.enterPrintEmptyLineMain(this)}exitRule(t){t instanceof p&&t.exitPrintEmptyLineMain(this)}accept(t){return t instanceof g?t.visitPrintEmptyLineMain(this):t.visitChildren(this)}}class rt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printSide}Print(){return this.getToken(E.Print,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterPrintSide(this)}exitRule(t){t instanceof p&&t.exitPrintSide(this)}accept(t){return t instanceof g?t.visitPrintSide(this):t.visitChildren(this)}}class ot extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printNewlineSide}PrintNewline(){return this.getToken(E.PrintNewline,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterPrintNewlineSide(this)}exitRule(t){t instanceof p&&t.exitPrintNewlineSide(this)}accept(t){return t instanceof g?t.visitPrintNewlineSide(this):t.visitChildren(this)}}class at extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printNewlinepreSide}PrintNewlinepre(){return this.getToken(E.PrintNewlinepre,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterPrintNewlinepreSide(this)}exitRule(t){t instanceof p&&t.exitPrintNewlinepreSide(this)}accept(t){return t instanceof g?t.visitPrintNewlinepreSide(this):t.visitChildren(this)}}class lt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_printEmptyLineSide}PrintNewline(){return this.getToken(E.PrintNewline,0)}PrintNewlinepre(){return this.getToken(E.PrintNewlinepre,0)}enterRule(t){t instanceof p&&t.enterPrintEmptyLineSide(this)}exitRule(t){t instanceof p&&t.exitPrintEmptyLineSide(this)}accept(t){return t instanceof g?t.visitPrintEmptyLineSide(this):t.visitChildren(this)}}class ht extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_savegame}SAVEGAME(){return this.getToken(E.SAVEGAME,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterSavegame(this)}exitRule(t){t instanceof p&&t.exitSavegame(this)}accept(t){return t instanceof g?t.visitSavegame(this):t.visitChildren(this)}}class ut extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_syscall}SYSCALL(){return this.getToken(E.SYSCALL,0)}enterRule(t){t instanceof p&&t.enterSyscall(this)}exitRule(t){t instanceof p&&t.exitSyscall(this)}accept(t){return t instanceof g?t.visitSyscall(this):t.visitChildren(this)}}class ct extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_syssetting}SYSSETTING(){return this.getToken(E.SYSSETTING,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterSyssetting(this)}exitRule(t){t instanceof p&&t.exitSyssetting(this)}accept(t){return t instanceof g?t.visitSyssetting(this):t.visitChildren(this)}}class dt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_view}VIEW(){return this.getToken(E.VIEW,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterView(this)}exitRule(t){t instanceof p&&t.exitView(this)}accept(t){return t instanceof g?t.visitView(this):t.visitChildren(this)}}class pt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_wait}WAIT(){return this.getToken(E.WAIT,0)}value(){return this.getTypedRuleContext(Rt,0)}enterRule(t){t instanceof p&&t.enterWait(this)}exitRule(t){t instanceof p&&t.exitWait(this)}accept(t){return t instanceof g?t.visitWait(this):t.visitChildren(this)}}class gt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_identifier}identifierString(){return this.getTypedRuleContext(ft,0)}identifierNumber(){return this.getTypedRuleContext(xt,0)}enterRule(t){t instanceof p&&t.enterIdentifier(this)}exitRule(t){t instanceof p&&t.exitIdentifier(this)}accept(t){return t instanceof g?t.visitIdentifier(this):t.visitChildren(this)}}class xt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_identifierNumber}WORD(){return this.getToken(E.WORD,0)}arrayIndex(){return this.getTypedRuleContext(mt,0)}enterRule(t){t instanceof p&&t.enterIdentifierNumber(this)}exitRule(t){t instanceof p&&t.exitIdentifierNumber(this)}accept(t){return t instanceof g?t.visitIdentifierNumber(this):t.visitChildren(this)}}class ft extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_identifierString}DOLLAR(){return this.getToken(E.DOLLAR,0)}WORD(){return this.getToken(E.WORD,0)}arrayIndex(){return this.getTypedRuleContext(mt,0)}enterRule(t){t instanceof p&&t.enterIdentifierString(this)}exitRule(t){t instanceof p&&t.exitIdentifierString(this)}accept(t){return t instanceof g?t.visitIdentifierString(this):t.visitChildren(this)}}class mt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_arrayIndex}ARRAYBRACKOPEN(){return this.getToken(E.ARRAYBRACKOPEN,0)}value(){return this.getTypedRuleContext(Rt,0)}ARRAYBRACKCLOSE(){return this.getToken(E.ARRAYBRACKCLOSE,0)}enterRule(t){t instanceof p&&t.enterArrayIndex(this)}exitRule(t){t instanceof p&&t.exitArrayIndex(this)}accept(t){return t instanceof g?t.visitArrayIndex(this):t.visitChildren(this)}}class Et extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_compareOperator}GREAT_EQUAL_THAN(){return this.getToken(E.GREAT_EQUAL_THAN,0)}GREATER_THAN(){return this.getToken(E.GREATER_THAN,0)}LOWER_EQUAL_THAN(){return this.getToken(E.LOWER_EQUAL_THAN,0)}LOWER_THAN(){return this.getToken(E.LOWER_THAN,0)}EqualOperator(){return this.getToken(E.EqualOperator,0)}notEqual(){return this.getTypedRuleContext(Tt,0)}enterRule(t){t instanceof p&&t.enterCompareOperator(this)}exitRule(t){t instanceof p&&t.exitCompareOperator(this)}accept(t){return t instanceof g?t.visitCompareOperator(this):t.visitChildren(this)}}class Tt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_notEqual}NEQ(){return this.getToken(E.NEQ,0)}EXCLAMATIONMARK(){return this.getToken(E.EXCLAMATIONMARK,0)}enterRule(t){t instanceof p&&t.enterNotEqual(this)}exitRule(t){t instanceof p&&t.exitNotEqual(this)}accept(t){return t instanceof g?t.visitNotEqual(this):t.visitChildren(this)}}class Rt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_value}ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}value=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Rt):this.getTypedRuleContext(Rt,t)};ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}numberLiteralWithOptionalSign(){return this.getTypedRuleContext(St,0)}identifierNumber(){return this.getTypedRuleContext(xt,0)}INPUT(){return this.getToken(E.INPUT,0)}invert(){return this.getTypedRuleContext(At,0)}functionWithNumberReturn(){return this.getTypedRuleContext(_t,0)}escapedString(){return this.getTypedRuleContext(yt,0)}identifierString(){return this.getTypedRuleContext(ft,0)}functionWithStringReturn(){return this.getTypedRuleContext(vt,0)}multilineBlock(){return this.getTypedRuleContext(j,0)}MINUS(){return this.getToken(E.MINUS,0)}numberOperator(){return this.getTypedRuleContext(Ct,0)}compareOperator(){return this.getTypedRuleContext(Et,0)}enterRule(t){t instanceof p&&t.enterValue(this)}exitRule(t){t instanceof p&&t.exitValue(this)}accept(t){return t instanceof g?t.visitValue(this):t.visitChildren(this)}}class St extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_numberLiteralWithOptionalSign}NumberLiteral(){return this.getToken(E.NumberLiteral,0)}PLUS(){return this.getToken(E.PLUS,0)}MINUS(){return this.getToken(E.MINUS,0)}enterRule(t){t instanceof p&&t.enterNumberLiteralWithOptionalSign(this)}exitRule(t){t instanceof p&&t.exitNumberLiteralWithOptionalSign(this)}accept(t){return t instanceof g?t.visitNumberLiteralWithOptionalSign(this):t.visitChildren(this)}}class _t extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_functionWithNumberReturn}WORD(){return this.getToken(E.WORD,0)}ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}enterRule(t){t instanceof p&&t.enterFunctionWithNumberReturn(this)}exitRule(t){t instanceof p&&t.exitFunctionWithNumberReturn(this)}accept(t){return t instanceof g?t.visitFunctionWithNumberReturn(this):t.visitChildren(this)}}class At extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_invert}INVERT(){return this.getToken(E.INVERT,0)}enterRule(t){t instanceof p&&t.enterInvert(this)}exitRule(t){t instanceof p&&t.exitInvert(this)}accept(t){return t instanceof g?t.visitInvert(this):t.visitChildren(this)}}class Ct extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_numberOperator}PLUS(){return this.getToken(E.PLUS,0)}MINUS(){return this.getToken(E.MINUS,0)}STAR(){return this.getToken(E.STAR,0)}MOD(){return this.getToken(E.MOD,0)}DIVIDE(){return this.getToken(E.DIVIDE,0)}AND(){return this.getToken(E.AND,0)}OR(){return this.getToken(E.OR,0)}NEWLINE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.NEWLINE):this.getToken(E.NEWLINE,t)};enterRule(t){t instanceof p&&t.enterNumberOperator(this)}exitRule(t){t instanceof p&&t.exitNumberOperator(this)}accept(t){return t instanceof g?t.visitNumberOperator(this):t.visitChildren(this)}}class vt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_functionWithStringReturn}DOLLAR(){return this.getToken(E.DOLLAR,0)}WORD(){return this.getToken(E.WORD,0)}ParenthesisLeft(){return this.getToken(E.ParenthesisLeft,0)}functionArguments(){return this.getTypedRuleContext(Lt,0)}ParenthesisRight(){return this.getToken(E.ParenthesisRight,0)}enterRule(t){t instanceof p&&t.enterFunctionWithStringReturn(this)}exitRule(t){t instanceof p&&t.exitFunctionWithStringReturn(this)}accept(t){return t instanceof g?t.visitFunctionWithStringReturn(this):t.visitChildren(this)}}class Lt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_functionArguments}value=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Rt):this.getTypedRuleContext(Rt,t)};Comma=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.Comma):this.getToken(E.Comma,t)};enterRule(t){t instanceof p&&t.enterFunctionArguments(this)}exitRule(t){t instanceof p&&t.exitFunctionArguments(this)}accept(t){return t instanceof g?t.visitFunctionArguments(this):t.visitChildren(this)}}class yt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_escapedString}TemplateDoubleSingleQuote=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.TemplateDoubleSingleQuote):this.getToken(E.TemplateDoubleSingleQuote,t)};InEscapedStringAtom=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.InEscapedStringAtom):this.getToken(E.InEscapedStringAtom,t)};SINGLEQUOTE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.SINGLEQUOTE):this.getToken(E.SINGLEQUOTE,t)};stringAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Nt):this.getTypedRuleContext(Nt,t)};stringTemplateVarSuffix=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(kt):this.getTypedRuleContext(kt,t)};DOUBLEQUOTE=function(t){return void 0===t&&(t=null),null===t?this.getTokens(E.DOUBLEQUOTE):this.getToken(E.DOUBLEQUOTE,t)};doubleQuoteAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Ot):this.getTypedRuleContext(Ot,t)};stringDQTemplateVarSuffix=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(wt):this.getTypedRuleContext(wt,t)};enterRule(t){t instanceof p&&t.enterEscapedString(this)}exitRule(t){t instanceof p&&t.exitEscapedString(this)}accept(t){return t instanceof g?t.visitEscapedString(this):t.visitChildren(this)}}class Nt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_stringAtom}StringAtom(){return this.getToken(E.StringAtom,0)}EscapedSingleQuote(){return this.getToken(E.EscapedSingleQuote,0)}enterRule(t){t instanceof p&&t.enterStringAtom(this)}exitRule(t){t instanceof p&&t.exitStringAtom(this)}accept(t){return t instanceof g?t.visitStringAtom(this):t.visitChildren(this)}}class It extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_stringTemplateVar}TemplateStringStartExpression(){return this.getToken(E.TemplateStringStartExpression,0)}value(){return this.getTypedRuleContext(Rt,0)}TemplateStringEndExpression(){return this.getToken(E.TemplateStringEndExpression,0)}enterRule(t){t instanceof p&&t.enterStringTemplateVar(this)}exitRule(t){t instanceof p&&t.exitStringTemplateVar(this)}accept(t){return t instanceof g?t.visitStringTemplateVar(this):t.visitChildren(this)}}class kt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_stringTemplateVarSuffix}stringTemplateVar(){return this.getTypedRuleContext(It,0)}stringAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Nt):this.getTypedRuleContext(Nt,t)};enterRule(t){t instanceof p&&t.enterStringTemplateVarSuffix(this)}exitRule(t){t instanceof p&&t.exitStringTemplateVarSuffix(this)}accept(t){return t instanceof g?t.visitStringTemplateVarSuffix(this):t.visitChildren(this)}}class Ot extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_doubleQuoteAtom}DQStringAtom(){return this.getToken(E.DQStringAtom,0)}EscapedDoubleQuote(){return this.getToken(E.EscapedDoubleQuote,0)}enterRule(t){t instanceof p&&t.enterDoubleQuoteAtom(this)}exitRule(t){t instanceof p&&t.exitDoubleQuoteAtom(this)}accept(t){return t instanceof g?t.visitDoubleQuoteAtom(this):t.visitChildren(this)}}class Pt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_stringTemplateVarDQ}DQTemplateStringStartExpression(){return this.getToken(E.DQTemplateStringStartExpression,0)}value(){return this.getTypedRuleContext(Rt,0)}TemplateStringEndExpression(){return this.getToken(E.TemplateStringEndExpression,0)}enterRule(t){t instanceof p&&t.enterStringTemplateVarDQ(this)}exitRule(t){t instanceof p&&t.exitStringTemplateVarDQ(this)}accept(t){return t instanceof g?t.visitStringTemplateVarDQ(this):t.visitChildren(this)}}class wt extends l.ParserRuleContext{constructor(t,e,n){void 0===e&&(e=null),null==n&&(n=-1),super(e,n),this.parser=t,this.ruleIndex=E.RULE_stringDQTemplateVarSuffix}stringTemplateVarDQ(){return this.getTypedRuleContext(Pt,0)}doubleQuoteAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(Ot):this.getTypedRuleContext(Ot,t)};enterRule(t){t instanceof p&&t.enterStringDQTemplateVarSuffix(this)}exitRule(t){t instanceof p&&t.exitStringDQTemplateVarSuffix(this)}accept(t){return t instanceof g?t.visitStringDQTemplateVarSuffix(this):t.visitChildren(this)}}E.PassageContext=T,E.BlockContext=R,E.StatementLineContext=S,E.EmptyLineContext=_,E.ActBlockContext=A,E.ActInlineContext=C,E.ActPictureContext=v,E.IfInlineContext=L,E.IfBlockContext=y,E.ElseIfBlockContext=N,E.ElseBlockContext=I,E.CommandContext=k,E.CommandLineContext=O,E.CommandAppendedContext=P,E.AddobjContext=w,E.AssignmentContext=b,E.AssignmentNumberContext=D,E.AssignmentStringContext=U,E.AssignmentoperatorContext=M,E.CommentContext=H,E.CommentAttachedContext=F,E.CopyarrContext=B,E.DelactContext=V,E.DynamicContext=W,E.GosubContext=$,E.GtContext=Q,E.XgtContext=G,E.JumpContext=K,E.JumpmarkerContext=q,E.KillvarContext=Y,E.MsgContext=z,E.MultilineBlockContext=j,E.InnerMultilineBlockContext=J,E.OpengameContext=X,E.PlayContext=Z,E.PrintContext=tt,E.PrintMainContext=et,E.PrintNewlineMainContext=nt,E.PrintNewlinepreMainContext=it,E.PrintEmptyLineMainContext=st,E.PrintSideContext=rt,E.PrintNewlineSideContext=ot,E.PrintNewlinepreSideContext=at,E.PrintEmptyLineSideContext=lt,E.SavegameContext=ht,E.SyscallContext=ut,E.SyssettingContext=ct,E.ViewContext=dt,E.WaitContext=pt,E.IdentifierContext=gt,E.IdentifierNumberContext=xt,E.IdentifierStringContext=ft,E.ArrayIndexContext=mt,E.CompareOperatorContext=Et,E.NotEqualContext=Tt,E.ValueContext=Rt,E.NumberLiteralWithOptionalSignContext=St,E.FunctionWithNumberReturnContext=_t,E.InvertContext=At,E.NumberOperatorContext=Ct,E.FunctionWithStringReturnContext=vt,E.FunctionArgumentsContext=Lt,E.EscapedStringContext=yt,E.StringAtomContext=Nt,E.StringTemplateVarContext=It,E.StringTemplateVarSuffixContext=kt,E.DoubleQuoteAtomContext=Ot,E.StringTemplateVarDQContext=Pt,E.StringDQTemplateVarSuffixContext=wt;class bt extends g{jumpCounter=0;visitActBlock(t,e=0){const n="\t".repeat(e);var i=t.value();let s=`${n}<<act ${this.visitValue(i)}>>\n`;return s+=this.visitBlock(t.block(),e+1),s+=`\n${n}<</act>>\n`,s}visitAnyValue(t){return t.value()||t.value()?this.visitValue(t.value()):void 0}visitArrayIndex(t){return t.value()?`[${this.visitValue(t.value())}]`:"[-1]"}visitAssignment(t){return t.assignmentNumber()?this.visitAssignmentNumber(t.assignmentNumber()):t.assignmentString()?this.visitAssignmentString(t.assignmentString()):void 0}visitAssignmentNumber(t){return`<<set ${this.visitIdentifierNumber(t.identifierNumber())} ${this.visitAssignmentoperator(t.assignmentoperator())} ${this.visitValue(t.value())}>>`}visitAssignmentString(t){if(t.value())return`<<set ${this.visitIdentifierString(t.identifierString())} ${this.visitAssignmentoperator(t.assignmentoperator())} ${this.visitValue(t.value())}>>`;var e=t.multilineBlock().getText().trim().slice(1,-1).replaceAll(/(\r? \n)|\n/gi,"###NL###");return`<<set ${this.visitIdentifierString(t.identifierString())} ${this.visitAssignmentoperator(t.assignmentoperator())} \`${e}\`>>`}visitAssignmentoperator(t){switch(t.getText()){case"to":case"=":return"=";case"+=":return"+=";case"-=":return"-=";case"*=":return"*=";case"/=":return"/="}}visitBlock(t,e=0){let n=[];for(let i=0;null!=t.statementLine(i);i++)n.push(this.visitStatementLine(t.statementLine(i),e));return n.length?n.join("\n"):""}visitCommand(t){if(t.actInline())return`<<act ${this.visitValue(t.actInline().value())}>>${this.visitCommand(t.actInline().command())}<</act>>`;if(t.comment())return`\x3c!-- ${t.comment().getText()} --\x3e`;if(t.ifInline())return this.visitIfInline(t.ifInline());var e="";t.ParenthesisLeft()?e=`(${this.visitCommand(t.command(0))})`:t.addobj()?e=`<<run setup.qsp_addobj(${this.visitValue(t.addobj().value())})>>`:t.assignment()?e=this.visitAssignment(t.assignment()):t.copyarr()?e=`<<run setup.qsp_copyarr(${this.visitFunctionArguments(t.copyarr().functionArguments())})>>`:t.delact()?e=`<<run setup.qsp_delact(${this.visitValue(t.delact().value())})>>`:t.dynamic()?e=this.visitDynamic(t.dynamic()):t.gosub()?e=`<<gs \`[${this.visitFunctionArguments(t.gosub().functionArguments())}]\`>>`:t.gt()?e=`<<run setup.qsp_gt(${this.visitFunctionArguments(t.gt().functionArguments())})>>`:t.xgt()?e=`<<xgt \`[${this.visitFunctionArguments(t.xgt().functionArguments())}]\`>>`:t.jump()?e=this.visitJump(t.jump()):t.jumpmarker()?e=this.visitJumpmarker(t.jumpmarker()):t.killvar()?e=this.visitKillvar(t.killvar()):t.msg()?e=this.visitMsg(t.msg()):t.play()?e=`<<run setup.qsp_play(${this.visitFunctionArguments(t.play().functionArguments())})>>`:t.print()?e=this.visitPrint(t.print()):t.savegame()?e=`<<run setup.qsp_savegame(${this.visitValue(t.savegame().value())})>>`:t.syscall()?e=this.visitSyscall(t.syscall()):t.syssetting()?e=this.visitSyssetting(t.syssetting()):t.view()?e=t.view().value()?`<<view ${this.visitValue(t.view().value())}>>`:"<<view>>":t.wait()&&(e=`<<wait ${this.visitValue(t.wait().value())}>>`);for(let n=0;null!=t.commandAppended(n);n++)e+=this.visitCommand(t.commandAppended(n).command());return e}visitCommandLine(t,e=0){const n="\t".repeat(e);if(t.command())return n+this.visitCommand(t.command())}visitCompareOperator(t){return t.EqualOperator()?"==":t.notEqual()?"!=":t.GREAT_EQUAL_THAN()?">=":t.LOWER_EQUAL_THAN()?"<=":t.getText()}visitDynamic(t){return`<<run setup.qsp_dynamic(${this.visitFunctionArguments(t.functionArguments())})>>`}visitEscapedString(t,{inPrintContext:e=!1}={}){let n="";var i=(t,e)=>t.stringAtom(e),s=(t,e)=>t.stringTemplateVarSuffix(e),r=(t,e)=>t.stringTemplateVarSuffix(e).stringTemplateVar().value(),o="'";null!=t.doubleQuoteAtom(0)||null!=t.stringDQTemplateVarSuffix(0)?(i=(t,e)=>t.doubleQuoteAtom(e),s=(t,e)=>t.stringDQTemplateVarSuffix(e),r=(t,e)=>t.stringDQTemplateVarSuffix(e).stringTemplateVarDQ().value(),o='"'):null!=t.TemplateDoubleSingleQuote(0)&&(i=(t,e)=>t.InEscapedStringAtom(e),s=(t,e)=>null,r=(t,e)=>null),null!=s(t,0)&&(e=!1);var a=t=>{if(e)switch(t){case"''":return"'";case'""':return'"'}else switch(t){case"'":case"''":case'""':return String.raw`\'`;case"\\":return"\\\\"}return t};for(let e=0;null!=i(t,e);e++)n+=a(i(t,e).getText());for(let l=0;null!=s(t,l);l++){const h=this.visitValue(r(t,l));n+=e?`<<=${h}>>`:`${o}+(${h})+${o}`;for(let e=0;null!=i(s(t,l),e);e++)n+=a(i(s(t,l),e).getText())}return e?`''>>${n}<<=''`:`${o}${n}${o}`}visitFunctionArguments(t){var e=[];for(let n=0;null!=t.value(n);n++)e.push(this.visitValue(t.value(n)));return e.join(" , ")}visitFunctionWithNumberReturn(t){return`setup.qsp_${t.WORD().getText().toLowerCase()}(${this.visitFunctionArguments(t.functionArguments())})`}visitFunctionWithStringReturn(t){return`setup.qsp_${t.WORD().getText().toLowerCase()}(${this.visitFunctionArguments(t.functionArguments())})`}visitIdentifierNumber(t){return t.arrayIndex()?`QSP.${t.WORD()}${this.visitArrayIndex(t.arrayIndex())}`:`QSP.${t.WORD()}[0]`}visitIdentifierString(t){return t.arrayIndex()?`QSP.$${t.WORD()}${this.visitArrayIndex(t.arrayIndex())}`:`QSP.$${t.WORD()}[0]`}visitIfBlock(t,e=0){const n="\t".repeat(e);var i=t.value();let s=`${n}<<if ${this.visitValue(i)}>>\n`;s+=this.visitBlock(t.block(),e+1);for(let r=0;null!=t.elseIfBlock(r);r++)i=t.elseIfBlock(r).value(),s+=`\n${n}<<elseif (${this.visitValue(i)}) != 0>>\n`,s+=this.visitBlock(t.elseIfBlock(r).block(),e+1);return t.elseBlock()&&(s+=`\n${n}<<else>>\n`,s+=this.visitBlock(t.elseBlock().block(),e+1)),s+=`\n${n}<</if>>\n`,t.commandAppended()&&(s+=this.visitCommand(t.commandAppended().command())),s}visitIfInline(t){return t.ELSE()?`<<if ${this.visitValue(t.value())}>>${this.visitCommand(t.command(0))}<<else>>${this.visitCommand(t.command(1))}<</if>>`:`<<if ${this.visitValue(t.value())}>>${this.visitCommand(t.command(0))}<</if>>`}visitJump(t){return`<<JUMP ${this.visitValue(t.value())} ${this.jumpCounter++}>>`}visitJumpmarker(t){return`<<JUMPMARKER '${t.WORD().getText()}'>>`}visitKillvar(t){return t.value(1)?`<<run setup.qsp_killvar(${this.visitValue(t.value(0))} , ${this.visitValue(t.value(1))})>>`:t.value(0)?`<<run setup.qsp_killvar(${this.visitValue(t.value(0))})>>`:"<<run setup.qsp_killvar()>>"}visitMsg(t){return`<<run setup.qsp_msg(${this.visitValue(t.value())})>>`}visitNumberLiteralWithOptionalSign(t){const e=t.NumberLiteral().getText(),n=Number(e);return t.MINUS()?`-${n}`:`${n}`}visitNumberOperator(t){switch(t.getText().trim().toUpperCase()){case"+":return"+";case"-":return"-";case"*":return"*";case"/":return"/";case"MOD":return"%";case"AND":return"AND";case"OR":return"OR"}}visitPassage(t,e=!1){var n="";e&&(n+=t.PassageIdentifier().getText().trim().toLowerCase().replace("#","::")+"\n"),n+=this.visitBlock(t.block());try{n=function(t){function e(t,e){let n=0,i=0;for(;-1!==(i=t.indexOf(e,i));)n++,i+=e.length;return n}function n(t){const e=t.match(/<<JUMPMARKER '([^']+)'>>/);return e?e[1]:null}const i=t.split("\n");t:for(let s=0;s<i.length;s++){const r=i[s],o=r.indexOf("<<JUMPMARKER");if(-1==o)continue;const a=n(r);if(!a)continue;const l=`<<JUMP '${a}'`;if(1==e(t,l))for(let t=s+1;t<i.length;t++){const e=i[t],n=e.search(/\S/);if(""==e.trim())continue;if(n<o)continue t;if(-1==e.indexOf(l))continue;let r=!1;const h=`_qspLoop_${a}_continue`,u="\t".repeat(o);if(n==o){const n=/^(<<if.*?)<<JUMP[^>]*>>(.*?<<\/if>>)$/,s=e.trim().match(n);s&&(i[t]=`${u}\t${s[1]}<<set ${h} = true>>${s[2]}\n${u}<</for>>`,r=!0)}if(n==o+1){const n=/^<<JUMP[^>]*>>$/;if(e.trim().match(n)){for(let e=t+1;e<i.length;e++){const n=i[e],s=n.search(/\S/);if(s<o)continue t;if(!(s>o)){if("<</if>>"==n.trim()){i[e]+=`\n${u}<</for>>`;for(let n=t+1;n<=e;n++)i[n]="\t"+i[n];break}i[e]+="###"}}i[t]=`${u}\t\t<<set ${h} = true>>`,r=!0}}if(r){i[s]=`${u}<<set ${h} = true>>\n${u}<<for ${h}>>\n\t${u}<<set ${h} = false>>`;for(let e=s+1;e<t;e++)i[e]="\t"+i[e]}continue t}}return i.join("\n")}(n)}catch(t){console.error(t)}return n}visitPrint(t){return t.printMain()&&t.printMain().value()?`<<=${this.visitValue(t.printMain().value(),{inPrintContext:!0})}>>`:t.printNewlineMain()?`<<=${this.visitValue(t.printNewlineMain().value(),{inPrintContext:!0})}>><br/>`:t.printNewlinepreMain()?`<br/><<=${this.visitValue(t.printNewlinepreMain().value(),{inPrintContext:!0})}>>`:t.printEmptyLineMain()?"<br/>":t.printSide()?`<<run setup.qsp_sidebar(${this.visitValue(t.printSide().value(),{inPrintContext:!0})})>>`:t.printNewlineSide()?`<<run setup.qsp_sidebar(${this.visitValue(t.printNewlineSide().value(),{inPrintContext:!0})})>><<SIDE_BR>>`:t.printNewlinepreSide()?`<<SIDE_BR>><<run setup.qsp_sidebar(${this.visitValue(t.printNewlinepreSide().value(),{inPrintContext:!0})})>>`:t.printEmptyLineSide()?"<<SIDE_BR>>":void 0}visitStatementLine(t,e=0){return t.actBlock()?this.visitActBlock(t.actBlock(),e):t.commandLine()?this.visitCommandLine(t.commandLine(),e):t.ifBlock()?this.visitIfBlock(t.ifBlock(),e):void 0}visitSyscall(t){return`<<${t.getText().replace("*","STAR_").toUpperCase()}>>`}visitSyssetting(t){return`<<${t.SYSSETTING().getText().toUpperCase()} ${this.visitValue(t.value())}>>`}visitValue(t,{inPrintContext:e=!1}={}){if(t.ParenthesisLeft())return`(${this.visitValue(t.value(0))})`;if(t.numberLiteralWithOptionalSign())return this.visitNumberLiteralWithOptionalSign(t.numberLiteralWithOptionalSign());if(t.identifierNumber())return this.visitIdentifierNumber(t.identifierNumber());if(t.INPUT())return`setup.qsp_input(${this.visitValue(t.value(0))})`;if(t.invert())return`setup.logic_not(${this.visitValue(t.value(0))})`;if(t.functionWithNumberReturn())return this.visitFunctionWithNumberReturn(t.functionWithNumberReturn());if(t.compareOperator())return`${this.visitValue(t.value(0))} ${this.visitCompareOperator(t.compareOperator())} ${this.visitValue(t.value(1))}`;if(t.numberOperator()){const e=this.visitValue(t.value(0)),n=this.visitValue(t.value(1)),i=this.visitNumberOperator(t.numberOperator(0));return"/"==i?`Math.floor(${e} ${i} ${n})`:"AND"==i?`${e} && ${n}`:"OR"==i?`${e} || ${n}`:`${e} ${i} ${n}`}return t.escapedString()?this.visitEscapedString(t.escapedString(),{inPrintContext:e}):t.identifierString()?this.visitIdentifierString(t.identifierString()):t.functionWithStringReturn()?this.visitFunctionWithStringReturn(t.functionWithStringReturn()):t.multilineBlock()?"`"+t.multilineBlock().getText().trim().slice(1,-1).replaceAll(/(\r? \n)|\n/gi,"###NL###").replace(/(\r\n|\n|\r)/gm,"")+"`":t.MINUS()?`-${this.visitValue(t.value(0))}`:void 0}}class Dt extends p{visitErrorNode(t){throw new Error(t.getText())}}function Ut(t){let e=function(t,e=!1){e?t+="\n":t="# SINGLELINECOMMAND\n"+t+"\n--- SINGLELINECOMMAND ---------------------------------\n";const n=new l.InputStream(t),i=new d(n),s=new l.CommonTokenStream(i),r=new E(s).passage(),o=new Dt;return l.tree.ParseTreeWalker.DEFAULT.walk(o,r),(new bt).visitPassage(r,e)}(t,!0);var n,i;e=e.replaceAll("<<=''>>","");const s=/<<='(?:<center>)?<img (?:'\+\(QSP\.\$set_imgh\[0\]\)\+' )?src="([\w\s/]+\.jpg)">(?:<\/center>)?'>>/gi;for(i=e;n=s.exec(e);){let t=n[1];t.startsWith("images/")&&t.length>7&&(t=t.substring(7)),i=i.replace(n[0],`<<image '${t}'>>`)}e=i;const r=/(\s)<center>(?:<[^>]+>)*<font[^>]*color[^>]*maroon[^>]*>([^<]+)<\/font>(?:<[^>]+>)*<\/center>/gi;for(i=e;n=r.exec(e);)i=i.replace(n[0],`${n[1]}<h2>${n[2]}</h2>`);return e=i,e}function Mt(t,e,n){const i=t.substring(e,n);let s={_defaults:[]},r=[];const o=/\$?npc_(\w*)\['A<<npctemp>>'\]\s*=\s*(.*)/g;let a;for(;a=o.exec(i);){let t=a[1],e=a[2];const n=Number(e);if(Number.isInteger(n))e=n;else{if(!(e.length>1&&e.startsWith("'")&&e.endsWith("'"))){r.push(a[0]);continue}if(e=e.substring(1,e.length-1).replaceAll("''","'"),-1!=e.indexOf("<<")){r.push(a[0]);continue}}s[t]=e}const l=/gs\s+'npcstaticdefaults'\s*,\s*'(.+)'/g;for(;a=l.exec(i);)s._defaults.push(a[1].replaceAll("'","").replaceAll(" ","").replaceAll(",","_"));return[JSON.stringify(s),r.join("\n")]}function Ht(t,e){return Object.fromEntries(Object.entries(t).map((([t,n])=>t.startsWith(e)&&t.length>e.length?[t.substring(e.length),n]:[t,n])))}const Ft=n(e.readFileSync(__filename,{encoding:"utf8"}));t.parentPort.on("message",(s=>{t.parentPort.postMessage(function(t){t.VERSION;const s=t.filePath,r=t.outPath,o=t.generatedFilesPrefix,a=t.options;try{const t=e.readFileSync(s,{encoding:"utf8"}),c=(new Date).getTime(),d=s.split("\\").pop().split("/").pop(),p=i.join(r,o,d.split(".")[0]+".tw"),g=i.join(r,o,d.split(".")[0]+".ts"),x=t.split("\n")?.[1];if(x.startsWith("!! SKIP_QSRC2TW"))return e.existsSync(p)&&e.unlink(p,(t=>{if(t)throw t})),e.existsSync(g)&&e.unlink(g,(t=>{if(t)throw t})),[0,"SKIP"];const f=n(t);if(e.existsSync(p))try{const t=e.readFileSync(p,"utf-8").split("\n")[1].match(/<!--\s*qsrc2twResult=({.*})\s*-->/);if(t){const e=JSON.parse(t[1]);if(e.code&&f==e.code&&e.version&&Ft==e.version)return[0,"EXISTS"]}}catch(t){}var l="default",h={};const m=/\s*!!\s*QSRC2TW_module\s+(\w+)(\s+{[^}]+})?/;let E;try{(E=m.exec(x))&&(l=E[1],E[2]&&(h=JSON.parse(E[2])))}catch(t){console.log(t.toString())}var u=(t,e)=>[null,null];switch(l){case"default":u=(t,e)=>[Ut(t),null];break;case"npcInit":u=(t,e)=>function(t){let e=t.split("\n")[0],n=e.replace("#","::")+`\n<<run console.warn("Use of npcInit-passages is deprecated (${e})")>>`,i="setup.npcStatic ??= {};\n",s=[];const r=/npctemp\s*=\s*(\d+)/dg;let o,a=0,l=0,h="";for(;o=r.exec(t);){const e=o[1];s.push("A"+e);let n=o.indices[0][1],r=o.indices[0][0];if(a){const[e,n]=Mt(t,a,r);i+=`setup.npcStatic['A${l}'] = ${e}\n\n`,h+=n+"\n"}l=e,a=n}let u=t.length;const[c,d]=Mt(t,a,u);return i+=`setup.npcStatic['A${l}'] = ${c}\n\n`,h+=d,[n,i]}(t);break;case"stat_sklattrib_lvlset":u=(t,e)=>function(t){let e=t.split("\n")[0],n=e.replace("#","::")+`\n<<run console.warn("Use of skillDefinitions-passages is deprecated (${e})")>>`,i="setup.skills ??= {};\n";const s=/\$att_name\[(\d+)\] = '(\w+)'/dg,r=[];let o;for(;o=s.exec(t);)r[Number(o[1])]=o[2];const a=/(\w+)\[1\]\s*=\s*(\d)(?:\s*&\s*\1\[\d+\]\s*=\s*(\d+))*/dg;for(;o=a.exec(t);){const t=o[1],e=o[0].split("&").map((t=>r[Number(t.split("=")[1].trim())]));i+=`setup.skills['${t}'] = {attributes:${JSON.stringify(e)}}\n`}i+="setup.proficiencies ??= {};\n";const l=/^\s*pcs_(\w+)\s*=\s*([^&^\n]*)([^\n]*)\s*$/gm,h=/(?:pcs_(\w+))|(?:(\w+)_lvl)|([a-z]\w*)/dg;for(;o=l.exec(t);){const t=o[1];if(-1!=r.indexOf(t))continue;const e=o[2];let n,s=e;for(;n=h.exec(e);){const t=n[1]??n[2];s=-1!=r.indexOf(t)?s.replace(n[0],`attributes['${t}'].level`):n[3]?s.replace(n[3],"0"):s.replace(n[0],`skills['${t}'].level`)}i+=`setup.proficiencies['${t}'] = {calc:(attributes,skills)=>${s}}\n`}return[n,i]}(t);break;case"wardrobeItems":u=(t,e)=>function(t,e){let n=t.split("\n")[0],i=n.replace("#","::")+"\n";const s=n.trim().replace("# $attributes_","");let r="setup.wardrobeStatic ??= {};\n";const o=/^\s*(\w+)\s*=\s*(\d+)\s*$/gm,a=/^\s*\$(\w+)\s*=\s*('|")(.*?)\2\s*$/gm,l=function(t,e,n){let i,s,r,o=[];for(;i=e.exec(t);){let e=i.indices[0][1],a=i.indices[0][0];if(s){const e=t.substring(s,a);o.push(n(r,e))}r=i,s=e}let a=t.length;const l=t.substring(s,a);return o.push(n(r,l)),o}(t,/(?:else)?if\s+args\[1\]\s*=\s*(\d+):/dgim,((t,n)=>{const i=`${s}_${t[1]}`;let r,l={};for(;r=o.exec(n);)l[r[1]]=Number(r[2]);for(;r=a.exec(n);)l[r[1]]=r[3];return l.CloQuality?l=Object.assign({type:"clothes"},Ht(l,"Clo")):l.ShoQuality?l=Object.assign({type:"shoes"},Ht(l,"Sho")):l.BraQuality?l=Object.assign({type:"bra"},Ht(l,"Bra")):l.PanQuality?l=Object.assign({type:"bra"},Ht(l,"Pan")):l.CoatQuality&&(l=Object.assign({type:"coat"},Ht(l,"Coat"))),e.shop&&(l.shop=e.shop),`setup.wardrobeStatic['${i}'] = ${JSON.stringify(l)}\n`}));return r+=l.join(""),[i,r]}(t,e);break;case"wardrobeItemsTypes":u=(t,e)=>function(t,e){const n=Ut(t);let i="setup.wardrobeItemVars ??= {};\n";const s={bras:/if (\w+)S\[i\] = metka_bras and \1\[i\] = 1:/gm,clothes:/if (\w+)\[i\] = 1 and \(\$clothingworntype ! '\1' or clothingwornnumber ! i\):/gm,coats:/if (\w+)_s\[i\] = coat_loc and \1\[i\] = 1:/gm,panties:/if (\w+)S\[i\] = metka_panties and \1\[i\] = 1:/gm,shoes:/if (\w+)_s\[i\] = sloc and \1\[i\] = 1:/gm};let r;for(const[e,n]of Object.entries(s)){let s=0;for(;r=n.exec(t);)0==s++&&(i+=`setup.wardrobeItemVars['${e}'] ??= [];\n`),i+=`setup.wardrobeItemVars['${e}'].push('${r[1]}');\n`}return[n,i]}(t);break;default:console.warn("Unreckognized Convert Mode")}try{let n,i,s="";const r=console;a.verboseErrors||(console={log:(...t)=>{},debug:(...t)=>{},warn:(...t)=>{},error:(...t)=>{}});try{[n,i]=u(t,h)}catch(t){throw t}finally{console=r}if(!n)return console.error("Twine Code must be generated by every convertMode"),[2,"Invalid convertFunction"];s=n.split("\n").toSpliced(1,0,`\x3c!--qsrc2twResult={"version":"${Ft}","code":"${f}","time":"${(new Date).toISOString()}"}--\x3e`).join("\n"),e.writeFile(p,s,(t=>{t&&console.error(t)})),i?e.writeFile(g,i,(t=>{t&&console.error(t)})):e.existsSync(g)&&e.unlink(g,(t=>{if(t)throw t}));const o=(new Date).getTime()-c;return console.log(`${d.padEnd(30,".")} ${o} ms`),[0,"SUCCESS"]}catch(t){return[1,`Error in "${d}". No output was generated`,t]}}catch(t){return[1,`Critical Error in "${s}". No output was generated`,t]}}(s))}))})();