text: !function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:r})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=32)}([function(t,e){function n(t){return"["+t.join(", ")+"]"}function r(t,e){return t.equals(e)}function i(t){return t.hashCode()}function o(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function s(){return this.data=[],this}function a(t,e){return this.data={},this.hashFunction=t||i,this.equalsFunction=e||r,this}function l(){return this.data={},this}function u(){return this}function c(){return this.count=0,this.hash=0,this}String.prototype.seed=String.prototype.seed||Math.round(Math.random()*Math.pow(2,32)),String.prototype.hashCode=function(){var t,e,n,r,i,o,s,a,l=this.toString();for(t=3&l.length,e=l.length-t,n=String.prototype.seed,i=3432918353,o=461845907,a=0;a<e;)s=255&l.charCodeAt(a)|(255&l.charCodeAt(++a))<<8|(255&l.charCodeAt(++a))<<16|(255&l.charCodeAt(++a))<<24,++a,n=27492+(65535&(r=5*(65535&(n=(n^=s=(65535&(s=(s=(65535&s)*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(r>>>16)&65535)<<16);switch(s=0,t){case 3:s^=(255&l.charCodeAt(a+2))<<16;case 2:s^=(255&l.charCodeAt(a+1))<<8;case 1:n^=s=(65535&(s=(s=(65535&(s^=255&l.charCodeAt(a)))*i+(((s>>>16)*i&65535)<<16)&4294967295)<<15|s>>>17))*o+(((s>>>16)*o&65535)<<16)&4294967295}return n^=l.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),o.prototype.add=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data){for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return n.push(t),t}return this.data[e]=[t],t},o.prototype.contains=function(t){return null!=this.get(t)},o.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++)if(this.equalsFunction(t,n[r]))return n[r];return null},o.prototype.values=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},o.prototype.toString=function(){return n(this.values())},s.prototype.add=function(t){this.data[t]=!0},s.prototype.or=function(t){var e=this;Object.keys(t.data).map(function(t){e.add(t)})},s.prototype.remove=function(t){delete this.data[t]},s.prototype.contains=function(t){return!0===this.data[t]},s.prototype.values=function(){return Object.keys(this.data)},s.prototype.minValue=function(){return Math.min.apply(null,this.values())},s.prototype.hashCode=function(){var t=new c;return t.update(this.values()),t.finish()},s.prototype.equals=function(t){return t instanceof s&&this.hashCode()===t.hashCode()},Object.defineProperty(s.prototype,"length",{get:function(){return this.values().length}}),s.prototype.toString=function(){return"{"+this.values().join(", ")+"}"},Object.defineProperty(a.prototype,"length",{get:function(){var t=0;for(var e in this.data)0===e.indexOf("hash_")&&(t+=this.data[e].length);return t}}),a.prototype.put=function(t,e){var n="hash_"+this.hashFunction(t);if(n in this.data){for(var r=this.data[n],i=0;i<r.length;i++){var o=r[i];if(this.equalsFunction(t,o.key)){var s=o.value;return o.value=e,s}}return r.push({key:t,value:e}),e}return this.data[n]=[{key:t,value:e}],e},a.prototype.containsKey=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return!0}return!1},a.prototype.get=function(t){var e="hash_"+this.hashFunction(t);if(e in this.data)for(var n=this.data[e],r=0;r<n.length;r++){var i=n[r];if(this.equalsFunction(t,i.key))return i.value}return null},a.prototype.entries=function(){var t=[];for(var e in this.data)0===e.indexOf("hash_")&&(t=t.concat(this.data[e]));return t},a.prototype.getKeys=function(){return this.entries().map(function(t){return t.key})},a.prototype.getValues=function(){return this.entries().map(function(t){return t.value})},a.prototype.toString=function(){return"["+this.entries().map(function(t){return"{"+t.key+":"+t.value+"}"}).join(", ")+"]"},l.prototype.get=function(t){return(t="k-"+t)in this.data?this.data[t]:null},l.prototype.put=function(t,e){t="k-"+t,this.data[t]=e},l.prototype.values=function(){var t=this.data;return Object.keys(this.data).map(function(e){return t[e]})},c.prototype.update=function(){for(var t=0;t<arguments.length;t++){var e=arguments[t];if(null!=e)if(Array.isArray(e))this.update.apply(e);else{var n=0;switch(typeof e){case"undefined":case"function":continue;case"number":case"boolean":n=e;break;case"string":n=e.hashCode();break;default:e.updateHashCode(this);continue}n=(n*=3432918353)<<15|n>>>17,n*=461845907,this.count=this.count+1;var r=this.hash^n;r=5*(r=r<<13|r>>>19)+3864292196,this.hash=r}}},c.prototype.finish=function(){var t=this.hash^4*this.count;return t^=t>>>16,t*=2246822507,t^=t>>>13,t*=3266489909,t^=t>>>16},u.prototype.get=function(t,e){var n=this[t]||null;return null===n?null:n[e]||null},u.prototype.set=function(t,e,n){var r=this[t]||null;null===r&&(r={},this[t]=r),r[e]=n},e.Hash=c,e.Set=o,e.Map=a,e.BitSet=s,e.AltDict=l,e.DoubleDict=u,e.hashStuff=function(){var t=new c;return t.update.apply(arguments),t.finish()},e.escapeWhitespace=function(t,e){return t=(t=(t=t.replace("\t","\\t")).replace("\n","\\n")).replace("\r","\\r"),e&&(t=t.replace(" ","·")),t},e.arrayToString=n,e.titleCase=function(t){return t.replace(/\w\S*/g,function(t){return t.charAt(0).toUpperCase()+t.substr(1)})},e.equalArrays=function(t,e){if(!Array.isArray(t)||!Array.isArray(e))return!1;if(t==e)return!0;if(t.length!=e.length)return!1;for(var n=0;n<t.length;n++)if(t[n]!=e[n]&&!t[n].equals(e[n]))return!1;return!0}},function(t,e){function n(){return 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,this}function r(t,e,i,o,s){return n.call(this),this.source=void 0!==t?t:r.EMPTY_SOURCE,this.type=void 0!==e?e:null,this.channel=void 0!==i?i:n.DEFAULT_CHANNEL,this.start=void 0!==o?o:-1,this.stop=void 0!==s?s:-1,this.tokenIndex=-1,null!==this.source[0]?(this.line=t[0].line,this.column=t[0].column):this.column=-1,this}n.INVALID_TYPE=0,n.EPSILON=-2,n.MIN_USER_TOKEN_TYPE=1,n.EOF=-1,n.DEFAULT_CHANNEL=0,n.HIDDEN_CHANNEL=1,Object.defineProperty(n.prototype,"text",{get:function(){return this._text},set:function(t){this._text=t}}),n.prototype.getTokenSource=function(){return this.source[0]},n.prototype.getInputStream=function(){return this.source[1]},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.EMPTY_SOURCE=[null,null],r.prototype.clone=function(){var t=new r(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},Object.defineProperty(r.prototype,"text",{get:function(){if(null!==this._text)return this._text;var t=this.getInputStream();if(null===t)return null;var e=t.size;return this.start<e&&this.stop<e?t.getText(this.start,this.stop):"<EOF>"},set:function(t){this._text=t}}),r.prototype.toString=function(){var 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+"]"},e.Token=n,e.CommonToken=r},function(t,e,n){var r=n(1).Token;function i(t,e){return this.start=t,this.stop=e,this}function o(){this.intervals=null,this.readOnly=!1}i.prototype.contains=function(t){return t>=this.start&&t<this.stop},i.prototype.toString=function(){return this.start===this.stop-1?this.start.toString():this.start.toString()+".."+(this.stop-1).toString()},Object.defineProperty(i.prototype,"length",{get:function(){return this.stop-this.start}}),o.prototype.first=function(t){return null===this.intervals||0===this.intervals.length?r.INVALID_TYPE:this.intervals[0].start},o.prototype.addOne=function(t){this.addInterval(new i(t,t+1))},o.prototype.addRange=function(t,e){this.addInterval(new i(t,e+1))},o.prototype.addInterval=function(t){if(null===this.intervals)this.intervals=[],this.intervals.push(t);else{for(var e=0;e<this.intervals.length;e++){var 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].start=t.start);if(t.start<=n.stop)return this.intervals[e]=new i(Math.min(n.start,t.start),Math.max(n.stop,t.stop)),void this.reduce(e)}this.intervals.push(t)}},o.prototype.addSet=function(t){if(null!==t.intervals)for(var e=0;e<t.intervals.length;e++){var n=t.intervals[e];this.addInterval(new i(n.start,n.stop))}return this},o.prototype.reduce=function(t){if(t<this.intervalslength-1){var e=this.intervals[t],n=this.intervals[t+1];e.stop>=n.stop?(this.intervals.pop(t+1),this.reduce(t)):e.stop>=n.start&&(this.intervals[t]=new i(e.start,n.stop),this.intervals.pop(t+1))}},o.prototype.complement=function(t,e){var n=new o;n.addInterval(new i(t,e+1));for(var r=0;r<this.intervals.length;r++)n.removeRange(this.intervals[r]);return n},o.prototype.contains=function(t){if(null===this.intervals)return!1;for(var e=0;e<this.intervals.length;e++)if(this.intervals[e].contains(t))return!0;return!1},Object.defineProperty(o.prototype,"length",{get:function(){var t=0;return this.intervals.map(function(e){t+=e.length}),t}}),o.prototype.removeRange=function(t){if(t.start===t.stop-1)this.removeOne(t.start);else if(null!==this.intervals)for(var e=0,n=0;n<this.intervals.length;n++){var r=this.intervals[e];if(t.stop<=r.start)return;if(t.start>r.start&&t.stop<r.stop){this.intervals[e]=new i(r.start,t.start);var o=new i(t.stop,r.stop);return void this.intervals.splice(e,0,o)}t.start<=r.start&&t.stop>=r.stop?(this.intervals.splice(e,1),e-=1):t.start<r.stop?this.intervals[e]=new i(r.start,t.start):t.stop<r.stop&&(this.intervals[e]=new i(t.stop,r.stop)),e+=1}},o.prototype.removeOne=function(t){if(null!==this.intervals)for(var e=0;e<this.intervals.length;e++){var 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 i(n.start+1,n.stop));if(t===n.stop-1)return void(this.intervals[e]=new i(n.start,n.stop-1));if(t<n.stop-1){var r=new i(n.start,t);return n.start=t+1,void this.intervals.splice(e,0,r)}}},o.prototype.toString=function(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()},o.prototype.toCharString=function(){for(var t=[],e=0;e<this.intervals.length;e++){var n=this.intervals[e];n.stop===n.start+1?n.start===r.EOF?t.push("<EOF>"):t.push("'"+String.fromCharCode(n.start)+"'"):t.push("'"+String.fromCharCode(n.start)+"'..'"+String.fromCharCode(n.stop-1)+"'")}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toIndexString=function(){for(var t=[],e=0;e<this.intervals.length;e++){var n=this.intervals[e];n.stop===n.start+1?n.start===r.EOF?t.push("<EOF>"):t.push(n.start.toString()):t.push(n.start.toString()+".."+(n.stop-1).toString())}return t.length>1?"{"+t.join(", ")+"}":t[0]},o.prototype.toTokenString=function(t,e){for(var n=[],r=0;r<this.intervals.length;r++)for(var i=this.intervals[r],o=i.start;o<i.stop;o++)n.push(this.elementName(t,e,o));return n.length>1?"{"+n.join(", ")+"}":n[0]},o.prototype.elementName=function(t,e,n){return n===r.EOF?"<EOF>":n===r.EPSILON?"<EPSILON>":t[n]||e[n]},e.Interval=i,e.IntervalSet=o},function(t,e){function n(){return this.atn=null,this.stateNumber=n.INVALID_STATE_NUMBER,this.stateType=null,this.ruleIndex=0,this.epsilonOnlyTransitions=!1,this.transitions=[],this.nextTokenWithinRule=null,this}function r(){return n.call(this),this.stateType=n.BASIC,this}function i(){return n.call(this),this.decision=-1,this.nonGreedy=!1,this}function o(){return i.call(this),this.endState=null,this}function s(){return o.call(this),this.stateType=n.BLOCK_START,this}function a(){return n.call(this),this.stateType=n.BLOCK_END,this.startState=null,this}function l(){return n.call(this),this.stateType=n.RULE_STOP,this}function u(){return n.call(this),this.stateType=n.RULE_START,this.stopState=null,this.isPrecedenceRule=!1,this}function c(){return i.call(this),this.stateType=n.PLUS_LOOP_BACK,this}function h(){return o.call(this),this.stateType=n.PLUS_BLOCK_START,this.loopBackState=null,this}function p(){return o.call(this),this.stateType=n.STAR_BLOCK_START,this}function f(){return n.call(this),this.stateType=n.STAR_LOOP_BACK,this}function d(){return i.call(this),this.stateType=n.STAR_LOOP_ENTRY,this.loopBackState=null,this.isPrecedenceDecision=null,this}function y(){return n.call(this),this.stateType=n.LOOP_END,this.loopBackState=null,this}function g(){return i.call(this),this.stateType=n.TOKEN_START,this}n.INVALID_TYPE=0,n.BASIC=1,n.RULE_START=2,n.BLOCK_START=3,n.PLUS_BLOCK_START=4,n.STAR_BLOCK_START=5,n.TOKEN_START=6,n.RULE_STOP=7,n.BLOCK_END=8,n.STAR_LOOP_BACK=9,n.STAR_LOOP_ENTRY=10,n.PLUS_LOOP_BACK=11,n.LOOP_END=12,n.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"],n.INVALID_STATE_NUMBER=-1,n.prototype.toString=function(){return this.stateNumber},n.prototype.equals=function(t){return t instanceof n&&this.stateNumber===t.stateNumber},n.prototype.isNonGreedyExitState=function(){return!1},n.prototype.addTransition=function(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)},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,i.prototype=Object.create(n.prototype),i.prototype.constructor=i,o.prototype=Object.create(i.prototype),o.prototype.constructor=o,s.prototype=Object.create(o.prototype),s.prototype.constructor=s,a.prototype=Object.create(n.prototype),a.prototype.constructor=a,l.prototype=Object.create(n.prototype),l.prototype.constructor=l,u.prototype=Object.create(n.prototype),u.prototype.constructor=u,c.prototype=Object.create(i.prototype),c.prototype.constructor=c,h.prototype=Object.create(o.prototype),h.prototype.constructor=h,p.prototype=Object.create(o.prototype),p.prototype.constructor=p,f.prototype=Object.create(n.prototype),f.prototype.constructor=f,d.prototype=Object.create(i.prototype),d.prototype.constructor=d,y.prototype=Object.create(n.prototype),y.prototype.constructor=y,g.prototype=Object.create(i.prototype),g.prototype.constructor=g,e.ATNState=n,e.BasicState=r,e.DecisionState=i,e.BlockStartState=o,e.BlockEndState=a,e.LoopEndState=y,e.RuleStartState=u,e.RuleStopState=l,e.TokensStartState=g,e.PlusLoopbackState=c,e.StarLoopbackState=f,e.StarLoopEntryState=d,e.PlusBlockStartState=h,e.StarBlockStartState=p,e.BasicBlockStartState=s},function(t,e,n){var r=n(1).Token,i=n(2).Interval,o=new i(-1,-2);n(0);function s(){return this}function a(){return s.call(this),this}function l(){return a.call(this),this}function u(){return l.call(this),this}function c(){return l.call(this),this}function h(){return c.call(this),this}function p(){return this}function f(){return this}function d(t){return c.call(this),this.parentCtx=null,this.symbol=t,this}function y(t){return d.call(this,t),this}function g(){return this}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,l.prototype=Object.create(a.prototype),l.prototype.constructor=l,u.prototype=Object.create(l.prototype),u.prototype.constructor=u,c.prototype=Object.create(l.prototype),c.prototype.constructor=c,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,p.prototype.visit=function(t){return Array.isArray(t)?t.map(function(t){return t.accept(this)},this):t.accept(this)},p.prototype.visitChildren=function(t){return this.visit(t.children)},p.prototype.visitTerminal=function(t){},p.prototype.visitErrorNode=function(t){},f.prototype.visitTerminal=function(t){},f.prototype.visitErrorNode=function(t){},f.prototype.enterEveryRule=function(t){},f.prototype.exitEveryRule=function(t){},d.prototype=Object.create(c.prototype),d.prototype.constructor=d,d.prototype.getChild=function(t){return null},d.prototype.getSymbol=function(){return this.symbol},d.prototype.getParent=function(){return this.parentCtx},d.prototype.getPayload=function(){return this.symbol},d.prototype.getSourceInterval=function(){if(null===this.symbol)return o;var t=this.symbol.tokenIndex;return new i(t,t)},d.prototype.getChildCount=function(){return 0},d.prototype.accept=function(t){return t.visitTerminal(this)},d.prototype.getText=function(){return this.symbol.text},d.prototype.toString=function(){return this.symbol.type===r.EOF?"<EOF>":this.symbol.text},y.prototype=Object.create(d.prototype),y.prototype.constructor=y,y.prototype.isErrorNode=function(){return!0},y.prototype.accept=function(t){return t.visitErrorNode(this)},g.prototype.walk=function(t,e){if(e instanceof h||void 0!==e.isErrorNode&&e.isErrorNode())t.visitErrorNode(e);else if(e instanceof c)t.visitTerminal(e);else{this.enterRule(t,e);for(var n=0;n<e.getChildCount();n++){var r=e.getChild(n);this.walk(t,r)}this.exitRule(t,e)}},g.prototype.enterRule=function(t,e){var n=e.getRuleContext();t.enterEveryRule(n),n.enterRule(t)},g.prototype.exitRule=function(t,e){var n=e.getRuleContext();n.exitRule(t),t.exitEveryRule(n)},g.DEFAULT=new g,e.RuleNode=u,e.ErrorNode=h,e.TerminalNode=c,e.ErrorNodeImpl=y,e.TerminalNodeImpl=d,e.ParseTreeListener=f,e.ParseTreeVisitor=p,e.ParseTreeWalker=g,e.INVALID_INTERVAL=o},function(t,e,n){var r=n(8).PredicateTransition;function i(t){if(Error.call(this),Error.captureStackTrace)Error.captureStackTrace(this,i);else(new Error).stack;return 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),this}function o(t,e,n,r){return i.call(this,{message:"",recognizer:t,input:e,ctx:null}),this.startIndex=n,this.deadEndConfigs=r,this}function s(t,e,n,r,o,s){s=s||t._ctx,r=r||t.getCurrentToken(),n=n||t.getCurrentToken(),e=e||t.getInputStream(),i.call(this,{message:"",recognizer:t,input:e,ctx:s}),this.deadEndConfigs=o,this.startToken=n,this.offendingToken=r}function a(t){i.call(this,{message:"",recognizer:t,input:t.getInputStream(),ctx:t._ctx}),this.offendingToken=t.getCurrentToken()}function l(t,e,n){i.call(this,{message:this.formatMessage(e,n||null),recognizer:t,input:t.getInputStream(),ctx:t._ctx});var o=t._interp.atn.states[t.state].transitions[0];return o instanceof r?(this.ruleIndex=o.ruleIndex,this.predicateIndex=o.predIndex):(this.ruleIndex=0,this.predicateIndex=0),this.predicate=e,this.offendingToken=t.getCurrentToken(),this}function u(){return Error.call(this),Error.captureStackTrace(this,u),this}i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i.prototype.getExpectedTokens=function(){return null!==this.recognizer?this.recognizer.atn.getExpectedTokens(this.offendingState,this.ctx):null},i.prototype.toString=function(){return this.message},o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.toString=function(){var t="";return this.startIndex>=0&&this.startIndex<this.input.size&&(t=this.input.getText((this.startIndex,this.startIndex))),"LexerNoViableAltException"+t},s.prototype=Object.create(i.prototype),s.prototype.constructor=s,a.prototype=Object.create(i.prototype),a.prototype.constructor=a,l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.prototype.formatMessage=function(t,e){return null!==e?e:"failed predicate: {"+t+"}?"},u.prototype=Object.create(Error.prototype),u.prototype.constructor=u,e.RecognitionException=i,e.NoViableAltException=s,e.LexerNoViableAltException=o,e.InputMismatchException=a,e.FailedPredicateException=l,e.ParseCancellationException=u},function(t,e,n){var r=n(14).RuleContext,i=n(0).Hash;function o(t){this.cachedHashCode=t}function s(){return this.cache={},this}function a(t,e){var n=0;if(null!==t){var r=new i;r.update(t,e),n=r.finish()}o.call(this,n),this.parentCtx=t,this.returnState=e}function l(){return a.call(this,null,o.EMPTY_RETURN_STATE),this}function u(t,e){var n=new i;n.update(t,e);var r=n.finish();return o.call(this,r),this.parents=t,this.returnStates=e,this}function c(t,e,n,r){if(t===e)return t;if(t instanceof a&&e instanceof a)return function(t,e,n,r){if(null!==r){var i=r.get(t,e);if(null!==i)return i;if(null!==(i=r.get(e,t)))return i}var s=function(t,e,n){if(n){if(t===o.EMPTY)return o.EMPTY;if(e===o.EMPTY)return o.EMPTY}else{if(t===o.EMPTY&&e===o.EMPTY)return o.EMPTY;if(t===o.EMPTY){var r=[e.returnState,o.EMPTY_RETURN_STATE],i=[e.parentCtx,null];return new u(i,r)}if(e===o.EMPTY){var r=[t.returnState,o.EMPTY_RETURN_STATE],i=[t.parentCtx,null];return new u(i,r)}}return null}(t,e,n);if(null!==s)return null!==r&&r.set(t,e,s),s;if(t.returnState===e.returnState){var l=c(t.parentCtx,e.parentCtx,n,r);if(l===t.parentCtx)return t;if(l===e.parentCtx)return e;var h=a.create(l,t.returnState);return null!==r&&r.set(t,e,h),h}var p=null;if((t===e||null!==t.parentCtx&&t.parentCtx===e.parentCtx)&&(p=t.parentCtx),null!==p){var f=[t.returnState,e.returnState];t.returnState>e.returnState&&(f[0]=e.returnState,f[1]=t.returnState);var d=[p,p],y=new u(d,f);return null!==r&&r.set(t,e,y),y}var f=[t.returnState,e.returnState],d=[t.parentCtx,e.parentCtx];t.returnState>e.returnState&&(f[0]=e.returnState,f[1]=t.returnState,d=[e.parentCtx,t.parentCtx]);var g=new u(d,f);return null!==r&&r.set(t,e,g),g}(t,e,n,r);if(n){if(t instanceof l)return t;if(e instanceof l)return e}return t instanceof a&&(t=new u([t.getParent()],[t.returnState])),e instanceof a&&(e=new u([e.getParent()],[e.returnState])),function(t,e,n,r){if(null!==r){var i=r.get(t,e);if(null!==i)return i;if(null!==(i=r.get(e,t)))return i}var s=0,l=0,h=0,p=[],f=[];for(;s<t.returnStates.length&&l<e.returnStates.length;){var d=t.parents[s],y=e.parents[l];if(t.returnStates[s]===e.returnStates[l]){var g=t.returnStates[s],x=g===o.EMPTY_RETURN_STATE&&null===d&&null===y,v=null!==d&&null!==y&&d===y;if(x||v)f[h]=d,p[h]=g;else{var m=c(d,y,n,r);f[h]=m,p[h]=g}s+=1,l+=1}else t.returnStates[s]<e.returnStates[l]?(f[h]=d,p[h]=t.returnStates[s],s+=1):(f[h]=y,p[h]=e.returnStates[l],l+=1);h+=1}if(s<t.returnStates.length)for(var _=s;_<t.returnStates.length;_++)f[h]=t.parents[_],p[h]=t.returnStates[_],h+=1;else for(var _=l;_<e.returnStates.length;_++)f[h]=e.parents[_],p[h]=e.returnStates[_],h+=1;if(h<f.length){if(1===h){var T=a.create(f[0],p[0]);return null!==r&&r.set(t,e,T),T}f=f.slice(0,h),p=p.slice(0,h)}var S=new u(f,p);if(S===t)return null!==r&&r.set(t,e,t),t;if(S===e)return null!==r&&r.set(t,e,e),e;(function(t){for(var e={},n=0;n<t.length;n++){var r=t[n];r in e||(e[r]=r)}for(var i=0;i<t.length;i++)t[i]=e[t[i]]})(f),null!==r&&r.set(t,e,S);return S}(t,e,n,r)}o.EMPTY=null,o.EMPTY_RETURN_STATE=2147483647,o.globalNodeCount=1,o.id=o.globalNodeCount,o.prototype.isEmpty=function(){return this===o.EMPTY},o.prototype.hasEmptyPath=function(){return this.getReturnState(this.length-1)===o.EMPTY_RETURN_STATE},o.prototype.hashCode=function(){return this.cachedHashCode},o.prototype.updateHashCode=function(t){t.update(this.cachedHashCode)},s.prototype.add=function(t){if(t===o.EMPTY)return o.EMPTY;var e=this.cache[t]||null;return null!==e?e:(this.cache[t]=t,t)},s.prototype.get=function(t){return this.cache[t]||null},Object.defineProperty(s.prototype,"length",{get:function(){return this.cache.length}}),a.prototype=Object.create(o.prototype),a.prototype.contructor=a,a.create=function(t,e){return e===o.EMPTY_RETURN_STATE&&null===t?o.EMPTY:new a(t,e)},Object.defineProperty(a.prototype,"length",{get:function(){return 1}}),a.prototype.getParent=function(t){return this.parentCtx},a.prototype.getReturnState=function(t){return this.returnState},a.prototype.equals=function(t){return this===t||t instanceof a&&(this.hashCode()===t.hashCode()&&(this.returnState===t.returnState&&(null==this.parentCtx?null==t.parentCtx:this.parentCtx.equals(t.parentCtx))))},a.prototype.toString=function(){var t=null===this.parentCtx?"":this.parentCtx.toString();return 0===t.length?this.returnState===o.EMPTY_RETURN_STATE?"$":""+this.returnState:this.returnState+" "+t},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.isEmpty=function(){return!0},l.prototype.getParent=function(t){return null},l.prototype.getReturnState=function(t){return this.returnState},l.prototype.equals=function(t){return this===t},l.prototype.toString=function(){return"$"},o.EMPTY=new l,u.prototype=Object.create(o.prototype),u.prototype.constructor=u,u.prototype.isEmpty=function(){return this.returnStates[0]===o.EMPTY_RETURN_STATE},Object.defineProperty(u.prototype,"length",{get:function(){return this.returnStates.length}}),u.prototype.getParent=function(t){return this.parents[t]},u.prototype.getReturnState=function(t){return this.returnStates[t]},u.prototype.equals=function(t){return this===t||t instanceof u&&(this.hashCode()===t.hashCode()&&(this.returnStates===t.returnStates&&this.parents===t.parents))},u.prototype.toString=function(){if(this.isEmpty())return"[]";for(var t="[",e=0;e<this.returnStates.length;e++)e>0&&(t+=", "),this.returnStates[e]!==o.EMPTY_RETURN_STATE?(t+=this.returnStates[e],null!==this.parents[e]?t=t+" "+this.parents[e]:t+="null"):t+="$";return t+"]"},e.merge=c,e.PredictionContext=o,e.PredictionContextCache=s,e.SingletonPredictionContext=a,e.predictionContextFromRuleContext=function t(e,n){if(void 0!==n&&null!==n||(n=r.EMPTY),null===n.parentCtx||n===r.EMPTY)return o.EMPTY;var i=t(e,n.parentCtx),s=e.states[n.invokingState].transitions[0];return a.create(i,s.followState.stateNumber)},e.getCachedPredictionContext=function t(e,n,r){if(e.isEmpty())return e;var i=r[e]||null;if(null!==i)return i;if(null!==(i=n.get(e)))return r[e]=i,i;for(var s=!1,l=[],c=0;c<l.length;c++){var h=t(e.getParent(c),n,r);if(s||h!==e.getParent(c)){if(!s){l=[];for(var p=0;p<e.length;p++)l[p]=e.getParent(p);s=!0}l[c]=h}}if(!s)return n.add(e),r[e]=e,e;var f=null;return f=0===l.length?o.EMPTY:1===l.length?a.create(l[0],e.getReturnState(0)):new u(l,e.returnStates),n.add(f),r[f]=f,r[e]=f,f}},function(t,e,n){var r=n(35).LL1Analyzer,i=n(2).IntervalSet;function o(t,e){return 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=[],this}o.prototype.nextTokensInContext=function(t,e){return new r(this).LOOK(t,null,e)},o.prototype.nextTokensNoContext=function(t){return null!==t.nextTokenWithinRule?t.nextTokenWithinRule:(t.nextTokenWithinRule=this.nextTokensInContext(t,null),t.nextTokenWithinRule.readOnly=!0,t.nextTokenWithinRule)},o.prototype.nextTokens=function(t,e){return void 0===e?this.nextTokensNoContext(t):this.nextTokensInContext(t,e)},o.prototype.addState=function(t){null!==t&&(t.atn=this,t.stateNumber=this.states.length),this.states.push(t)},o.prototype.removeState=function(t){this.states[t.stateNumber]=null},o.prototype.defineDecisionState=function(t){return this.decisionToState.push(t),t.decision=this.decisionToState.length-1,t.decision},o.prototype.getDecisionState=function(t){return 0===this.decisionToState.length?null:this.decisionToState[t]};var s=n(1).Token;o.prototype.getExpectedTokens=function(t,e){if(t<0||t>=this.states.length)throw"Invalid state number.";var n=this.states[t],r=this.nextTokens(n);if(!r.contains(s.EPSILON))return r;var o=new i;for(o.addSet(r),o.removeOne(s.EPSILON);null!==e&&e.invokingState>=0&&r.contains(s.EPSILON);){var a=this.states[e.invokingState].transitions[0];r=this.nextTokens(a.followState),o.addSet(r),o.removeOne(s.EPSILON),e=e.parentCtx}return r.contains(s.EPSILON)&&o.addOne(s.EOF),o},o.INVALID_ALT_NUMBER=0,e.ATN=o},function(t,e,n){var r=n(1).Token,i=(n(2).Interval,n(2).IntervalSet),o=n(10).Predicate,s=n(10).PrecedencePredicate;function a(t){if(void 0===t||null===t)throw"target cannot be null.";return this.target=t,this.isEpsilon=!1,this.label=null,this}function l(t,e){return a.call(this,t),this.label_=e,this.label=this.makeLabel(),this.serializationType=a.ATOM,this}function u(t,e,n,r){return a.call(this,t),this.ruleIndex=e,this.precedence=n,this.followState=r,this.serializationType=a.RULE,this.isEpsilon=!0,this}function c(t,e){return a.call(this,t),this.serializationType=a.EPSILON,this.isEpsilon=!0,this.outermostPrecedenceReturn=e,this}function h(t,e,n){return a.call(this,t),this.serializationType=a.RANGE,this.start=e,this.stop=n,this.label=this.makeLabel(),this}function p(t){return a.call(this,t),this}function f(t,e,n,r){return p.call(this,t),this.serializationType=a.PREDICATE,this.ruleIndex=e,this.predIndex=n,this.isCtxDependent=r,this.isEpsilon=!0,this}function d(t,e,n,r){return a.call(this,t),this.serializationType=a.ACTION,this.ruleIndex=e,this.actionIndex=void 0===n?-1:n,this.isCtxDependent=void 0!==r&&r,this.isEpsilon=!0,this}function y(t,e){return a.call(this,t),this.serializationType=a.SET,void 0!==e&&null!==e?this.label=e:(this.label=new i,this.label.addOne(r.INVALID_TYPE)),this}function g(t,e){return y.call(this,t,e),this.serializationType=a.NOT_SET,this}function x(t){return a.call(this,t),this.serializationType=a.WILDCARD,this}function v(t,e){return p.call(this,t),this.serializationType=a.PRECEDENCE,this.precedence=e,this.isEpsilon=!0,this}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},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.makeLabel=function(){var t=new i;return t.addOne(this.label_),t},l.prototype.matches=function(t,e,n){return this.label_===t},l.prototype.toString=function(){return this.label_},u.prototype=Object.create(a.prototype),u.prototype.constructor=u,u.prototype.matches=function(t,e,n){return!1},c.prototype=Object.create(a.prototype),c.prototype.constructor=c,c.prototype.matches=function(t,e,n){return!1},c.prototype.toString=function(){return"epsilon"},h.prototype=Object.create(a.prototype),h.prototype.constructor=h,h.prototype.makeLabel=function(){var t=new i;return t.addRange(this.start,this.stop),t},h.prototype.matches=function(t,e,n){return t>=this.start&&t<=this.stop},h.prototype.toString=function(){return"'"+String.fromCharCode(this.start)+"'..'"+String.fromCharCode(this.stop)+"'"},p.prototype=Object.create(a.prototype),p.prototype.constructor=p,f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.matches=function(t,e,n){return!1},f.prototype.getPredicate=function(){return new o(this.ruleIndex,this.predIndex,this.isCtxDependent)},f.prototype.toString=function(){return"pred_"+this.ruleIndex+":"+this.predIndex},d.prototype=Object.create(a.prototype),d.prototype.constructor=d,d.prototype.matches=function(t,e,n){return!1},d.prototype.toString=function(){return"action_"+this.ruleIndex+":"+this.actionIndex},y.prototype=Object.create(a.prototype),y.prototype.constructor=y,y.prototype.matches=function(t,e,n){return this.label.contains(t)},y.prototype.toString=function(){return this.label.toString()},g.prototype=Object.create(y.prototype),g.prototype.constructor=g,g.prototype.matches=function(t,e,n){return t>=e&&t<=n&&!y.prototype.matches.call(this,t,e,n)},g.prototype.toString=function(){return"~"+y.prototype.toString.call(this)},x.prototype=Object.create(a.prototype),x.prototype.constructor=x,x.prototype.matches=function(t,e,n){return t>=e&&t<=n},x.prototype.toString=function(){return"."},v.prototype=Object.create(p.prototype),v.prototype.constructor=v,v.prototype.matches=function(t,e,n){return!1},v.prototype.getPredicate=function(){return new s(this.precedence)},v.prototype.toString=function(){return this.precedence+" >= _p"},e.Transition=a,e.AtomTransition=l,e.SetTransition=y,e.NotSetTransition=g,e.RuleTransition=u,e.ActionTransition=d,e.EpsilonTransition=c,e.RangeTransition=h,e.WildcardTransition=x,e.PredicateTransition=f,e.PrecedencePredicateTransition=v,e.AbstractPredicateTransition=p},function(t,e,n){var r=n(7).ATN,i=n(0),o=i.Hash,s=i.Set,a=n(10).SemanticContext,l=n(6).merge;function u(t){return t.hashCodeForConfigSet()}function c(t,e){return t===e||null!==t&&null!==e&&t.equalsForConfigSet(e)}function h(t){return this.configLookup=new s(u,c),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,this}function p(){return h.call(this),this.configLookup=new s,this}h.prototype.add=function(t,e){if(void 0===e&&(e=null),this.readOnly)throw"This set is readonly";t.semanticContext!==a.NONE&&(this.hasSemanticContext=!0),t.reachesIntoOuterContext>0&&(this.dipsIntoOuterContext=!0);var n=this.configLookup.add(t);if(n===t)return this.cachedHashCode=-1,this.configs.push(t),!0;var r=!this.fullCtx,i=l(n.context,t.context,r,e);return n.reachesIntoOuterContext=Math.max(n.reachesIntoOuterContext,t.reachesIntoOuterContext),t.precedenceFilterSuppressed&&(n.precedenceFilterSuppressed=!0),n.context=i,!0},h.prototype.getStates=function(){for(var t=new s,e=0;e<this.configs.length;e++)t.add(this.configs[e].state);return t},h.prototype.getPredicates=function(){for(var t=[],e=0;e<this.configs.length;e++){var n=this.configs[e].semanticContext;n!==a.NONE&&t.push(n.semanticContext)}return t},Object.defineProperty(h.prototype,"items",{get:function(){return this.configs}}),h.prototype.optimizeConfigs=function(t){if(this.readOnly)throw"This set is readonly";if(0!==this.configLookup.length)for(var e=0;e<this.configs.length;e++){var n=this.configs[e];n.context=t.getCachedContext(n.context)}},h.prototype.addAll=function(t){for(var e=0;e<t.length;e++)this.add(t[e]);return!1},h.prototype.equals=function(t){return this===t||t instanceof h&&i.equalArrays(this.configs,t.configs)&&this.fullCtx===t.fullCtx&&this.uniqueAlt===t.uniqueAlt&&this.conflictingAlts===t.conflictingAlts&&this.hasSemanticContext===t.hasSemanticContext&&this.dipsIntoOuterContext===t.dipsIntoOuterContext},h.prototype.hashCode=function(){var t=new o;return this.updateHashCode(t),t.finish()},h.prototype.updateHashCode=function(t){if(this.readOnly){if(-1===this.cachedHashCode)(t=new o).update(this.configs),this.cachedHashCode=t.finish();t.update(this.cachedHashCode)}else t.update(this.configs)},Object.defineProperty(h.prototype,"length",{get:function(){return this.configs.length}}),h.prototype.isEmpty=function(){return 0===this.configs.length},h.prototype.contains=function(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.contains(t)},h.prototype.containsFast=function(t){if(null===this.configLookup)throw"This method is not implemented for readonly sets.";return this.configLookup.containsFast(t)},h.prototype.clear=function(){if(this.readOnly)throw"This set is readonly";this.configs=[],this.cachedHashCode=-1,this.configLookup=new s},h.prototype.setReadonly=function(t){this.readOnly=t,t&&(this.configLookup=null)},h.prototype.toString=function(){return i.arrayToString(this.configs)+(this.hasSemanticContext?",hasSemanticContext="+this.hasSemanticContext:"")+(this.uniqueAlt!==r.INVALID_ALT_NUMBER?",uniqueAlt="+this.uniqueAlt:"")+(null!==this.conflictingAlts?",conflictingAlts="+this.conflictingAlts:"")+(this.dipsIntoOuterContext?",dipsIntoOuterContext":"")},p.prototype=Object.create(h.prototype),p.prototype.constructor=p,e.ATNConfigSet=h,e.OrderedATNConfigSet=p},function(t,e,n){var r=n(0).Set,i=n(0).Hash;function o(){return this}function s(t,e,n){return o.call(this),this.ruleIndex=void 0===t?-1:t,this.predIndex=void 0===e?-1:e,this.isCtxDependent=void 0!==n&&n,this}function a(t){o.call(this),this.precedence=void 0===t?0:t}function l(t,e){o.call(this);var n=new r;t instanceof l?t.opnds.map(function(t){n.add(t)}):n.add(t),e instanceof l?e.opnds.map(function(t){n.add(t)}):n.add(e);var i=a.filterPrecedencePredicates(n);if(i.length>0){var s=null;i.map(function(t){(null===s||t.precedence<s.precedence)&&(s=t)}),n.add(s)}return this.opnds=n.values(),this}function u(t,e){o.call(this);var n=new r;t instanceof u?t.opnds.map(function(t){n.add(t)}):n.add(t),e instanceof u?e.opnds.map(function(t){n.add(t)}):n.add(e);var i=a.filterPrecedencePredicates(n);if(i.length>0){var s=i.sort(function(t,e){return t.compareTo(e)}),l=s[s.length-1];n.add(l)}return this.opnds=n.values(),this}o.prototype.hashCode=function(){var t=new i;return this.updateHashCode(t),t.finish()},o.prototype.evaluate=function(t,e){},o.prototype.evalPrecedence=function(t,e){return this},o.andContext=function(t,e){if(null===t||t===o.NONE)return e;if(null===e||e===o.NONE)return t;var n=new l(t,e);return 1===n.opnds.length?n.opnds[0]:n},o.orContext=function(t,e){if(null===t)return e;if(null===e)return t;if(t===o.NONE||e===o.NONE)return o.NONE;var n=new u(t,e);return 1===n.opnds.length?n.opnds[0]:n},s.prototype=Object.create(o.prototype),s.prototype.constructor=s,o.NONE=new s,s.prototype.evaluate=function(t,e){var n=this.isCtxDependent?e:null;return t.sempred(n,this.ruleIndex,this.predIndex)},s.prototype.updateHashCode=function(t){t.update(this.ruleIndex,this.predIndex,this.isCtxDependent)},s.prototype.equals=function(t){return this===t||t instanceof s&&(this.ruleIndex===t.ruleIndex&&this.predIndex===t.predIndex&&this.isCtxDependent===t.isCtxDependent)},s.prototype.toString=function(){return"{"+this.ruleIndex+":"+this.predIndex+"}?"},a.prototype=Object.create(o.prototype),a.prototype.constructor=a,a.prototype.evaluate=function(t,e){return t.precpred(e,this.precedence)},a.prototype.evalPrecedence=function(t,e){return t.precpred(e,this.precedence)?o.NONE:null},a.prototype.compareTo=function(t){return this.precedence-t.precedence},a.prototype.updateHashCode=function(t){t.update(31)},a.prototype.equals=function(t){return this===t||t instanceof a&&this.precedence===t.precedence},a.prototype.toString=function(){return"{"+this.precedence+">=prec}?"},a.filterPrecedencePredicates=function(t){var e=[];return t.values().map(function(t){t instanceof a&&e.push(t)}),e},l.prototype=Object.create(o.prototype),l.prototype.constructor=l,l.prototype.equals=function(t){return this===t||t instanceof l&&this.opnds===t.opnds},l.prototype.updateHashCode=function(t){t.update(this.opnds,"AND")},l.prototype.evaluate=function(t,e){for(var n=0;n<this.opnds.length;n++)if(!this.opnds[n].evaluate(t,e))return!1;return!0},l.prototype.evalPrecedence=function(t,e){for(var n=!1,r=[],i=0;i<this.opnds.length;i++){var s=this.opnds[i],a=s.evalPrecedence(t,e);if(n|=a!==s,null===a)return null;a!==o.NONE&&r.push(a)}if(!n)return this;if(0===r.length)return o.NONE;var l=null;return r.map(function(t){l=null===l?t:o.andContext(l,t)}),l},l.prototype.toString=function(){var t="";return this.opnds.map(function(e){t+="&& "+e.toString()}),t.length>3?t.slice(3):t},u.prototype=Object.create(o.prototype),u.prototype.constructor=u,u.prototype.constructor=function(t){return this===t||t instanceof u&&this.opnds===t.opnds},u.prototype.updateHashCode=function(t){t.update(this.opnds,"OR")},u.prototype.evaluate=function(t,e){for(var n=0;n<this.opnds.length;n++)if(this.opnds[n].evaluate(t,e))return!0;return!1},u.prototype.evalPrecedence=function(t,e){for(var n=!1,r=[],i=0;i<this.opnds.length;i++){var s=this.opnds[i],a=s.evalPrecedence(t,e);if(n|=a!==s,a===o.NONE)return o.NONE;null!==a&&r.push(a)}if(!n)return this;if(0===r.length)return null;return r.map(function(t){return t}),null},u.prototype.toString=function(){var t="";return this.opnds.map(function(e){t+="|| "+e.toString()}),t.length>3?t.slice(3):t},e.SemanticContext=o,e.PrecedencePredicate=a,e.Predicate=s},function(t,e,n){var r=n(9).ATNConfigSet,i=n(0),o=i.Hash,s=i.Set;function a(t,e){return this.alt=e,this.pred=t,this}function l(t,e){return null===t&&(t=-1),null===e&&(e=new r),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}a.prototype.toString=function(){return"("+this.pred+", "+this.alt+")"},l.prototype.getAltSet=function(){var t=new s;if(null!==this.configs)for(var e=0;e<this.configs.length;e++){var n=this.configs[e];t.add(n.alt)}return 0===t.length?null:t},l.prototype.equals=function(t){return this===t||t instanceof l&&this.configs.equals(t.configs)},l.prototype.toString=function(){var t=this.stateNumber+":"+this.configs;return this.isAcceptState&&(t+="=>",null!==this.predicates?t+=this.predicates:t+=this.prediction),t},l.prototype.hashCode=function(){var t=new o;return t.update(this.configs),this.isAcceptState&&(null!==this.predicates?t.update(this.predicates):t.update(this.prediction)),t.finish()},e.DFAState=l,e.PredPrediction=a},function(t,e,n){e.atn=n(34),e.codepointat=n(28),e.dfa=n(41),e.fromcodepoint=n(29),e.tree=n(43),e.error=n(44),e.Token=n(1).Token,e.CharStreams=n(46).CharStreams,e.CommonToken=n(1).CommonToken,e.InputStream=n(19).InputStream,e.FileStream=n(47).FileStream,e.CommonTokenStream=n(48).CommonTokenStream,e.Lexer=n(15).Lexer,e.Parser=n(50).Parser;var r=n(6);e.PredictionContextCache=r.PredictionContextCache,e.ParserRuleContext=n(18).ParserRuleContext,e.Interval=n(2).Interval,e.Utils=n(0)},function(t,e,n){var r=n(3).DecisionState,i=n(10).SemanticContext,o=n(0).Hash;function s(t,e){if(null===t){var n={state:null,alt:null,context:null,semanticContext:null};return e&&(n.reachesIntoOuterContext=0),n}var r={};return r.state=t.state||null,r.alt=void 0===t.alt?null:t.alt,r.context=t.context||null,r.semanticContext=t.semanticContext||null,e&&(r.reachesIntoOuterContext=t.reachesIntoOuterContext||0,r.precedenceFilterSuppressed=t.precedenceFilterSuppressed||!1),r}function a(t,e){return this.checkContext(t,e),t=s(t),e=s(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:i.NONE,this.reachesIntoOuterContext=e.reachesIntoOuterContext,this.precedenceFilterSuppressed=e.precedenceFilterSuppressed,this}function l(t,e){a.call(this,t,e);var n=t.lexerActionExecutor||null;return this.lexerActionExecutor=n||(null!==e?e.lexerActionExecutor:null),this.passedThroughNonGreedyDecision=null!==e&&this.checkNonGreedyDecision(e,this.state),this}a.prototype.checkContext=function(t,e){null!==t.context&&void 0!==t.context||null!==e&&null!==e.context&&void 0!==e.context||(this.context=null)},a.prototype.hashCode=function(){var t=new o;return this.updateHashCode(t),t.finish()},a.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext)},a.prototype.equals=function(t){return this===t||t instanceof a&&(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)},a.prototype.hashCodeForConfigSet=function(){var t=new o;return t.update(this.state.stateNumber,this.alt,this.semanticContext),t.finish()},a.prototype.equalsForConfigSet=function(t){return this===t||t instanceof a&&(this.state.stateNumber===t.state.stateNumber&&this.alt===t.alt&&this.semanticContext.equals(t.semanticContext))},a.prototype.toString=function(){return"("+this.state+","+this.alt+(null!==this.context?",["+this.context.toString()+"]":"")+(this.semanticContext!==i.NONE?","+this.semanticContext.toString():"")+(this.reachesIntoOuterContext>0?",up="+this.reachesIntoOuterContext:"")+")"},l.prototype=Object.create(a.prototype),l.prototype.constructor=l,l.prototype.updateHashCode=function(t){t.update(this.state.stateNumber,this.alt,this.context,this.semanticContext,this.passedThroughNonGreedyDecision,this.lexerActionExecutor)},l.prototype.equals=function(t){return this===t||t instanceof l&&this.passedThroughNonGreedyDecision==t.passedThroughNonGreedyDecision&&(this.lexerActionExecutor?this.lexerActionExecutor.equals(t.lexerActionExecutor):!t.lexerActionExecutor)&&a.prototype.equals.call(this,t)},l.prototype.hashCodeForConfigSet=l.prototype.hashCode,l.prototype.equalsForConfigSet=l.prototype.equals,l.prototype.checkNonGreedyDecision=function(t,e){return t.passedThroughNonGreedyDecision||e instanceof r&&e.nonGreedy},e.ATNConfig=a,e.LexerATNConfig=l},function(t,e,n){var r=n(4).RuleNode,i=n(4).INVALID_INTERVAL,o=n(7).INVALID_ALT_NUMBER;function s(t,e){return r.call(this),this.parentCtx=t||null,this.invokingState=e||-1,this}s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.depth=function(){for(var t=0,e=this;null!==e;)e=e.parentCtx,t+=1;return t},s.prototype.isEmpty=function(){return-1===this.invokingState},s.prototype.getSourceInterval=function(){return i},s.prototype.getRuleContext=function(){return this},s.prototype.getPayload=function(){return this},s.prototype.getText=function(){return 0===this.getChildCount()?"":this.children.map(function(t){return t.getText()}).join("")},s.prototype.getAltNumber=function(){return o},s.prototype.setAltNumber=function(t){},s.prototype.getChild=function(t){return null},s.prototype.getChildCount=function(){return 0},s.prototype.accept=function(t){return t.visitChildren(this)},e.RuleContext=s;var a=n(21).Trees;s.prototype.toStringTree=function(t,e){return a.toStringTree(this,t,e)},s.prototype.toString=function(t,e){t=t||null,e=e||null;for(var n=this,r="[";null!==n&&n!==e;){if(null===t)n.isEmpty()||(r+=n.invokingState);else{var i=n.ruleIndex;r+=i>=0&&i<t.length?t[i]:""+i}null===n.parentCtx||null===t&&n.parentCtx.isEmpty()||(r+=" "),n=n.parentCtx}return r+="]"}},function(t,e,n){var r=n(1).Token,i=n(25).Recognizer,o=n(38).CommonTokenFactory,s=n(5).RecognitionException,a=n(5).LexerNoViableAltException;function l(t){return i.call(this),this._input=t,this._factory=o.DEFAULT,this._tokenFactorySourcePair=[this,t],this._interp=null,this._token=null,this._tokenStartCharIndex=-1,this._tokenStartLine=-1,this._tokenStartColumn=-1,this._hitEOF=!1,this._channel=r.DEFAULT_CHANNEL,this._type=r.INVALID_TYPE,this._modeStack=[],this._mode=l.DEFAULT_MODE,this._text=null,this}l.prototype=Object.create(i.prototype),l.prototype.constructor=l,l.DEFAULT_MODE=0,l.MORE=-2,l.SKIP=-3,l.DEFAULT_TOKEN_CHANNEL=r.DEFAULT_CHANNEL,l.HIDDEN=r.HIDDEN_CHANNEL,l.MIN_CHAR_VALUE=0,l.MAX_CHAR_VALUE=1114111,l.prototype.reset=function(){null!==this._input&&this._input.seek(0),this._token=null,this._type=r.INVALID_TYPE,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=-1,this._tokenStartColumn=-1,this._tokenStartLine=-1,this._text=null,this._hitEOF=!1,this._mode=l.DEFAULT_MODE,this._modeStack=[],this._interp.reset()},l.prototype.nextToken=function(){if(null===this._input)throw"nextToken requires a non-null input stream.";var t=this._input.mark();try{for(;;){if(this._hitEOF)return this.emitEOF(),this._token;this._token=null,this._channel=r.DEFAULT_CHANNEL,this._tokenStartCharIndex=this._input.index,this._tokenStartColumn=this._interp.column,this._tokenStartLine=this._interp.line,this._text=null;for(var e=!1;;){this._type=r.INVALID_TYPE;var n=l.SKIP;try{n=this._interp.match(this._input,this._mode)}catch(t){if(!(t instanceof s))throw console.log(t.stack),t;this.notifyListeners(t),this.recover(t)}if(this._input.LA(1)===r.EOF&&(this._hitEOF=!0),this._type===r.INVALID_TYPE&&(this._type=n),this._type===l.SKIP){e=!0;break}if(this._type!==l.MORE)break}if(!e)return null===this._token&&this.emit(),this._token}}finally{this._input.release(t)}},l.prototype.skip=function(){this._type=l.SKIP},l.prototype.more=function(){this._type=l.MORE},l.prototype.mode=function(t){this._mode=t},l.prototype.pushMode=function(t){this._interp.debug&&console.log("pushMode "+t),this._modeStack.push(this._mode),this.mode(t)},l.prototype.popMode=function(){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},Object.defineProperty(l.prototype,"inputStream",{get:function(){return this._input},set:function(t){this._input=null,this._tokenFactorySourcePair=[this,this._input],this.reset(),this._input=t,this._tokenFactorySourcePair=[this,this._input]}}),Object.defineProperty(l.prototype,"sourceName",{get:function(){return this._input.sourceName}}),l.prototype.emitToken=function(t){this._token=t},l.prototype.emit=function(){var 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},l.prototype.emitEOF=function(){var t=this.column,e=this.line,n=this._factory.create(this._tokenFactorySourcePair,r.EOF,null,r.DEFAULT_CHANNEL,this._input.index,this._input.index-1,e,t);return this.emitToken(n),n},Object.defineProperty(l.prototype,"type",{get:function(){return this.type},set:function(t){this._type=t}}),Object.defineProperty(l.prototype,"line",{get:function(){return this._interp.line},set:function(t){this._interp.line=t}}),Object.defineProperty(l.prototype,"column",{get:function(){return this._interp.column},set:function(t){this._interp.column=t}}),l.prototype.getCharIndex=function(){return this._input.index},Object.defineProperty(l.prototype,"text",{get:function(){return null!==this._text?this._text:this._interp.getText(this._input)},set:function(t){this._text=t}}),l.prototype.getAllTokens=function(){for(var t=[],e=this.nextToken();e.type!==r.EOF;)t.push(e),e=this.nextToken();return t},l.prototype.notifyListeners=function(t){var e=this._tokenStartCharIndex,n=this._input.index,r=this._input.getText(e,n),i="token recognition error at: '"+this.getErrorDisplay(r)+"'";this.getErrorListenerDispatch().syntaxError(this,null,this._tokenStartLine,this._tokenStartColumn,i,t)},l.prototype.getErrorDisplay=function(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e.join("")},l.prototype.getErrorDisplayForChar=function(t){return t.charCodeAt(0)===r.EOF?"<EOF>":"\n"===t?"\\n":"\t"===t?"\\t":"\r"===t?"\\r":t},l.prototype.getCharErrorDisplay=function(t){return"'"+this.getErrorDisplayForChar(t)+"'"},l.prototype.recover=function(t){this._input.LA(1)!==r.EOF&&(t instanceof a?this._interp.consume(this._input):this._input.consume())},e.Lexer=l},function(t,e){function n(){return this}function r(){return n.call(this),this}function i(t){if(n.call(this),null===t)throw"delegates";return this.delegates=t,this}n.prototype.syntaxError=function(t,e,n,r,i,o){},n.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){},n.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){},n.prototype.reportContextSensitivity=function(t,e,n,r,i,o){},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.INSTANCE=new r,r.prototype.syntaxError=function(t,e,n,r,i,o){console.error("line "+n+":"+r+" "+i)},i.prototype=Object.create(n.prototype),i.prototype.constructor=i,i.prototype.syntaxError=function(t,e,n,r,i,o){this.delegates.map(function(s){s.syntaxError(t,e,n,r,i,o)})},i.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){this.delegates.map(function(a){a.reportAmbiguity(t,e,n,r,i,o,s)})},i.prototype.reportAttemptingFullContext=function(t,e,n,r,i,o){this.delegates.map(function(s){s.reportAttemptingFullContext(t,e,n,r,i,o)})},i.prototype.reportContextSensitivity=function(t,e,n,r,i,o){this.delegates.map(function(s){s.reportContextSensitivity(t,e,n,r,i,o)})},e.ErrorListener=n,e.ConsoleErrorListener=r,e.ProxyErrorListener=i},function(t,e){function n(t,e,n){return this.dfa=t,this.literalNames=e||[],this.symbolicNames=n||[],this}function r(t){return n.call(this,t,null),this}n.prototype.toString=function(){if(null===this.dfa.s0)return null;for(var t="",e=this.dfa.sortedStates(),n=0;n<e.length;n++){var r=e[n];if(null!==r.edges)for(var i=r.edges.length,o=0;o<i;o++){var s=r.edges[o]||null;null!==s&&2147483647!==s.stateNumber&&(t=(t=(t=(t=(t=(t=t.concat(this.getStateString(r))).concat("-")).concat(this.getEdgeLabel(o))).concat("->")).concat(this.getStateString(s))).concat("\n"))}}return 0===t.length?null:t},n.prototype.getEdgeLabel=function(t){return 0===t?"EOF":null!==this.literalNames||null!==this.symbolicNames?this.literalNames[t-1]||this.symbolicNames[t-1]:String.fromCharCode(t-1)},n.prototype.getStateString=function(t){var e=(t.isAcceptState?":":"")+"s"+t.stateNumber+(t.requiresFullContext?"^":"");return t.isAcceptState?null!==t.predicates?e+"=>"+t.predicates.toString():e+"=>"+t.prediction.toString():e},r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.getEdgeLabel=function(t){return"'"+String.fromCharCode(t)+"'"},e.DFASerializer=n,e.LexerDFASerializer=r},function(t,e,n){var r=n(14).RuleContext,i=n(4),o=i.INVALID_INTERVAL,s=i.TerminalNode,a=i.TerminalNodeImpl,l=i.ErrorNodeImpl,u=n(2).Interval;function c(t,e){t=t||null,e=e||null,r.call(this,t,e),this.ruleIndex=-1,this.children=null,this.start=null,this.stop=null,this.exception=null}function h(t,e,n){return c.call(t,e),this.ruleIndex=n,this}c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.copyFrom=function(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 l&&(this.children.push(t),t.parentCtx=this)},this))},c.prototype.enterRule=function(t){},c.prototype.exitRule=function(t){},c.prototype.addChild=function(t){return null===this.children&&(this.children=[]),this.children.push(t),t},c.prototype.removeLastChild=function(){null!==this.children&&this.children.pop()},c.prototype.addTokenNode=function(t){var e=new a(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.addErrorNode=function(t){var e=new l(t);return this.addChild(e),e.parentCtx=this,e},c.prototype.getChild=function(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(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof e){if(0===t)return r;t-=1}}return null},c.prototype.getToken=function(t,e){if(null===this.children||e<0||e>=this.children.length)return null;for(var n=0;n<this.children.length;n++){var r=this.children[n];if(r instanceof s&&r.symbol.type===t){if(0===e)return r;e-=1}}return null},c.prototype.getTokens=function(t){if(null===this.children)return[];for(var e=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof s&&r.symbol.type===t&&e.push(r)}return e},c.prototype.getTypedRuleContext=function(t,e){return this.getChild(e,t)},c.prototype.getTypedRuleContexts=function(t){if(null===this.children)return[];for(var e=[],n=0;n<this.children.length;n++){var r=this.children[n];r instanceof t&&e.push(r)}return e},c.prototype.getChildCount=function(){return null===this.children?0:this.children.length},c.prototype.getSourceInterval=function(){return null===this.start||null===this.stop?o:new u(this.start.tokenIndex,this.stop.tokenIndex)},r.EMPTY=new c,h.prototype=Object.create(c.prototype),h.prototype.constructor=h,e.ParserRuleContext=c},function(t,e,n){var r=n(1).Token;function i(t,e){return this.name="<empty>",this.strdata=t,this.decodeToUnicodeCodePoints=e||!1,function(t,e){if(t._index=0,t.data=[],t.decodeToUnicodeCodePoints)for(var n=0;n<t.strdata.length;){var r=t.strdata.codePointAt(n);t.data.push(r),n+=r<=65535?1:2}else for(n=0;n<t.strdata.length;n++){var i=t.strdata.charCodeAt(n);t.data.push(i)}t._size=t.data.length}(this),this}n(28),n(29),Object.defineProperty(i.prototype,"index",{get:function(){return this._index}}),Object.defineProperty(i.prototype,"size",{get:function(){return this._size}}),i.prototype.reset=function(){this._index=0},i.prototype.consume=function(){if(this._index>=this._size)throw"cannot consume EOF";this._index+=1},i.prototype.LA=function(t){if(0===t)return 0;t<0&&(t+=1);var e=this._index+t-1;return e<0||e>=this._size?r.EOF:this.data[e]},i.prototype.LT=function(t){return this.LA(t)},i.prototype.mark=function(){return-1},i.prototype.release=function(t){},i.prototype.seek=function(t){t<=this._index?this._index=t:this._index=Math.min(t,this._size)},i.prototype.getText=function(t,e){if(e>=this._size&&(e=this._size-1),t>=this._size)return"";if(this.decodeToUnicodeCodePoints){for(var n="",r=t;r<=e;r++)n+=String.fromCodePoint(this.data[r]);return n}return this.strdata.slice(t,e+1)},i.prototype.toString=function(){return this.strdata},e.InputStream=i},function(t,e,n){var r=n(12);function i(){return r.tree.ParseTreeVisitor.call(this),this}i.prototype=Object.create(r.tree.ParseTreeVisitor.prototype),i.prototype.constructor=i,i.prototype.visitGrammarFile=function(t){return this.visitChildren(t)},i.prototype.visitGrammerDecl=function(t){return this.visitChildren(t)},i.prototype.visitStatExprSplit=function(t){return this.visitChildren(t)},i.prototype.visitStatList=function(t){return this.visitChildren(t)},i.prototype.visitStatValue=function(t){return this.visitChildren(t)},i.prototype.visitExprExpression=function(t){return this.visitChildren(t)},i.prototype.visitExprValue=function(t){return this.visitChildren(t)},i.prototype.visitArithmeticRuleCollection=function(t){return this.visitChildren(t)},i.prototype.visitParserAtomExpr=function(t){return this.visitChildren(t)},i.prototype.visitParserAtomParserId=function(t){return this.visitChildren(t)},i.prototype.visitParserAtomLexerId=function(t){return this.visitChildren(t)},i.prototype.visitParserAtomStr=function(t){return this.visitChildren(t)},i.prototype.visitLexerRuleCollection=function(t){return this.visitChildren(t)},i.prototype.visitMeaningfulSplit=function(t){return this.visitChildren(t)},i.prototype.visitLexerRuleStrings=function(t){return this.visitChildren(t)},i.prototype.visitLexerRuleList=function(t){return this.visitChildren(t)},i.prototype.visitLexerRuleComplex=function(t){return this.visitChildren(t)},i.prototype.visitStrings=function(t){return this.visitChildren(t)},i.prototype.visitLexerRuleExpr=function(t){return this.visitChildren(t)},e.BlocklyGrammerVisitor=i},function(t,e,n){var r=n(0),i=n(1).Token,o=(n(4).RuleNode,n(4).ErrorNode),s=n(4).TerminalNode,a=n(18).ParserRuleContext,l=n(14).RuleContext,u=n(7).INVALID_ALT_NUMBER;function c(){}c.toStringTree=function(t,e,n){e=e||null,null!==(n=n||null)&&(e=n.ruleNames);var i=c.getNodeText(t,e);i=r.escapeWhitespace(i,!1);var o=t.getChildCount();if(0===o)return i;var s="("+i+" ";o>0&&(i=c.toStringTree(t.getChild(0),e),s=s.concat(i));for(var a=1;a<o;a++)i=c.toStringTree(t.getChild(a),e),s=s.concat(" "+i);return s=s.concat(")")},c.getNodeText=function(t,e,n){if(e=e||null,null!==(n=n||null)&&(e=n.ruleNames),null!==e){if(t instanceof l){var r=t.getAltNumber();return r!=u?e[t.ruleIndex]+":"+r:e[t.ruleIndex]}if(t instanceof o)return t.toString();if(t instanceof s&&null!==t.symbol)return t.symbol.text}var a=t.getPayload();return a instanceof i?a.text:t.getPayload().toString()},c.getChildren=function(t){for(var e=[],n=0;n<t.getChildCount();n++)e.push(t.getChild(n));return e},c.getAncestors=function(t){var e=[];for(t=t.getParent();null!==t;)e=[t].concat(e),t=t.getParent();return e},c.findAllTokenNodes=function(t,e){return c.findAllNodes(t,e,!0)},c.findAllRuleNodes=function(t,e){return c.findAllNodes(t,e,!1)},c.findAllNodes=function(t,e,n){var r=[];return c._findAllNodes(t,e,n,r),r},c._findAllNodes=function(t,e,n,r){n&&t instanceof s?t.symbol.type===e&&r.push(t):!n&&t instanceof a&&t.ruleIndex===e&&r.push(t);for(var i=0;i<t.getChildCount();i++)c._findAllNodes(t.getChild(i),e,n,r)},c.descendants=function(t){for(var e=[t],n=0;n<t.getChildCount();n++)e=e.concat(c.descendants(t.getChild(n)));return e},e.Trees=c},function(t,e,n){var r=n(1).Token,i=n(7).ATN,o=n(36).ATNType,s=n(3),a=s.ATNState,l=s.BasicState,u=s.DecisionState,c=s.BlockStartState,h=s.BlockEndState,p=s.LoopEndState,f=s.RuleStartState,d=s.RuleStopState,y=s.TokensStartState,g=s.PlusLoopbackState,x=s.StarLoopbackState,v=s.StarLoopEntryState,m=s.PlusBlockStartState,_=s.StarBlockStartState,T=s.BasicBlockStartState,S=n(8),E=S.Transition,C=S.AtomTransition,A=S.SetTransition,k=S.NotSetTransition,b=S.RuleTransition,R=S.RangeTransition,L=S.ActionTransition,N=S.EpsilonTransition,I=S.WildcardTransition,O=S.PredicateTransition,P=S.PrecedencePredicateTransition,w=n(2).IntervalSet,F=(n(2).Interval,n(23).ATNDeserializationOptions),D=n(24),j=D.LexerActionType,M=D.LexerSkipAction,B=D.LexerChannelAction,U=D.LexerCustomAction,V=D.LexerMoreAction,H=D.LexerTypeAction,z=D.LexerPushModeAction,q=D.LexerPopModeAction,G=D.LexerModeAction,Y="59627784-3BE5-417A-B9EB-8131A7286089",K=["AADB8D7E-AEEF-4415-AD2B-8204D6CF042E",Y];function $(t,e){var n=[];return n[t-1]=e,n.map(function(t){return e})}function W(t){return void 0!==t&&null!==t||(t=F.defaultOptions),this.deserializationOptions=t,this.stateFactories=null,this.actionFactories=null,this}W.prototype.isFeatureSupported=function(t,e){var n=K.indexOf(t);return!(n<0)&&K.indexOf(e)>=n},W.prototype.deserialize=function(t){this.reset(t),this.checkVersion(),this.checkUUID();var e=this.readATN();this.readStates(e),this.readRules(e),this.readModes(e);var n=[];return this.readSets(e,n,this.readInt.bind(this)),this.isFeatureSupported(Y,this.uuid)&&this.readSets(e,n,this.readInt32.bind(this)),this.readEdges(e,n),this.readDecisions(e),this.readLexerActions(e),this.markPrecedenceDecisions(e),this.verifyATN(e),this.deserializationOptions.generateRuleBypassTransitions&&e.grammarType===o.PARSER&&(this.generateRuleBypassTransitions(e),this.verifyATN(e)),e},W.prototype.reset=function(t){var e=t.split("").map(function(t){var e=t.charCodeAt(0);return e>1?e-2:-1});e[0]=t.charCodeAt(0),this.data=e,this.pos=0},W.prototype.checkVersion=function(){var t=this.readInt();if(3!==t)throw"Could not deserialize ATN with version "+t+" (expected 3)."},W.prototype.checkUUID=function(){var t=this.readUUID();if(K.indexOf(t)<0)throw"59627784-3BE5-417A-B9EB-8131A7286089";this.uuid=t},W.prototype.readATN=function(){var t=this.readInt(),e=this.readInt();return new i(t,e)},W.prototype.readStates=function(t){for(var e,n,r,i=[],o=[],s=this.readInt(),l=0;l<s;l++){var u=this.readInt();if(u!==a.INVALID_TYPE){var h=this.readInt();65535===h&&(h=-1);var p=this.stateFactory(u,h);if(u===a.LOOP_END){var f=this.readInt();i.push([p,f])}else if(p instanceof c){var d=this.readInt();o.push([p,d])}t.addState(p)}else t.addState(null)}for(e=0;e<i.length;e++)(n=i[e])[0].loopBackState=t.states[n[1]];for(e=0;e<o.length;e++)(n=o[e])[0].endState=t.states[n[1]];var y=this.readInt();for(e=0;e<y;e++)r=this.readInt(),t.states[r].nonGreedy=!0;var g=this.readInt();for(e=0;e<g;e++)r=this.readInt(),t.states[r].isPrecedenceRule=!0},W.prototype.readRules=function(t){var e,n=this.readInt();for(t.grammarType===o.LEXER&&(t.ruleToTokenType=$(n,0)),t.ruleToStartState=$(n,0),e=0;e<n;e++){var i=this.readInt(),s=t.states[i];if(t.ruleToStartState[e]=s,t.grammarType===o.LEXER){var a=this.readInt();65535===a&&(a=r.EOF),t.ruleToTokenType[e]=a}}for(t.ruleToStopState=$(n,0),e=0;e<t.states.length;e++){var l=t.states[e];l instanceof d&&(t.ruleToStopState[l.ruleIndex]=l,t.ruleToStartState[l.ruleIndex].stopState=l)}},W.prototype.readModes=function(t){for(var e=this.readInt(),n=0;n<e;n++){var r=this.readInt();t.modeToStartState.push(t.states[r])}},W.prototype.readSets=function(t,e,n){for(var r=this.readInt(),i=0;i<r;i++){var o=new w;e.push(o);var s=this.readInt();0!==this.readInt()&&o.addOne(-1);for(var a=0;a<s;a++){var l=n(),u=n();o.addRange(l,u)}}},W.prototype.readEdges=function(t,e){var n,r,i,o,s,a=this.readInt();for(n=0;n<a;n++){var l=this.readInt(),u=this.readInt(),h=this.readInt(),p=this.readInt(),f=this.readInt(),d=this.readInt();o=this.edgeFactory(t,h,l,u,p,f,d,e),t.states[l].addTransition(o)}for(n=0;n<t.states.length;n++)for(i=t.states[n],r=0;r<i.transitions.length;r++){var y=i.transitions[r];if(y instanceof b){var _=-1;t.ruleToStartState[y.target.ruleIndex].isPrecedenceRule&&0===y.precedence&&(_=y.target.ruleIndex),o=new N(y.followState,_),t.ruleToStopState[y.target.ruleIndex].addTransition(o)}}for(n=0;n<t.states.length;n++){if((i=t.states[n])instanceof c){if(null===i.endState)throw"IllegalState";if(null!==i.endState.startState)throw"IllegalState";i.endState.startState=i}if(i instanceof g)for(r=0;r<i.transitions.length;r++)(s=i.transitions[r].target)instanceof m&&(s.loopBackState=i);else if(i instanceof x)for(r=0;r<i.transitions.length;r++)(s=i.transitions[r].target)instanceof v&&(s.loopBackState=i)}},W.prototype.readDecisions=function(t){for(var e=this.readInt(),n=0;n<e;n++){var r=this.readInt(),i=t.states[r];t.decisionToState.push(i),i.decision=n}},W.prototype.readLexerActions=function(t){if(t.grammarType===o.LEXER){var e=this.readInt();t.lexerActions=$(e,null);for(var n=0;n<e;n++){var r=this.readInt(),i=this.readInt();65535===i&&(i=-1);var s=this.readInt();65535===s&&(s=-1);var a=this.lexerActionFactory(r,i,s);t.lexerActions[n]=a}}},W.prototype.generateRuleBypassTransitions=function(t){var e,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)},W.prototype.generateRuleBypassTransition=function(t,e){var n,r,i=new T;i.ruleIndex=e,t.addState(i);var o=new h;o.ruleIndex=e,t.addState(o),i.endState=o,t.defineDecisionState(i),o.startState=i;var s=null,a=null;if(t.ruleToStartState[e].isPrecedenceRule){for(a=null,n=0;n<t.states.length;n++)if(r=t.states[n],this.stateIsEndStateFor(r,e)){a=r,s=r.loopBackState.transitions[0];break}if(null===s)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++){r=t.states[n];for(var u=0;u<r.transitions.length;u++){var c=r.transitions[u];c!==s&&(c.target===a&&(c.target=o))}}for(var p=t.ruleToStartState[e],f=p.transitions.length;f>0;)i.addTransition(p.transitions[f-1]),p.transitions=p.transitions.slice(-1);t.ruleToStartState[e].addTransition(new N(i)),o.addTransition(new N(a));var d=new l;t.addState(d),d.addTransition(new C(o,t.ruleToTokenType[e])),i.addTransition(new N(d))},W.prototype.stateIsEndStateFor=function(t,e){if(t.ruleIndex!==e)return null;if(!(t instanceof v))return null;var n=t.transitions[t.transitions.length-1].target;return n instanceof p&&n.epsilonOnlyTransitions&&n.transitions[0].target instanceof d?t:null},W.prototype.markPrecedenceDecisions=function(t){for(var e=0;e<t.states.length;e++){var n=t.states[e];if(n instanceof v&&t.ruleToStartState[n.ruleIndex].isPrecedenceRule){var r=n.transitions[n.transitions.length-1].target;r instanceof p&&r.epsilonOnlyTransitions&&r.transitions[0].target instanceof d&&(n.isPrecedenceDecision=!0)}}},W.prototype.verifyATN=function(t){if(this.deserializationOptions.verifyATN)for(var e=0;e<t.states.length;e++){var n=t.states[e];if(null!==n)if(this.checkCondition(n.epsilonOnlyTransitions||n.transitions.length<=1),n instanceof m)this.checkCondition(null!==n.loopBackState);else if(n instanceof v)if(this.checkCondition(null!==n.loopBackState),this.checkCondition(2===n.transitions.length),n.transitions[0].target instanceof _)this.checkCondition(n.transitions[1].target instanceof p),this.checkCondition(!n.nonGreedy);else{if(!(n.transitions[0].target instanceof p))throw"IllegalState";this.checkCondition(n.transitions[1].target instanceof _),this.checkCondition(n.nonGreedy)}else n instanceof x?(this.checkCondition(1===n.transitions.length),this.checkCondition(n.transitions[0].target instanceof v)):n instanceof p?this.checkCondition(null!==n.loopBackState):n instanceof f?this.checkCondition(null!==n.stopState):n instanceof c?this.checkCondition(null!==n.endState):n instanceof h?this.checkCondition(null!==n.startState):n instanceof u?this.checkCondition(n.transitions.length<=1||n.decision>=0):this.checkCondition(n.transitions.length<=1||n instanceof d)}},W.prototype.checkCondition=function(t,e){if(!t)throw void 0!==e&&null!==e||(e="IllegalState"),e},W.prototype.readInt=function(){return this.data[this.pos++]},W.prototype.readInt32=function(){return this.readInt()|this.readInt()<<16},W.prototype.readLong=function(){return 4294967295&this.readInt32()|this.readInt32()<<32};var X=function(){for(var t=[],e=0;e<256;e++)t[e]=(e+256).toString(16).substr(1).toUpperCase();return t}();W.prototype.readUUID=function(){for(var t=[],e=7;e>=0;e--){var n=this.readInt();t[2*e+1]=255&n,t[2*e]=n>>8&255}return X[t[0]]+X[t[1]]+X[t[2]]+X[t[3]]+"-"+X[t[4]]+X[t[5]]+"-"+X[t[6]]+X[t[7]]+"-"+X[t[8]]+X[t[9]]+"-"+X[t[10]]+X[t[11]]+X[t[12]]+X[t[13]]+X[t[14]]+X[t[15]]},W.prototype.edgeFactory=function(t,e,n,i,o,s,a,l){var u=t.states[i];switch(e){case E.EPSILON:return new N(u);case E.RANGE:return new R(u,0!==a?r.EOF:o,s);case E.RULE:return new b(t.states[o],s,a,u);case E.PREDICATE:return new O(u,o,s,0!==a);case E.PRECEDENCE:return new P(u,o);case E.ATOM:return new C(u,0!==a?r.EOF:o);case E.ACTION:return new L(u,o,s,0!==a);case E.SET:return new A(u,l[o]);case E.NOT_SET:return new k(u,l[o]);case E.WILDCARD:return new I(u);default:throw"The specified transition type: "+e+" is not valid."}},W.prototype.stateFactory=function(t,e){if(null===this.stateFactories){var n=[];n[a.INVALID_TYPE]=null,n[a.BASIC]=function(){return new l},n[a.RULE_START]=function(){return new f},n[a.BLOCK_START]=function(){return new T},n[a.PLUS_BLOCK_START]=function(){return new m},n[a.STAR_BLOCK_START]=function(){return new _},n[a.TOKEN_START]=function(){return new y},n[a.RULE_STOP]=function(){return new d},n[a.BLOCK_END]=function(){return new h},n[a.STAR_LOOP_BACK]=function(){return new x},n[a.STAR_LOOP_ENTRY]=function(){return new v},n[a.PLUS_LOOP_BACK]=function(){return new g},n[a.LOOP_END]=function(){return new p},this.stateFactories=n}if(t>this.stateFactories.length||null===this.stateFactories[t])throw"The specified state type "+t+" is not valid.";var r=this.stateFactories[t]();if(null!==r)return r.ruleIndex=e,r},W.prototype.lexerActionFactory=function(t,e,n){if(null===this.actionFactories){var r=[];r[j.CHANNEL]=function(t,e){return new B(t)},r[j.CUSTOM]=function(t,e){return new U(t,e)},r[j.MODE]=function(t,e){return new G(t)},r[j.MORE]=function(t,e){return V.INSTANCE},r[j.POP_MODE]=function(t,e){return q.INSTANCE},r[j.PUSH_MODE]=function(t,e){return new z(t)},r[j.SKIP]=function(t,e){return M.INSTANCE},r[j.TYPE]=function(t,e){return new H(t)},this.actionFactories=r}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)},e.ATNDeserializer=W},function(t,e){function n(t){return void 0===t&&(t=null),this.readOnly=!1,this.verifyATN=null===t||t.verifyATN,this.generateRuleBypassTransitions=null!==t&&t.generateRuleBypassTransitions,this}n.defaultOptions=new n,n.defaultOptions.readOnly=!0,e.ATNDeserializationOptions=n},function(t,e){function n(){}function r(t){return this.actionType=t,this.isPositionDependent=!1,this}function i(){return r.call(this,n.SKIP),this}function o(t){return r.call(this,n.TYPE),this.type=t,this}function s(t){return r.call(this,n.PUSH_MODE),this.mode=t,this}function a(){return r.call(this,n.POP_MODE),this}function l(){return r.call(this,n.MORE),this}function u(t){return r.call(this,n.MODE),this.mode=t,this}function c(t,e){return r.call(this,n.CUSTOM),this.ruleIndex=t,this.actionIndex=e,this.isPositionDependent=!0,this}function h(t){return r.call(this,n.CHANNEL),this.channel=t,this}function p(t,e){return r.call(this,e.actionType),this.offset=t,this.action=e,this.isPositionDependent=!0,this}n.CHANNEL=0,n.CUSTOM=1,n.MODE=2,n.MORE=3,n.POP_MODE=4,n.PUSH_MODE=5,n.SKIP=6,n.TYPE=7,r.prototype.hashCode=function(){var t=new Hash;return this.updateHashCode(t),t.finish()},r.prototype.updateHashCode=function(t){t.update(this.actionType)},r.prototype.equals=function(t){return this===t},i.prototype=Object.create(r.prototype),i.prototype.constructor=i,i.INSTANCE=new i,i.prototype.execute=function(t){t.skip()},i.prototype.toString=function(){return"skip"},o.prototype=Object.create(r.prototype),o.prototype.constructor=o,o.prototype.execute=function(t){t.type=this.type},o.prototype.updateHashCode=function(t){t.update(this.actionType,this.type)},o.prototype.equals=function(t){return this===t||t instanceof o&&this.type===t.type},o.prototype.toString=function(){return"type("+this.type+")"},s.prototype=Object.create(r.prototype),s.prototype.constructor=s,s.prototype.execute=function(t){t.pushMode(this.mode)},s.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},s.prototype.equals=function(t){return this===t||t instanceof s&&this.mode===t.mode},s.prototype.toString=function(){return"pushMode("+this.mode+")"},a.prototype=Object.create(r.prototype),a.prototype.constructor=a,a.INSTANCE=new a,a.prototype.execute=function(t){t.popMode()},a.prototype.toString=function(){return"popMode"},l.prototype=Object.create(r.prototype),l.prototype.constructor=l,l.INSTANCE=new l,l.prototype.execute=function(t){t.more()},l.prototype.toString=function(){return"more"},u.prototype=Object.create(r.prototype),u.prototype.constructor=u,u.prototype.execute=function(t){t.mode(this.mode)},u.prototype.updateHashCode=function(t){t.update(this.actionType,this.mode)},u.prototype.equals=function(t){return this===t||t instanceof u&&this.mode===t.mode},u.prototype.toString=function(){return"mode("+this.mode+")"},c.prototype=Object.create(r.prototype),c.prototype.constructor=c,c.prototype.execute=function(t){t.action(null,this.ruleIndex,this.actionIndex)},c.prototype.updateHashCode=function(t){t.update(this.actionType,this.ruleIndex,this.actionIndex)},c.prototype.equals=function(t){return this===t||t instanceof c&&(this.ruleIndex===t.ruleIndex&&this.actionIndex===t.actionIndex)},h.prototype=Object.create(r.prototype),h.prototype.constructor=h,h.prototype.execute=function(t){t._channel=this.channel},h.prototype.updateHashCode=function(t){t.update(this.actionType,this.channel)},h.prototype.equals=function(t){return this===t||t instanceof h&&this.channel===t.channel},h.prototype.toString=function(){return"channel("+this.channel+")"},p.prototype=Object.create(r.prototype),p.prototype.constructor=p,p.prototype.execute=function(t){this.action.execute(t)},p.prototype.updateHashCode=function(t){t.update(this.actionType,this.offset,this.action)},p.prototype.equals=function(t){return this===t||t instanceof p&&(this.offset===t.offset&&this.action===t.action)},e.LexerActionType=n,e.LexerSkipAction=i,e.LexerChannelAction=h,e.LexerCustomAction=c,e.LexerIndexedCustomAction=p,e.LexerMoreAction=l,e.LexerTypeAction=o,e.LexerPushModeAction=s,e.LexerPopModeAction=a,e.LexerModeAction=u},function(t,e,n){var r=n(1).Token,i=n(16).ConsoleErrorListener,o=n(16).ProxyErrorListener;function s(){return this._listeners=[i.INSTANCE],this._interp=null,this._stateNumber=-1,this}s.tokenTypeMapCache={},s.ruleIndexMapCache={},s.prototype.checkVersion=function(t){"4.7"!==t&&console.log("ANTLR runtime and generated code versions disagree: 4.7!="+t)},s.prototype.addErrorListener=function(t){this._listeners.push(t)},s.prototype.removeErrorListeners=function(){this._listeners=[]},s.prototype.getTokenTypeMap=function(){var t=this.getTokenNames();if(null===t)throw"The current recognizer does not provide a list of token names.";var e=this.tokenTypeMapCache[t];return void 0===e&&((e=t.reduce(function(t,e,n){t[e]=n})).EOF=r.EOF,this.tokenTypeMapCache[t]=e),e},s.prototype.getRuleIndexMap=function(){var t=this.ruleNames;if(null===t)throw"The current recognizer does not provide a list of rule names.";var e=this.ruleIndexMapCache[t];return void 0===e&&(e=t.reduce(function(t,e,n){t[e]=n}),this.ruleIndexMapCache[t]=e),e},s.prototype.getTokenType=function(t){var e=this.getTokenTypeMap()[t];return void 0!==e?e:r.INVALID_TYPE},s.prototype.getErrorHeader=function(t){return"line "+t.getOffendingToken().line+":"+t.getOffendingToken().column},s.prototype.getTokenErrorDisplay=function(t){if(null===t)return"<no token>";var e=t.text;return null===e&&(e=t.type===r.EOF?"<EOF>":"<"+t.type+">"),"'"+(e=e.replace("\n","\\n").replace("\r","\\r").replace("\t","\\t"))+"'"},s.prototype.getErrorListenerDispatch=function(){return new o(this._listeners)},s.prototype.sempred=function(t,e,n){return!0},s.prototype.precpred=function(t,e){return!0},Object.defineProperty(s.prototype,"state",{get:function(){return this._stateNumber},set:function(t){this._stateNumber=t}}),e.Recognizer=s},function(t,e,n){var r=n(11).DFAState,i=n(9).ATNConfigSet,o=n(6).getCachedPredictionContext;function s(t,e){return this.atn=t,this.sharedContextCache=e,this}s.ERROR=new r(2147483647,new i),s.prototype.getCachedContext=function(t){if(null===this.sharedContextCache)return t;return o(t,this.sharedContextCache,{})},e.ATNSimulator=s},function(t,e,n){n(0).Set;var r=n(0).Map,i=n(0).BitSet,o=n(0).AltDict,s=n(7).ATN,a=n(3).RuleStopState,l=n(9).ATNConfigSet,u=n(13).ATNConfig,c=n(10).SemanticContext,h=(n(0).Hash,n(0).hashStuff);n(0).equalArrays;function p(){return this}p.SLL=0,p.LL=1,p.LL_EXACT_AMBIG_DETECTION=2,p.hasSLLConflictTerminatingPrediction=function(t,e){if(p.allConfigsInRuleStopStates(e))return!0;if(t===p.SLL&&e.hasSemanticContext){for(var n=new l,r=0;r<e.items.length;r++){var i=e.items[r];i=new u({semanticContext:c.NONE},i),n.add(i)}e=n}var o=p.getConflictingAltSubsets(e);return p.hasConflictingAltSet(o)&&!p.hasStateAssociatedWithOneAlt(e)},p.hasConfigInRuleStopState=function(t){for(var e=0;e<t.items.length;e++){if(t.items[e].state instanceof a)return!0}return!1},p.allConfigsInRuleStopStates=function(t){for(var e=0;e<t.items.length;e++){if(!(t.items[e].state instanceof a))return!1}return!0},p.resolvesToJustOneViableAlt=function(t){return p.getSingleViableAlt(t)},p.allSubsetsConflict=function(t){return!p.hasNonConflictingAltSet(t)},p.hasNonConflictingAltSet=function(t){for(var e=0;e<t.length;e++){if(1===t[e].length)return!0}return!1},p.hasConflictingAltSet=function(t){for(var e=0;e<t.length;e++){if(t[e].length>1)return!0}return!1},p.allSubsetsEqual=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n];if(null===e)e=r;else if(r!==e)return!1}return!0},p.getUniqueAlt=function(t){var e=p.getAlts(t);return 1===e.length?e.minValue():s.INVALID_ALT_NUMBER},p.getAlts=function(t){var e=new i;return t.map(function(t){e.or(t)}),e},p.getConflictingAltSubsets=function(t){var e=new r;return e.hashFunction=function(t){h(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){var n=e.get(t);null===n&&(n=new i,e.put(t,n)),n.add(t.alt)}),e.getValues()},p.getStateToAltMap=function(t){var e=new o;return t.items.map(function(t){var n=e.get(t.state);null===n&&(n=new i,e.put(t.state,n)),n.add(t.alt)}),e},p.hasStateAssociatedWithOneAlt=function(t){for(var e=p.getStateToAltMap(t).values(),n=0;n<e.length;n++)if(1===e[n].length)return!0;return!1},p.getSingleViableAlt=function(t){for(var e=null,n=0;n<t.length;n++){var r=t[n].minValue();if(null===e)e=r;else if(e!==r)return s.INVALID_ALT_NUMBER}return e},e.PredictionMode=p},function(t,e){String.prototype.codePointAt||function(){"use strict";var t=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),e=function(t){if(null==this)throw TypeError();var e=String(this),n=e.length,r=t?Number(t):0;if(r!=r&&(r=0),!(r<0||r>=n)){var i,o=e.charCodeAt(r);return o>=55296&&o<=56319&&n>r+1&&(i=e.charCodeAt(r+1))>=56320&&i<=57343?1024*(o-55296)+i-56320+65536:o}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}()},function(t,e){var n,r,i,o;String.fromCodePoint||(n=function(){try{var t={},e=Object.defineProperty,n=e(t,t,t)&&e}catch(t){}return n}(),r=String.fromCharCode,i=Math.floor,o=function(t){var e,n,o=[],s=-1,a=arguments.length;if(!a)return"";for(var l="";++s<a;){var u=Number(arguments[s]);if(!isFinite(u)||u<0||u>1114111||i(u)!=u)throw RangeError("Invalid code point: "+u);u<=65535?o.push(u):(e=55296+((u-=65536)>>10),n=u%1024+56320,o.push(e,n)),(s+1==a||o.length>16384)&&(l+=r.apply(null,o),o.length=0)}return l},n?n(String,"fromCodePoint",{value:o,configurable:!0,writable:!0}):String.fromCodePoint=o)},function(t,e,n){var r=n(1).Token,i=n(5),o=i.NoViableAltException,s=i.InputMismatchException,a=i.FailedPredicateException,l=i.ParseCancellationException,u=n(3).ATNState,c=n(2).Interval,h=n(2).IntervalSet;function p(){}function f(){return p.call(this),this.errorRecoveryMode=!1,this.lastErrorIndex=-1,this.lastErrorStates=null,this}function d(){return f.call(this),this}p.prototype.reset=function(t){},p.prototype.recoverInline=function(t){},p.prototype.recover=function(t,e){},p.prototype.sync=function(t){},p.prototype.inErrorRecoveryMode=function(t){},p.prototype.reportError=function(t){},f.prototype=Object.create(p.prototype),f.prototype.constructor=f,f.prototype.reset=function(t){this.endErrorCondition(t)},f.prototype.beginErrorCondition=function(t){this.errorRecoveryMode=!0},f.prototype.inErrorRecoveryMode=function(t){return this.errorRecoveryMode},f.prototype.endErrorCondition=function(t){this.errorRecoveryMode=!1,this.lastErrorStates=null,this.lastErrorIndex=-1},f.prototype.reportMatch=function(t){this.endErrorCondition(t)},f.prototype.reportError=function(t,e){this.inErrorRecoveryMode(t)||(this.beginErrorCondition(t),e instanceof o?this.reportNoViableAlternative(t,e):e instanceof s?this.reportInputMismatch(t,e):e instanceof a?this.reportFailedPredicate(t,e):(console.log("unknown recognition error type: "+e.constructor.name),console.log(e.stack),t.notifyErrorListeners(e.getOffendingToken(),e.getMessage(),e)))},f.prototype.recover=function(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);var n=this.getErrorRecoverySet(t);this.consumeUntil(t,n)},f.prototype.sync=function(t){if(!this.inErrorRecoveryMode(t)){var e=t._interp.atn.states[t.state],n=t.getTokenStream().LA(1),i=t.atn.nextTokens(e);if(!i.contains(r.EPSILON)&&!i.contains(n))switch(e.stateType){case u.BLOCK_START:case u.STAR_BLOCK_START:case u.PLUS_BLOCK_START:case u.STAR_LOOP_ENTRY:if(null!==this.singleTokenDeletion(t))return;throw new s(t);case u.PLUS_LOOP_BACK:case u.STAR_LOOP_BACK:this.reportUnwantedToken(t);var o=new h;o.addSet(t.getExpectedTokens());var a=o.addSet(this.getErrorRecoverySet(t));this.consumeUntil(t,a)}}},f.prototype.reportNoViableAlternative=function(t,e){var n,i=t.getTokenStream();n=null!==i?e.startToken.type===r.EOF?"<EOF>":i.getText(new c(e.startToken,e.offendingToken)):"<unknown input>";var o="no viable alternative at input "+this.escapeWSAndQuote(n);t.notifyErrorListeners(o,e.offendingToken,e)},f.prototype.reportInputMismatch=function(t,e){var n="mismatched input "+this.getTokenErrorDisplay(e.offendingToken)+" expecting "+e.getExpectedTokens().toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportFailedPredicate=function(t,e){var n="rule "+t.ruleNames[t._ctx.ruleIndex]+" "+e.message;t.notifyErrorListeners(n,e.offendingToken,e)},f.prototype.reportUnwantedToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="extraneous input "+this.getTokenErrorDisplay(e)+" expecting "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames);t.notifyErrorListeners(n,e,null)}},f.prototype.reportMissingToken=function(t){if(!this.inErrorRecoveryMode(t)){this.beginErrorCondition(t);var e=t.getCurrentToken(),n="missing "+this.getExpectedTokens(t).toString(t.literalNames,t.symbolicNames)+" at "+this.getTokenErrorDisplay(e);t.notifyErrorListeners(n,e,null)}},f.prototype.recoverInline=function(t){var e=this.singleTokenDeletion(t);if(null!==e)return t.consume(),e;if(this.singleTokenInsertion(t))return this.getMissingSymbol(t);throw new s(t)},f.prototype.singleTokenInsertion=function(t){var e=t.getTokenStream().LA(1),n=t._interp.atn,r=n.states[t.state].transitions[0].target;return!!n.nextTokens(r,t._ctx).contains(e)&&(this.reportMissingToken(t),!0)},f.prototype.singleTokenDeletion=function(t){var e=t.getTokenStream().LA(2);if(this.getExpectedTokens(t).contains(e)){this.reportUnwantedToken(t),t.consume();var n=t.getCurrentToken();return this.reportMatch(t),n}return null},f.prototype.getMissingSymbol=function(t){var e,n=t.getCurrentToken(),i=this.getExpectedTokens(t).first();e=i===r.EOF?"<missing EOF>":"<missing "+t.literalNames[i]+">";var o=n,s=t.getTokenStream().LT(-1);return o.type===r.EOF&&null!==s&&(o=s),t.getTokenFactory().create(o.source,i,e,r.DEFAULT_CHANNEL,-1,-1,o.line,o.column)},f.prototype.getExpectedTokens=function(t){return t.getExpectedTokens()},f.prototype.getTokenErrorDisplay=function(t){if(null===t)return"<no token>";var e=t.text;return null===e&&(e=t.type===r.EOF?"<EOF>":"<"+t.type+">"),this.escapeWSAndQuote(e)},f.prototype.escapeWSAndQuote=function(t){return"'"+(t=(t=(t=t.replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t"))+"'"},f.prototype.getErrorRecoverySet=function(t){for(var e=t._interp.atn,n=t._ctx,i=new h;null!==n&&n.invokingState>=0;){var o=e.states[n.invokingState].transitions[0],s=e.nextTokens(o.followState);i.addSet(s),n=n.parentCtx}return i.removeOne(r.EPSILON),i},f.prototype.consumeUntil=function(t,e){for(var n=t.getTokenStream().LA(1);n!==r.EOF&&!e.contains(n);)t.consume(),n=t.getTokenStream().LA(1)},d.prototype=Object.create(f.prototype),d.prototype.constructor=d,d.prototype.recover=function(t,e){for(var n=t._ctx;null!==n;)n.exception=e,n=n.parentCtx;throw new l(e)},d.prototype.recoverInline=function(t){this.recover(t,new s(t))},d.prototype.sync=function(t){},e.BailErrorStrategy=d,e.DefaultErrorStrategy=f},function(t,e){},function(t,e,n){Converter=n(33).Converter},function(module,exports,__webpack_require__){antlr4=__webpack_require__(12);var BlocklyGrammerVisitor=__webpack_require__(20).BlocklyGrammerVisitor,BlocklyGrammerLexer=__webpack_require__(51).BlocklyGrammerLexer,BlocklyGrammerParser=__webpack_require__(52).BlocklyGrammerParser,Visitors=__webpack_require__(53),SymbolVisitor=Visitors.SymbolVisitor,EvalVisitor=Visitors.EvalVisitor,tpl=__webpack_require__(54);function Converter(){return this}Converter.prototype.constructor=Converter,Converter.prototype.init=function(){return this.toolboxGap=5,this.toolboxId="toolbox",this.blocklyDivId="blocklyDiv",this.workSpaceName="workspace",this.codeAreaId="codeArea",this},Converter.prototype.main=function(t,e,n){return this.init(),this.generBlocks(t,e),this.renderGrammerName(),this.generToolbox(),this.generMainFile(e),this.writeMainFile(n),this},Converter.prototype.generBlocks=function(grammerFile,functions){functions||(functions={});var temp_consoleError=console.error;console.error=function(t){throw new Error(t)};var chars=new antlr4.InputStream(grammerFile),lexer=new BlocklyGrammerLexer(chars),tokens=new antlr4.CommonTokenStream(lexer),parser=new BlocklyGrammerParser(tokens);parser.buildParseTrees=!0;var tree=parser.grammarFile();console.error=temp_consoleError;var svisitor=(new SymbolVisitor).init();this.svisitor=svisitor,svisitor.visit(tree),svisitor.checkSymbol();var evisitor=(new EvalVisitor).init(svisitor,grammerFile);return this.evisitor=evisitor,eval(this.evisitor.matchInject("Function_0")),functions.Function_0&&functions.Function_0.call(this),evisitor.visit(tree),eval(this.evisitor.matchInject("Function_1")),functions.Function_1&&functions.Function_1.call(this),evisitor.generBlocks(),this.blocks=evisitor.blocks,eval(this.evisitor.matchInject("Function_2")),functions.Function_2&&functions.Function_2.call(this),this},Converter.prototype.renderGrammerName=function(){this.grammerName=this.svisitor.grammerName,this.generLanguage=this.evisitor.generLanguage;var t=this.grammerName,e=this.generLanguage;return this.OmitedError=tpl.OmitedError(),this.Functions_pre=tpl.Functions_pre(t),this.Functions_fieldDefault=tpl.Functions_fieldDefault(t),this.Functions_defaultCode=tpl.Functions_defaultCode(t),this.Functions_xmlText=tpl.Functions_xmlText(t),this.Functions_blocksIniter=tpl.Functions_blocksIniter(t,e),this.mainFileTPL=tpl.mainFileTPL,this},Converter.prototype.generToolbox=function(){var t=[];for(var e in t.push("{"),t.push("    // 每个键值对作为一页"),t.push('    "statement" : ['),t.push("      // 所有语句块"),this.evisitor.statementRules)this.evisitor.statementRules[e].type&&t.push("      "+this.grammerName+'Blocks["'+e+'"].xmlText(),');for(var e in t.push("    ],"),t.push('    "value" : ['),t.push("      // 所有值块"),this.evisitor.expressionRules)this.evisitor.expressionRules[e].type&&t.push("      "+this.grammerName+'Blocks["'+e+'"].xmlText(),');t.push("    ]"),t.push("  }");var n=t.join("\n");return this.toolbox=tpl.ToolboxObj(this.toolboxId,n,this.toolboxGap),this},Converter.prototype.generMainFile=function(t){t||(t={});var e=[],n=this.grammerName;e.push(this.blocks),e.push("\n\n"),e.push(this.OmitedError),e.push("\n\n"),e.push(n+"Functions={}\n\n"),e.push(this.evisitor.matchInject("Functions")),t.Functions&&e.push(t.Functions),e.push("\n\n"),e.push(this.Functions_pre),e.push("\n\n"),e.push(this.Functions_fieldDefault),e.push("\n\n"),e.push(this.Functions_defaultCode),e.push("\n\n"),e.push(this.Functions_xmlText),e.push("\n\n"),e.push(this.Functions_blocksIniter),e.push("\n\n"),e.push(n+"Functions.blocksIniter();\n\n"),this.mainFile=this.mainFileTPL(n,this.generLanguage,this.blocklyDivId,this.codeAreaId,this.toolbox,this.workSpaceName,this.toolboxId,e.join(""))},Converter.prototype.writeMainFile=function(t){t||(t=this.grammerName+"index.html"),this.createAndDownloadFile(this.mainFile.join(""),t,"html")},Converter.prototype.block=function(t){var e=this.evisitor.expressionRules[t];return e||(e=this.evisitor.statementRules[t]),e&&1!==e.checklength?e.blockjs:null},Converter.prototype.createAndDownloadFile=function(t,e,n){var r=new Blob([t],{type:"text/"+n}),i=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1}),o=document.createElement("a");o.href=window.URL.createObjectURL(r),o.download=e,o.textContent="Download file!",o.dispatchEvent(i)},exports.Converter=Converter},function(t,e,n){e.ATN=n(7).ATN,e.ATNDeserializer=n(22).ATNDeserializer,e.LexerATNSimulator=n(37).LexerATNSimulator,e.ParserATNSimulator=n(40).ParserATNSimulator,e.PredictionMode=n(27).PredictionMode},function(t,e,n){var r=n(0).Set,i=n(0).BitSet,o=n(1).Token,s=n(13).ATNConfig,a=(n(2).Interval,n(2).IntervalSet),l=n(3).RuleStopState,u=n(8).RuleTransition,c=n(8).NotSetTransition,h=n(8).WildcardTransition,p=n(8).AbstractPredicateTransition,f=n(6),d=f.predictionContextFromRuleContext,y=f.PredictionContext,g=f.SingletonPredictionContext;function x(t){this.atn=t}x.HIT_PRED=o.INVALID_TYPE,x.prototype.getDecisionLookahead=function(t){if(null===t)return null;for(var e=t.transitions.length,n=[],o=0;o<e;o++){n[o]=new a;var s=new r;this._LOOK(t.transition(o).target,null,y.EMPTY,n[o],s,new i,!1,!1),(0===n[o].length||n[o].contains(x.HIT_PRED))&&(n[o]=null)}return n},x.prototype.LOOK=function(t,e,n){var o=new a,s=null!==(n=n||null)?d(t.atn,n):null;return this._LOOK(t,e,s,o,new r,new i,!0,!0),o},x.prototype._LOOK=function(t,e,n,r,i,a,f,d){var v=new s({state:t,alt:0,context:n},null);if(!i.contains(v)){if(i.add(v),t===e){if(null===n)return void r.addOne(o.EPSILON);if(n.isEmpty()&&d)return void r.addOne(o.EOF)}if(t instanceof l){if(null===n)return void r.addOne(o.EPSILON);if(n.isEmpty()&&d)return void r.addOne(o.EOF);if(n!==y.EMPTY){for(var m=0;m<n.length;m++){var _=this.atn.states[n.getReturnState(m)],T=a.contains(_.ruleIndex);try{a.remove(_.ruleIndex),this._LOOK(_,e,n.getParent(m),r,i,a,f,d)}finally{T&&a.add(_.ruleIndex)}}return}}for(var S=0;S<t.transitions.length;S++){var E=t.transitions[S];if(E.constructor===u){if(a.contains(E.target.ruleIndex))continue;var C=g.create(n,E.followState.stateNumber);try{a.add(E.target.ruleIndex),this._LOOK(E.target,e,C,r,i,a,f,d)}finally{a.remove(E.target.ruleIndex)}}else if(E instanceof p)f?this._LOOK(E.target,e,n,r,i,a,f,d):r.addOne(x.HIT_PRED);else if(E.isEpsilon)this._LOOK(E.target,e,n,r,i,a,f,d);else if(E.constructor===h)r.addRange(o.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType);else{var A=E.label;null!==A&&(E instanceof c&&(A=A.complement(o.MIN_USER_TOKEN_TYPE,this.atn.maxTokenType)),r.addSet(A))}}}},e.LL1Analyzer=x},function(t,e){function n(){}n.LEXER=0,n.PARSER=1,e.ATNType=n},function(t,e,n){var r=n(1).Token,i=n(15).Lexer,o=n(7).ATN,s=n(26).ATNSimulator,a=n(11).DFAState,l=(n(9).ATNConfigSet,n(9).OrderedATNConfigSet),u=n(6).PredictionContext,c=n(6).SingletonPredictionContext,h=n(3).RuleStopState,p=n(13).LexerATNConfig,f=n(8).Transition,d=n(39).LexerActionExecutor,y=n(5).LexerNoViableAltException;function g(t){t.index=-1,t.line=0,t.column=-1,t.dfaState=null}function x(){return g(this),this}function v(t,e,n,r){return s.call(this,e,r),this.decisionToDFA=n,this.recog=t,this.startIndex=-1,this.line=1,this.column=0,this.mode=i.DEFAULT_MODE,this.prevAccept=new x,this}x.prototype.reset=function(){g(this)},v.prototype=Object.create(s.prototype),v.prototype.constructor=v,v.debug=!1,v.dfa_debug=!1,v.MIN_DFA_EDGE=0,v.MAX_DFA_EDGE=127,v.match_calls=0,v.prototype.copyState=function(t){this.column=t.column,this.line=t.line,this.mode=t.mode,this.startIndex=t.startIndex},v.prototype.match=function(t,e){this.match_calls+=1,this.mode=e;var n=t.mark();try{this.startIndex=t.index,this.prevAccept.reset();var r=this.decisionToDFA[e];return null===r.s0?this.matchATN(t):this.execATN(t,r.s0)}finally{t.release(n)}},v.prototype.reset=function(){this.prevAccept.reset(),this.startIndex=-1,this.line=1,this.column=0,this.mode=i.DEFAULT_MODE},v.prototype.matchATN=function(t){var e=this.atn.modeToStartState[this.mode];v.debug&&console.log("matchATN mode "+this.mode+" start: "+e);var n=this.mode,r=this.computeStartState(t,e),i=r.hasSemanticContext;r.hasSemanticContext=!1;var o=this.addDFAState(r);i||(this.decisionToDFA[this.mode].s0=o);var s=this.execATN(t,o);return v.debug&&console.log("DFA after matchATN: "+this.decisionToDFA[n].toLexerString()),s},v.prototype.execATN=function(t,e){v.debug&&console.log("start state closure="+e.configs),e.isAcceptState&&this.captureSimState(this.prevAccept,t,e);for(var n=t.LA(1),i=e;;){v.debug&&console.log("execATN loop starting closure: "+i.configs);var o=this.getExistingTargetState(i,n);if(null===o&&(o=this.computeTargetState(t,i,n)),o===s.ERROR)break;if(n!==r.EOF&&this.consume(t),o.isAcceptState&&(this.captureSimState(this.prevAccept,t,o),n===r.EOF))break;n=t.LA(1),i=o}return this.failOrAccept(this.prevAccept,t,i.configs,n)},v.prototype.getExistingTargetState=function(t,e){if(null===t.edges||e<v.MIN_DFA_EDGE||e>v.MAX_DFA_EDGE)return null;var n=t.edges[e-v.MIN_DFA_EDGE];return void 0===n&&(n=null),v.debug&&null!==n&&console.log("reuse state "+t.stateNumber+" edge to "+n.stateNumber),n},v.prototype.computeTargetState=function(t,e,n){var r=new l;return this.getReachableConfigSet(t,e.configs,r,n),0===r.items.length?(r.hasSemanticContext||this.addDFAEdge(e,n,s.ERROR),s.ERROR):this.addDFAEdge(e,n,null,r)},v.prototype.failOrAccept=function(t,e,n,i){if(null!==this.prevAccept.dfaState){var o=t.dfaState.lexerActionExecutor;return this.accept(e,o,this.startIndex,t.index,t.line,t.column),t.dfaState.prediction}if(i===r.EOF&&e.index===this.startIndex)return r.EOF;throw new y(this.recog,e,this.startIndex,n)},v.prototype.getReachableConfigSet=function(t,e,n,i){for(var s=o.INVALID_ALT_NUMBER,a=0;a<e.items.length;a++){var l=e.items[a],u=l.alt===s;if(!u||!l.passedThroughNonGreedyDecision){v.debug&&console.log("testing %s at %s\n",this.getTokenName(i),l.toString(this.recog,!0));for(var c=0;c<l.state.transitions.length;c++){var h=l.state.transitions[c],f=this.getReachableTarget(h,i);if(null!==f){var d=l.lexerActionExecutor;null!==d&&(d=d.fixOffsetBeforeMatch(t.index-this.startIndex));var y=i===r.EOF,g=new p({state:f,lexerActionExecutor:d},l);this.closure(t,g,n,u,!0,y)&&(s=l.alt)}}}}},v.prototype.accept=function(t,e,n,r,i,o){v.debug&&console.log("ACTION %s\n",e),t.seek(r),this.line=i,this.column=o,null!==e&&null!==this.recog&&e.execute(this.recog,t,n)},v.prototype.getReachableTarget=function(t,e){return t.matches(e,0,i.MAX_CHAR_VALUE)?t.target:null},v.prototype.computeStartState=function(t,e){for(var n=u.EMPTY,r=new l,i=0;i<e.transitions.length;i++){var o=e.transitions[i].target,s=new p({state:o,alt:i+1,context:n},null);this.closure(t,s,r,!1,!1,!1)}return r},v.prototype.closure=function(t,e,n,r,i,o){var s=null;if(v.debug&&console.log("closure("+e.toString(this.recog,!0)+")"),e.state instanceof h){if(v.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 p({state:e.state,context:u.EMPTY},e)),r=!0}if(null!==e.context&&!e.context.isEmpty())for(var a=0;a<e.context.length;a++)if(e.context.getReturnState(a)!==u.EMPTY_RETURN_STATE){var l=e.context.getParent(a),c=this.atn.states[e.context.getReturnState(a)];s=new p({state:c,context:l},e),r=this.closure(t,s,n,r,i,o)}return r}e.state.epsilonOnlyTransitions||r&&e.passedThroughNonGreedyDecision||n.add(e);for(var f=0;f<e.state.transitions.length;f++){var d=e.state.transitions[f];null!==(s=this.getEpsilonTarget(t,e,d,n,i,o))&&(r=this.closure(t,s,n,r,i,o))}return r},v.prototype.getEpsilonTarget=function(t,e,n,o,s,a){var l=null;if(n.serializationType===f.RULE){var u=c.create(e.context,n.followState.stateNumber);l=new p({state:n.target,context:u},e)}else{if(n.serializationType===f.PRECEDENCE)throw"Precedence predicates are not supported in lexers.";if(n.serializationType===f.PREDICATE)v.debug&&console.log("EVAL rule "+n.ruleIndex+":"+n.predIndex),o.hasSemanticContext=!0,this.evaluatePredicate(t,n.ruleIndex,n.predIndex,s)&&(l=new p({state:n.target},e));else if(n.serializationType===f.ACTION)if(null===e.context||e.context.hasEmptyPath()){var h=d.append(e.lexerActionExecutor,this.atn.lexerActions[n.actionIndex]);l=new p({state:n.target,lexerActionExecutor:h},e)}else l=new p({state:n.target},e);else n.serializationType===f.EPSILON?l=new p({state:n.target},e):n.serializationType!==f.ATOM&&n.serializationType!==f.RANGE&&n.serializationType!==f.SET||a&&n.matches(r.EOF,0,i.MAX_CHAR_VALUE)&&(l=new p({state:n.target},e))}return l},v.prototype.evaluatePredicate=function(t,e,n,r){if(null===this.recog)return!0;if(!r)return this.recog.sempred(null,e,n);var i=this.column,o=this.line,s=t.index,a=t.mark();try{return this.consume(t),this.recog.sempred(null,e,n)}finally{this.column=i,this.line=o,t.seek(s),t.release(a)}},v.prototype.captureSimState=function(t,e,n){t.index=e.index,t.line=this.line,t.column=this.column,t.dfaState=n},v.prototype.addDFAEdge=function(t,e,n,r){if(void 0===n&&(n=null),void 0===r&&(r=null),null===n&&null!==r){var i=r.hasSemanticContext;if(r.hasSemanticContext=!1,n=this.addDFAState(r),i)return n}return e<v.MIN_DFA_EDGE||e>v.MAX_DFA_EDGE?n:(v.debug&&console.log("EDGE "+t+" -> "+n+" upon "+e),null===t.edges&&(t.edges=[]),t.edges[e-v.MIN_DFA_EDGE]=n,n)},v.prototype.addDFAState=function(t){for(var e=new a(null,t),n=null,r=0;r<t.items.length;r++){var i=t.items[r];if(i.state instanceof h){n=i;break}}null!==n&&(e.isAcceptState=!0,e.lexerActionExecutor=n.lexerActionExecutor,e.prediction=this.atn.ruleToTokenType[n.state.ruleIndex]);var o=this.decisionToDFA[this.mode],s=o.states.get(e);if(null!==s)return s;var l=e;return l.stateNumber=o.states.length,t.setReadonly(!0),l.configs=t,o.states.add(l),l},v.prototype.getDFA=function(t){return this.decisionToDFA[t]},v.prototype.getText=function(t){return t.getText(this.startIndex,t.index-1)},v.prototype.consume=function(t){t.LA(1)==="\n".charCodeAt(0)?(this.line+=1,this.column=0):this.column+=1,t.consume()},v.prototype.getTokenName=function(t){return-1===t?"EOF":"'"+String.fromCharCode(t)+"'"},e.LexerATNSimulator=v},function(t,e,n){var r=n(1).CommonToken;function i(){return this}function o(t){return i.call(this),this.copyText=void 0!==t&&t,this}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.DEFAULT=new o,o.prototype.create=function(t,e,n,i,o,s,a,l){var u=new r(t,e,i,o,s);return u.line=a,u.column=l,null!==n?u.text=n:this.copyText&&null!==t[1]&&(u.text=t[1].getText(o,s)),u},o.prototype.createThin=function(t,e){var n=new r(null,t);return n.text=e,n},e.CommonTokenFactory=o},function(t,e,n){var r=n(0).hashStuff,i=n(24).LexerIndexedCustomAction;function o(t){return this.lexerActions=null===t?[]:t,this.cachedHashCode=r(t),this}o.append=function(t,e){return new o(null===t?[e]:t.lexerActions.concat([e]))},o.prototype.fixOffsetBeforeMatch=function(t){for(var e=null,n=0;n<this.lexerActions.length;n++)!this.lexerActions[n].isPositionDependent||this.lexerActions[n]instanceof i||(null===e&&(e=this.lexerActions.concat([])),e[n]=new i(t,this.lexerActions[n]));return null===e?this:new o(e)},o.prototype.execute=function(t,e,n){var r=!1,o=e.index;try{for(var s=0;s<this.lexerActions.length;s++){var a=this.lexerActions[s];if(a instanceof i){var l=a.offset;e.seek(n+l),a=a.action,r=n+l!==o}else a.isPositionDependent&&(e.seek(o),r=!1);a.execute(t)}}finally{r&&e.seek(o)}},o.prototype.hashCode=function(){return this.cachedHashCode},o.prototype.updateHashCode=function(t){t.update(this.cachedHashCode)},o.prototype.equals=function(t){if(this===t)return!0;if(t instanceof o){if(this.cachedHashCode!=t.cachedHashCode)return!1;if(this.lexerActions.length!=t.lexerActions.length)return!1;for(var e=this.lexerActions.length,n=0;n<e;++n)if(!this.lexerActions[n].equals(t.lexerActions[n]))return!1;return!0}return!1},e.LexerActionExecutor=o},function(t,e,n){var r=n(0),i=r.Set,o=r.BitSet,s=r.DoubleDict,a=n(7).ATN,l=n(3).ATNState,u=n(13).ATNConfig,c=n(9).ATNConfigSet,h=n(1).Token,p=n(11).DFAState,f=n(11).PredPrediction,d=n(26).ATNSimulator,y=n(27).PredictionMode,g=n(14).RuleContext,x=(n(18).ParserRuleContext,n(10).SemanticContext),v=(n(3).StarLoopEntryState,n(3).RuleStopState),m=n(6).PredictionContext,_=n(2).Interval,T=n(8),S=T.Transition,E=T.SetTransition,C=T.NotSetTransition,A=T.RuleTransition,k=T.ActionTransition,b=n(5).NoViableAltException,R=n(6).SingletonPredictionContext,L=n(6).predictionContextFromRuleContext;function N(t,e,n,r){return d.call(this,e,r),this.parser=t,this.decisionToDFA=n,this.predictionMode=y.LL,this._input=null,this._startIndex=0,this._outerContext=null,this._dfa=null,this.mergeCache=null,this}N.prototype=Object.create(d.prototype),N.prototype.constructor=N,N.prototype.debug=!1,N.prototype.debug_closure=!1,N.prototype.debug_add=!1,N.prototype.debug_list_atn_decisions=!1,N.prototype.dfa_debug=!1,N.prototype.retry_debug=!1,N.prototype.reset=function(){},N.prototype.adaptivePredict=function(t,e,n){(this.debug||this.debug_list_atn_decisions)&&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;var r=this.decisionToDFA[e];this._dfa=r;var i=t.mark(),o=t.index;try{var s;if(null===(s=r.precedenceDfa?r.getPrecedenceStartState(this.parser.getPrecedence()):r.s0)){null===n&&(n=g.EMPTY),(this.debug||this.debug_list_atn_decisions)&&console.log("predictATN decision "+r.decision+" exec LA(1)=="+this.getLookaheadName(t)+", outerContext="+n.toString(this.parser.ruleNames));var a=this.computeStartState(r.atnStartState,g.EMPTY,!1);r.precedenceDfa?(r.s0.configs=a,a=this.applyPrecedenceFilter(a),s=this.addDFAState(r,new p(null,a)),r.setPrecedenceStartState(this.parser.getPrecedence(),s)):(s=this.addDFAState(r,new p(null,a)),r.s0=s)}var l=this.execATN(r,s,t,o,n);return this.debug&&console.log("DFA after predictATN: "+r.toString(this.parser.literalNames)),l}finally{this._dfa=null,this.mergeCache=null,t.seek(o),t.release(i)}},N.prototype.execATN=function(t,e,n,r,i){var o;(this.debug||this.debug_list_atn_decisions)&&console.log("execATN decision "+t.decision+" exec LA(1)=="+this.getLookaheadName(n)+" line "+n.LT(1).line+":"+n.LT(1).column);var s=e;this.debug&&console.log("s0 = "+e);for(var l=n.LA(1);;){var u=this.getExistingTargetState(s,l);if(null===u&&(u=this.computeTargetState(t,s,l)),u===d.ERROR){var c=this.noViableAlt(n,i,s.configs,r);if(n.seek(r),(o=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(s.configs,i))!==a.INVALID_ALT_NUMBER)return o;throw c}if(u.requiresFullContext&&this.predictionMode!==y.SLL){var p=null;if(null!==u.predicates){this.debug&&console.log("DFA state has preds in DFA sim LL failover");var f=n.index;if(f!==r&&n.seek(r),1===(p=this.evalSemanticContext(u.predicates,i,!0)).length)return this.debug&&console.log("Full LL avoided"),p.minValue();f!==r&&n.seek(f)}this.dfa_debug&&console.log("ctx sensitive state "+i+" in "+u);var g=this.computeStartState(t.atnStartState,i,!0);return this.reportAttemptingFullContext(t,p,u.configs,r,n.index),o=this.execATNWithFullContext(t,u,g,n,r,i)}if(u.isAcceptState){if(null===u.predicates)return u.prediction;var x=n.index;n.seek(r);var v=this.evalSemanticContext(u.predicates,i,!0);if(0===v.length)throw this.noViableAlt(n,i,u.configs,r);return 1===v.length?v.minValue():(this.reportAmbiguity(t,u,r,x,!1,v,u.configs),v.minValue())}s=u,l!==h.EOF&&(n.consume(),l=n.LA(1))}},N.prototype.getExistingTargetState=function(t,e){var n=t.edges;return null===n?null:n[e+1]||null},N.prototype.computeTargetState=function(t,e,n){var i=this.computeReachSet(e.configs,n,!1);if(null===i)return this.addDFAEdge(t,e,n,d.ERROR),d.ERROR;var o=new p(null,i),s=this.getUniqueAlt(i);if(this.debug){var l=y.getConflictingAltSubsets(i);console.log("SLL altSubSets="+r.arrayToString(l)+", previous="+e.configs+", configs="+i+", predict="+s+", allSubsetsConflict="+y.allSubsetsConflict(l)+", conflictingAlts="+this.getConflictingAlts(i))}return s!==a.INVALID_ALT_NUMBER?(o.isAcceptState=!0,o.configs.uniqueAlt=s,o.prediction=s):y.hasSLLConflictTerminatingPrediction(this.predictionMode,i)&&(o.configs.conflictingAlts=this.getConflictingAlts(i),o.requiresFullContext=!0,o.isAcceptState=!0,o.prediction=o.configs.conflictingAlts.minValue()),o.isAcceptState&&o.configs.hasSemanticContext&&(this.predicateDFAState(o,this.atn.getDecisionState(t.decision)),null!==o.predicates&&(o.prediction=a.INVALID_ALT_NUMBER)),o=this.addDFAEdge(t,e,n,o)},N.prototype.predicateDFAState=function(t,e){var n=e.transitions.length,r=this.getConflictingAltsOrUniqueAlt(t.configs),i=this.getPredsForAmbigAlts(r,t.configs,n);null!==i?(t.predicates=this.getPredicatePredictions(r,i),t.prediction=a.INVALID_ALT_NUMBER):t.prediction=r.minValue()},N.prototype.execATNWithFullContext=function(t,e,n,r,i,o){(this.debug||this.debug_list_atn_decisions)&&console.log("execATNWithFullContext "+n);var s=!1,l=null,u=n;r.seek(i);for(var c=r.LA(1),p=-1;;){if(null===(l=this.computeReachSet(u,c,!0))){var f=this.noViableAlt(r,o,u,i);r.seek(i);var d=this.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule(u,o);if(d!==a.INVALID_ALT_NUMBER)return d;throw f}var g=y.getConflictingAltSubsets(l);if(this.debug&&console.log("LL altSubSets="+g+", predict="+y.getUniqueAlt(g)+", resolvesToJustOneViableAlt="+y.resolvesToJustOneViableAlt(g)),l.uniqueAlt=this.getUniqueAlt(l),l.uniqueAlt!==a.INVALID_ALT_NUMBER){p=l.uniqueAlt;break}if(this.predictionMode!==y.LL_EXACT_AMBIG_DETECTION){if((p=y.resolvesToJustOneViableAlt(g))!==a.INVALID_ALT_NUMBER)break}else if(y.allSubsetsConflict(g)&&y.allSubsetsEqual(g)){s=!0,p=y.getSingleViableAlt(g);break}u=l,c!==h.EOF&&(r.consume(),c=r.LA(1))}return l.uniqueAlt!==a.INVALID_ALT_NUMBER?(this.reportContextSensitivity(t,p,l,i,r.index),p):(this.reportAmbiguity(t,e,i,r.index,s,null,l),p)},N.prototype.computeReachSet=function(t,e,n){this.debug&&console.log("in computeReachSet, starting closure: "+t),null===this.mergeCache&&(this.mergeCache=new s);for(var r=new c(n),o=null,l=0;l<t.items.length;l++){var p=t.items[l];if(this.debug_add&&console.log("testing "+this.getTokenName(e)+" at "+p),p.state instanceof v)(n||e===h.EOF)&&(null===o&&(o=[]),o.push(p),this.debug_add&&console.log("added "+p+" to skippedStopStates"));else for(var f=0;f<p.state.transitions.length;f++){var d=p.state.transitions[f],g=this.getReachableTarget(d,e);if(null!==g){var x=new u({state:g},p);r.add(x,this.mergeCache),this.debug_add&&console.log("added "+x+" to intermediate")}}}var m=null;if(null===o&&e!==h.EOF&&(1===r.items.length?m=r:this.getUniqueAlt(r)!==a.INVALID_ALT_NUMBER&&(m=r)),null===m){m=new c(n);for(var _=new i,T=e===h.EOF,S=0;S<r.items.length;S++)this.closure(r.items[S],m,_,!1,n,T)}if(e===h.EOF&&(m=this.removeAllConfigsNotInRuleStopState(m,m===r)),!(null===o||n&&y.hasConfigInRuleStopState(m)))for(var E=0;E<o.length;E++)m.add(o[E],this.mergeCache);return 0===m.items.length?null:m},N.prototype.removeAllConfigsNotInRuleStopState=function(t,e){if(y.allConfigsInRuleStopStates(t))return t;for(var n=new c(t.fullCtx),r=0;r<t.items.length;r++){var i=t.items[r];if(i.state instanceof v)n.add(i,this.mergeCache);else if(e&&i.state.epsilonOnlyTransitions)if(this.atn.nextTokens(i.state).contains(h.EPSILON)){var o=this.atn.ruleToStopState[i.state.ruleIndex];n.add(new u({state:o},i),this.mergeCache)}}return n},N.prototype.computeStartState=function(t,e,n){for(var r=L(this.atn,e),o=new c(n),s=0;s<t.transitions.length;s++){var a=t.transitions[s].target,l=new u({state:a,alt:s+1,context:r},null),h=new i;this.closure(l,o,h,!0,n,!1)}return o},N.prototype.applyPrecedenceFilter=function(t){for(var e,n=[],r=new c(t.fullCtx),i=0;i<t.items.length;i++)if(1===(e=t.items[i]).alt){var o=e.semanticContext.evalPrecedence(this.parser,this._outerContext);null!==o&&(n[e.state.stateNumber]=e.context,o!==e.semanticContext?r.add(new u({semanticContext:o},e),this.mergeCache):r.add(e,this.mergeCache))}for(i=0;i<t.items.length;i++)if(1!==(e=t.items[i]).alt){if(!e.precedenceFilterSuppressed){var s=n[e.state.stateNumber]||null;if(null!==s&&s.equals(e.context))continue}r.add(e,this.mergeCache)}return r},N.prototype.getReachableTarget=function(t,e){return t.matches(e,0,this.atn.maxTokenType)?t.target:null},N.prototype.getPredsForAmbigAlts=function(t,e,n){for(var i=[],o=0;o<e.items.length;o++){var s=e.items[o];t.contains(s.alt)&&(i[s.alt]=x.orContext(i[s.alt]||null,s.semanticContext))}var a=0;for(o=1;o<n+1;o++){var l=i[o]||null;null===l?i[o]=x.NONE:l!==x.NONE&&(a+=1)}return 0===a&&(i=null),this.debug&&console.log("getPredsForAmbigAlts result "+r.arrayToString(i)),i},N.prototype.getPredicatePredictions=function(t,e){for(var n=[],r=!1,i=1;i<e.length;i++){var o=e[i];null!==t&&t.contains(i)&&n.push(new f(o,i)),o!==x.NONE&&(r=!0)}return r?n:null},N.prototype.getSynValidOrSemInvalidAltThatFinishedDecisionEntryRule=function(t,e){var n=this.splitAccordingToSemanticValidity(t,e),r=n[0],i=n[1],o=this.getAltThatFinishedDecisionEntryRule(r);return o!==a.INVALID_ALT_NUMBER?o:i.items.length>0&&(o=this.getAltThatFinishedDecisionEntryRule(i))!==a.INVALID_ALT_NUMBER?o:a.INVALID_ALT_NUMBER},N.prototype.getAltThatFinishedDecisionEntryRule=function(t){for(var e=[],n=0;n<t.items.length;n++){var r=t.items[n];(r.reachesIntoOuterContext>0||r.state instanceof v&&r.context.hasEmptyPath())&&e.indexOf(r.alt)<0&&e.push(r.alt)}return 0===e.length?a.INVALID_ALT_NUMBER:Math.min.apply(null,e)},N.prototype.splitAccordingToSemanticValidity=function(t,e){for(var n=new c(t.fullCtx),r=new c(t.fullCtx),i=0;i<t.items.length;i++){var o=t.items[i];if(o.semanticContext!==x.NONE)o.semanticContext.evaluate(this.parser,e)?n.add(o):r.add(o);else n.add(o)}return[n,r]},N.prototype.evalSemanticContext=function(t,e,n){for(var r=new o,i=0;i<t.length;i++){var s=t[i];if(s.pred!==x.NONE){var a=s.pred.evaluate(this.parser,e);if((this.debug||this.dfa_debug)&&console.log("eval pred "+s+"="+a),a&&((this.debug||this.dfa_debug)&&console.log("PREDICT "+s.alt),r.add(s.alt),!n))break}else if(r.add(s.alt),!n)break}return r},N.prototype.closure=function(t,e,n,r,i,o){this.closureCheckingStopState(t,e,n,r,i,0,o)},N.prototype.closureCheckingStopState=function(t,e,n,r,i,o,s){if((this.debug||this.debug_closure)&&(console.log("closure("+t.toString(this.parser,!0)+")"),t.reachesIntoOuterContext>50))throw"problem";if(t.state instanceof v){if(!t.context.isEmpty()){for(var a=0;a<t.context.length;a++)if(t.context.getReturnState(a)!==m.EMPTY_RETURN_STATE){var l=this.atn.states[t.context.getReturnState(a)],c=t.context.getParent(a),h={state:l,alt:t.alt,context:c,semanticContext:t.semanticContext},p=new u(h,null);p.reachesIntoOuterContext=t.reachesIntoOuterContext,this.closureCheckingStopState(p,e,n,r,i,o-1,s)}else{if(i){e.add(new u({state:t.state,context:m.EMPTY},t),this.mergeCache);continue}this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex)),this.closure_(t,e,n,r,i,o,s)}return}if(i)return void e.add(t,this.mergeCache);this.debug&&console.log("FALLING off rule "+this.getRuleName(t.state.ruleIndex))}this.closure_(t,e,n,r,i,o,s)},N.prototype.closure_=function(t,e,n,r,i,o,s){var a=t.state;a.epsilonOnlyTransitions||e.add(t,this.mergeCache);for(var l=0;l<a.transitions.length;l++)if(0!=l||!this.canDropLoopEntryEdgeInLeftRecursiveRule(t)){var u=a.transitions[l],c=r&&!(u instanceof k),h=this.getEpsilonTarget(t,u,c,0===o,i,s);if(null!==h){if(!u.isEpsilon&&n.add(h)!==h)continue;var p=o;if(t.state instanceof v){if(n.add(h)!==h)continue;null!==this._dfa&&this._dfa.precedenceDfa&&u.outermostPrecedenceReturn===this._dfa.atnStartState.ruleIndex&&(h.precedenceFilterSuppressed=!0),h.reachesIntoOuterContext+=1,e.dipsIntoOuterContext=!0,p-=1,this.debug&&console.log("dips into outer ctx: "+h)}else u instanceof A&&p>=0&&(p+=1);this.closureCheckingStopState(h,e,n,c,i,p,s)}}},N.prototype.canDropLoopEntryEdgeInLeftRecursiveRule=function(t){var e=t.state;if(e.stateType!=l.STAR_LOOP_ENTRY)return!1;if(e.stateType!=l.STAR_LOOP_ENTRY||!e.isPrecedenceDecision||t.context.isEmpty()||t.context.hasEmptyPath())return!1;for(var n=t.context.length,r=0;r<n;r++){if((s=this.atn.states[t.context.getReturnState(r)]).ruleIndex!=e.ruleIndex)return!1}var i=e.transitions[0].target.endState.stateNumber,o=this.atn.states[i];for(r=0;r<n;r++){var s,a=t.context.getReturnState(r);if(1!=(s=this.atn.states[a]).transitions.length||!s.transitions[0].isEpsilon)return!1;var u=s.transitions[0].target;if((s.stateType!=l.BLOCK_END||u!=e)&&(s!=o&&u!=o&&(u.stateType!=l.BLOCK_END||1!=u.transitions.length||!u.transitions[0].isEpsilon||u.transitions[0].target!=e)))return!1}return!0},N.prototype.getRuleName=function(t){return null!==this.parser&&t>=0?this.parser.ruleNames[t]:"<rule "+t+">"},N.prototype.getEpsilonTarget=function(t,e,n,r,i,o){switch(e.serializationType){case S.RULE:return this.ruleTransition(t,e);case S.PRECEDENCE:return this.precedenceTransition(t,e,n,r,i);case S.PREDICATE:return this.predTransition(t,e,n,r,i);case S.ACTION:return this.actionTransition(t,e);case S.EPSILON:return new u({state:e.target},t);case S.ATOM:case S.RANGE:case S.SET:return o&&e.matches(h.EOF,0,1)?new u({state:e.target},t):null;default:return null}},N.prototype.actionTransition=function(t,e){if(this.debug){var n=-1==e.actionIndex?65535:e.actionIndex;console.log("ACTION edge "+e.ruleIndex+":"+n)}return new u({state:e.target},t)},N.prototype.precedenceTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.precedence+">=_p, ctx dependent=true"),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&i)if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=x.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},N.prototype.predTransition=function(t,e,n,i,o){this.debug&&(console.log("PRED (collectPredicates="+n+") "+e.ruleIndex+":"+e.predIndex+", ctx dependent="+e.isCtxDependent),null!==this.parser&&console.log("context surrounding pred is "+r.arrayToString(this.parser.getRuleInvocationStack())));var s=null;if(n&&(e.isCtxDependent&&i||!e.isCtxDependent))if(o){var a=this._input.index;this._input.seek(this._startIndex);var l=e.getPredicate().evaluate(this.parser,this._outerContext);this._input.seek(a),l&&(s=new u({state:e.target},t))}else{var c=x.andContext(t.semanticContext,e.getPredicate());s=new u({state:e.target,semanticContext:c},t)}else s=new u({state:e.target},t);return this.debug&&console.log("config from pred transition="+s),s},N.prototype.ruleTransition=function(t,e){this.debug&&console.log("CALL rule "+this.getRuleName(e.target.ruleIndex)+", ctx="+t.context);var n=e.followState,r=R.create(t.context,n.stateNumber);return new u({state:e.target,context:r},t)},N.prototype.getConflictingAlts=function(t){var e=y.getConflictingAltSubsets(t);return y.getAlts(e)},N.prototype.getConflictingAltsOrUniqueAlt=function(t){var e=null;return t.uniqueAlt!==a.INVALID_ALT_NUMBER?(e=new o).add(t.uniqueAlt):e=t.conflictingAlts,e},N.prototype.getTokenName=function(t){if(t===h.EOF)return"EOF";if(null!==this.parser&&null!==this.parser.literalNames){if(!(t>=this.parser.literalNames.length&&t>=this.parser.symbolicNames.length))return(this.parser.literalNames[t]||this.parser.symbolicNames[t])+"<"+t+">";console.log(t+" ttype out of range: "+this.parser.literalNames),console.log(""+this.parser.getInputStream().getTokens())}return""+t},N.prototype.getLookaheadName=function(t){return this.getTokenName(t.LA(1))},N.prototype.dumpDeadEndConfigs=function(t){console.log("dead end configs: ");for(var e=t.getDeadEndConfigs(),n=0;n<e.length;n++){var r=e[n],i="no edges";if(r.state.transitions.length>0){var o=r.state.transitions[0];if(o instanceof AtomTransition)i="Atom "+this.getTokenName(o.label);else if(o instanceof E){i=(o instanceof C?"~":"")+"Set "+o.set}}console.error(r.toString(this.parser,!0)+":"+i)}},N.prototype.noViableAlt=function(t,e,n,r){return new b(this.parser,t,t.get(r),t.LT(1),n,e)},N.prototype.getUniqueAlt=function(t){for(var e=a.INVALID_ALT_NUMBER,n=0;n<t.items.length;n++){var r=t.items[n];if(e===a.INVALID_ALT_NUMBER)e=r.alt;else if(r.alt!==e)return a.INVALID_ALT_NUMBER}return e},N.prototype.addDFAEdge=function(t,e,n,r){if(this.debug&&console.log("EDGE "+e+" -> "+r+" upon "+this.getTokenName(n)),null===r)return null;if(r=this.addDFAState(t,r),null===e||n<-1||n>this.atn.maxTokenType)return r;if(null===e.edges&&(e.edges=[]),e.edges[n+1]=r,this.debug){var i=null===this.parser?null:this.parser.literalNames,o=null===this.parser?null:this.parser.symbolicNames;console.log("DFA=\n"+t.toString(i,o))}return r},N.prototype.addDFAState=function(t,e){if(e==d.ERROR)return e;var n=t.states.get(e);return null!==n?n:(e.stateNumber=t.states.length,e.configs.readOnly||(e.configs.optimizeConfigs(this),e.configs.setReadonly(!0)),t.states.add(e),this.debug&&console.log("adding new DFA state: "+e),e)},N.prototype.reportAttemptingFullContext=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new _(r,i+1);console.log("reportAttemptingFullContext decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAttemptingFullContext(this.parser,t,r,i,e,n)},N.prototype.reportContextSensitivity=function(t,e,n,r,i){if(this.debug||this.retry_debug){var o=new _(r,i+1);console.log("reportContextSensitivity decision="+t.decision+":"+n+", input="+this.parser.getTokenStream().getText(o))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportContextSensitivity(this.parser,t,r,i,e,n)},N.prototype.reportAmbiguity=function(t,e,n,r,i,o,s){if(this.debug||this.retry_debug){var a=new _(n,r+1);console.log("reportAmbiguity "+o+":"+s+", input="+this.parser.getTokenStream().getText(a))}null!==this.parser&&this.parser.getErrorListenerDispatch().reportAmbiguity(this.parser,t,n,r,i,o,s)},e.ParserATNSimulator=N},function(t,e,n){e.DFA=n(42).DFA,e.DFASerializer=n(17).DFASerializer,e.LexerDFASerializer=n(17).LexerDFASerializer,e.PredPrediction=n(11).PredPrediction},function(t,e,n){var r=n(0).Set,i=n(11).DFAState,o=n(3).StarLoopEntryState,s=n(9).ATNConfigSet,a=n(17).DFASerializer,l=n(17).LexerDFASerializer;function u(t,e){if(void 0===e&&(e=0),this.atnStartState=t,this.decision=e,this._states=new r,this.s0=null,this.precedenceDfa=!1,t instanceof o&&t.isPrecedenceDecision){this.precedenceDfa=!0;var n=new i(null,new s);n.edges=[],n.isAcceptState=!1,n.requiresFullContext=!1,this.s0=n}return this}u.prototype.getPrecedenceStartState=function(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},u.prototype.setPrecedenceStartState=function(t,e){if(!this.precedenceDfa)throw"Only precedence DFAs may contain a precedence start state.";t<0||(this.s0.edges[t]=e)},u.prototype.setPrecedenceDfa=function(t){if(this.precedenceDfa!==t){if(this._states=new DFAStatesSet,t){var e=new i(null,new s);e.edges=[],e.isAcceptState=!1,e.requiresFullContext=!1,this.s0=e}else this.s0=null;this.precedenceDfa=t}},Object.defineProperty(u.prototype,"states",{get:function(){return this._states}}),u.prototype.sortedStates=function(){return this._states.values().sort(function(t,e){return t.stateNumber-e.stateNumber})},u.prototype.toString=function(t,e){return t=t||null,e=e||null,null===this.s0?"":new a(this,t,e).toString()},u.prototype.toLexerString=function(){return null===this.s0?"":new l(this).toString()},e.DFA=u},function(t,e,n){var r=n(4);e.Trees=n(21).Trees,e.RuleNode=r.RuleNode,e.ParseTreeListener=r.ParseTreeListener,e.ParseTreeVisitor=r.ParseTreeVisitor,e.ParseTreeWalker=r.ParseTreeWalker},function(t,e,n){e.RecognitionException=n(5).RecognitionException,e.NoViableAltException=n(5).NoViableAltException,e.LexerNoViableAltException=n(5).LexerNoViableAltException,e.InputMismatchException=n(5).InputMismatchException,e.FailedPredicateException=n(5).FailedPredicateException,e.DiagnosticErrorListener=n(45).DiagnosticErrorListener,e.BailErrorStrategy=n(30).BailErrorStrategy,e.ErrorListener=n(16).ErrorListener},function(t,e,n){var r=n(0).BitSet,i=n(16).ErrorListener,o=n(2).Interval;function s(t){return i.call(this),t=t||!0,this.exactOnly=t,this}s.prototype=Object.create(i.prototype),s.prototype.constructor=s,s.prototype.reportAmbiguity=function(t,e,n,r,i,s,a){if(!this.exactOnly||i){var l="reportAmbiguity d="+this.getDecisionDescription(t,e)+": ambigAlts="+this.getConflictingAlts(s,a)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(l)}},s.prototype.reportAttemptingFullContext=function(t,e,n,r,i,s){var a="reportAttemptingFullContext d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.reportContextSensitivity=function(t,e,n,r,i,s){var a="reportContextSensitivity d="+this.getDecisionDescription(t,e)+", input='"+t.getTokenStream().getText(new o(n,r))+"'";t.notifyErrorListeners(a)},s.prototype.getDecisionDescription=function(t,e){var n=e.decision,r=e.atnStartState.ruleIndex,i=t.ruleNames;if(r<0||r>=i.length)return""+n;var o=i[r]||null;return null===o||0===o.length?""+n:n+" ("+o+")"},s.prototype.getConflictingAlts=function(t,e){if(null!==t)return t;for(var n=new r,i=0;i<e.items.length;i++)n.add(e.items[i].alt);return"{"+n.values().join(", ")+"}"},e.DiagnosticErrorListener=s},function(t,e,n){var r=n(19).InputStream,i="undefined"==typeof window&&"undefined"==typeof importScripts?n(31):null,o={fromString:function(t){return new r(t,!0)},fromBlob:function(t,e,n,i){var o=FileReader();o.onload=function(t){var e=new r(t.target.result,!0);n(e)},o.onerror=i,o.readAsText(t,e)},fromBuffer:function(t,e){return new r(t.toString(e),!0)},fromPath:function(t,e,n){i.readFile(t,e,function(t,e){var i=null;null!==e&&(i=new r(e,!0)),n(t,i)})},fromPathSync:function(t,e){var n=i.readFileSync(t,e);return new r(n,!0)}};e.CharStreams=o},function(t,e,n){var r=n(19).InputStream,i="undefined"==typeof window&&"undefined"==typeof importScripts?n(31):null;function o(t,e){var n=i.readFileSync(t,"utf8");return r.call(this,n,e),this.fileName=t,this}o.prototype=Object.create(r.prototype),o.prototype.constructor=o,e.FileStream=o},function(t,e,n){var r=n(1).Token,i=n(49).BufferedTokenStream;function o(t,e){return i.call(this,t),this.channel=void 0===e?r.DEFAULT_CHANNEL:e,this}o.prototype=Object.create(i.prototype),o.prototype.constructor=o,o.prototype.adjustSeekIndex=function(t){return this.nextTokenOnChannel(t,this.channel)},o.prototype.LB=function(t){if(0===t||this.index-t<0)return null;for(var e=this.index,n=1;n<=t;)e=this.previousTokenOnChannel(e-1,this.channel),n+=1;return e<0?null:this.tokens[e]},o.prototype.LT=function(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);for(var e=this.index,n=1;n<t;)this.sync(e+1)&&(e=this.nextTokenOnChannel(e+1,this.channel)),n+=1;return this.tokens[e]},o.prototype.getNumberOfOnChannelTokens=function(){var t=0;this.fill();for(var e=0;e<this.tokens.length;e++){var n=this.tokens[e];if(n.channel===this.channel&&(t+=1),n.type===r.EOF)break}return t},e.CommonTokenStream=o},function(t,e,n){var r=n(1).Token,i=n(15).Lexer,o=n(2).Interval;function s(){return this}function a(t){return s.call(this),this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1,this}a.prototype=Object.create(s.prototype),a.prototype.constructor=a,a.prototype.mark=function(){return 0},a.prototype.release=function(t){},a.prototype.reset=function(){this.seek(0)},a.prototype.seek=function(t){this.lazyInit(),this.index=this.adjustSeekIndex(t)},a.prototype.get=function(t){return this.lazyInit(),this.tokens[t]},a.prototype.consume=function(){if(!(this.index>=0&&(this.fetchedEOF?this.index<this.tokens.length-1:this.index<this.tokens.length))&&this.LA(1)===r.EOF)throw"cannot consume EOF";this.sync(this.index+1)&&(this.index=this.adjustSeekIndex(this.index+1))},a.prototype.sync=function(t){var e=t-this.tokens.length+1;return!(e>0)||this.fetch(e)>=e},a.prototype.fetch=function(t){if(this.fetchedEOF)return 0;for(var e=0;e<t;e++){var n=this.tokenSource.nextToken();if(n.tokenIndex=this.tokens.length,this.tokens.push(n),n.type===r.EOF)return this.fetchedEOF=!0,e+1}return t},a.prototype.getTokens=function(t,e,n){if(void 0===n&&(n=null),t<0||e<0)return null;this.lazyInit();var i=[];e>=this.tokens.length&&(e=this.tokens.length-1);for(var o=t;o<e;o++){var s=this.tokens[o];if(s.type===r.EOF)break;(null===n||n.contains(s.type))&&i.push(s)}return i},a.prototype.LA=function(t){return this.LT(t).type},a.prototype.LB=function(t){return this.index-t<0?null:this.tokens[this.index-t]},a.prototype.LT=function(t){if(this.lazyInit(),0===t)return null;if(t<0)return this.LB(-t);var e=this.index+t-1;return this.sync(e),e>=this.tokens.length?this.tokens[this.tokens.length-1]:this.tokens[e]},a.prototype.adjustSeekIndex=function(t){return t},a.prototype.lazyInit=function(){-1===this.index&&this.setup()},a.prototype.setup=function(){this.sync(0),this.index=this.adjustSeekIndex(0)},a.prototype.setTokenSource=function(t){this.tokenSource=t,this.tokens=[],this.index=-1,this.fetchedEOF=!1},a.prototype.nextTokenOnChannel=function(t,e){if(this.sync(t),t>=this.tokens.length)return-1;for(var n=this.tokens[t];n.channel!==this.channel;){if(n.type===r.EOF)return-1;t+=1,this.sync(t),n=this.tokens[t]}return t},a.prototype.previousTokenOnChannel=function(t,e){for(;t>=0&&this.tokens[t].channel!==e;)t-=1;return t},a.prototype.getHiddenTokensToRight=function(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;var n=this.nextTokenOnChannel(t+1,i.DEFAULT_TOKEN_CHANNEL),r=t+1,o=-1===n?this.tokens.length-1:n;return this.filterForChannel(r,o,e)},a.prototype.getHiddenTokensToLeft=function(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;var n=this.previousTokenOnChannel(t-1,i.DEFAULT_TOKEN_CHANNEL);if(n===t-1)return null;var r=n+1,o=t-1;return this.filterForChannel(r,o,e)},a.prototype.filterForChannel=function(t,e,n){for(var r=[],o=t;o<e+1;o++){var s=this.tokens[o];-1===n?s.channel!==i.DEFAULT_TOKEN_CHANNEL&&r.push(s):s.channel===n&&r.push(s)}return 0===r.length?null:r},a.prototype.getSourceName=function(){return this.tokenSource.getSourceName()},a.prototype.getText=function(t){this.lazyInit(),this.fill(),void 0!==t&&null!==t||(t=new o(0,this.tokens.length-1));var e=t.start;e instanceof r&&(e=e.tokenIndex);var n=t.stop;if(n instanceof r&&(n=n.tokenIndex),null===e||null===n||e<0||n<0)return"";n>=this.tokens.length&&(n=this.tokens.length-1);for(var i="",s=e;s<n+1;s++){var a=this.tokens[s];if(a.type===r.EOF)break;i+=a.text}return i},a.prototype.fill=function(){for(this.lazyInit();1e3===this.fetch(1e3););},e.BufferedTokenStream=a},function(t,e,n){var r=n(1).Token,i=n(4).ParseTreeListener,o=n(25).Recognizer,s=n(30).DefaultErrorStrategy,a=n(22).ATNDeserializer,l=n(23).ATNDeserializationOptions,u=n(4).TerminalNode,c=n(4).ErrorNode;function h(t){return i.call(this),this.parser=t,this}function p(t){return o.call(this),this._input=null,this._errHandler=new s,this._precedenceStack=[],this._precedenceStack.push(0),this._ctx=null,this.buildParseTrees=!0,this._tracer=null,this._parseListeners=null,this._syntaxErrors=0,this.setInputStream(t),this}h.prototype=Object.create(i.prototype),h.prototype.constructor=h,h.prototype.enterEveryRule=function(t){console.log("enter   "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},h.prototype.visitTerminal=function(t){console.log("consume "+t.symbol+" rule "+this.parser.ruleNames[this.parser._ctx.ruleIndex])},h.prototype.exitEveryRule=function(t){console.log("exit    "+this.parser.ruleNames[t.ruleIndex]+", LT(1)="+this.parser._input.LT(1).text)},p.prototype=Object.create(o.prototype),p.prototype.contructor=p,p.bypassAltsAtnCache={},p.prototype.reset=function(){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()},p.prototype.match=function(t){var 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},p.prototype.matchWildcard=function(){var 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},p.prototype.getParseListeners=function(){return this._parseListeners||[]},p.prototype.addParseListener=function(t){if(null===t)throw"listener";null===this._parseListeners&&(this._parseListeners=[]),this._parseListeners.push(t)},p.prototype.removeParseListener=function(t){if(null!==this._parseListeners){var e=this._parseListeners.indexOf(t);e>=0&&this._parseListeners.splice(e,1),0===this._parseListeners.length&&(this._parseListeners=null)}},p.prototype.removeParseListeners=function(){this._parseListeners=null},p.prototype.triggerEnterRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.map(function(e){e.enterEveryRule(t),t.enterRule(e)})}},p.prototype.triggerExitRuleEvent=function(){if(null!==this._parseListeners){var t=this._ctx;this._parseListeners.slice(0).reverse().map(function(e){t.exitRule(e),e.exitEveryRule(t)})}},p.prototype.getTokenFactory=function(){return this._input.tokenSource._factory},p.prototype.setTokenFactory=function(t){this._input.tokenSource._factory=t},p.prototype.getATNWithBypassAlts=function(){var t=this.getSerializedATN();if(null===t)throw"The current parser does not support an ATN with bypass alternatives.";var e=this.bypassAltsAtnCache[t];if(null===e){var n=new l;n.generateRuleBypassTransitions=!0,e=new a(n).deserialize(t),this.bypassAltsAtnCache[t]=e}return e};var f=n(15).Lexer;p.prototype.compileParseTreePattern=function(t,e,n){if(null===(n=n||null)&&null!==this.getTokenStream()){var r=this.getTokenStream().tokenSource;r instanceof f&&(n=r)}if(null===n)throw"Parser can't discover a lexer to use";return new ParseTreePatternMatcher(n,this).compile(t,e)},p.prototype.getInputStream=function(){return this.getTokenStream()},p.prototype.setInputStream=function(t){this.setTokenStream(t)},p.prototype.getTokenStream=function(){return this._input},p.prototype.setTokenStream=function(t){this._input=null,this.reset(),this._input=t},p.prototype.getCurrentToken=function(){return this._input.LT(1)},p.prototype.notifyErrorListeners=function(t,e,n){e=e||null,n=n||null,null===e&&(e=this.getCurrentToken()),this._syntaxErrors+=1;var r=e.line,i=e.column;this.getErrorListenerDispatch().syntaxError(this,e,r,i,t,n)},p.prototype.consume=function(){var t=this.getCurrentToken();t.type!==r.EOF&&this.getInputStream().consume();var e,n=null!==this._parseListeners&&this._parseListeners.length>0;(this.buildParseTrees||n)&&((e=this._errHandler.inErrorRecoveryMode(this)?this._ctx.addErrorNode(t):this._ctx.addTokenNode(t)).invokingState=this.state,n&&this._parseListeners.map(function(t){e instanceof c||void 0!==e.isErrorNode&&e.isErrorNode()?t.visitErrorNode(e):e instanceof u&&t.visitTerminal(e)}));return t},p.prototype.addContextToParseTree=function(){null!==this._ctx.parentCtx&&this._ctx.parentCtx.addChild(this._ctx)},p.prototype.enterRule=function(t,e,n){this.state=e,this._ctx=t,this._ctx.start=this._input.LT(1),this.buildParseTrees&&this.addContextToParseTree(),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.exitRule=function(){this._ctx.stop=this._input.LT(-1),null!==this._parseListeners&&this.triggerExitRuleEvent(),this.state=this._ctx.invokingState,this._ctx=this._ctx.parentCtx},p.prototype.enterOuterAlt=function(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},p.prototype.getPrecedence=function(){return 0===this._precedenceStack.length?-1:this._precedenceStack[this._precedenceStack.length-1]},p.prototype.enterRecursionRule=function(t,e,n,r){this.state=e,this._precedenceStack.push(r),this._ctx=t,this._ctx.start=this._input.LT(1),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.pushNewRecursionContext=function(t,e,n){var r=this._ctx;r.parentCtx=t,r.invokingState=e,r.stop=this._input.LT(-1),this._ctx=t,this._ctx.start=r.start,this.buildParseTrees&&this._ctx.addChild(r),null!==this._parseListeners&&this.triggerEnterRuleEvent()},p.prototype.unrollRecursionContexts=function(t){this._precedenceStack.pop(),this._ctx.stop=this._input.LT(-1);var e=this._ctx;if(null!==this._parseListeners)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)},p.prototype.getInvokingContext=function(t){for(var e=this._ctx;null!==e;){if(e.ruleIndex===t)return e;e=e.parentCtx}return null},p.prototype.precpred=function(t,e){return e>=this._precedenceStack[this._precedenceStack.length-1]},p.prototype.inContext=function(t){return!1},p.prototype.isExpectedToken=function(t){var e=this._interp.atn,n=this._ctx,i=e.states[this.state],o=e.nextTokens(i);if(o.contains(t))return!0;if(!o.contains(r.EPSILON))return!1;for(;null!==n&&n.invokingState>=0&&o.contains(r.EPSILON);){var s=e.states[n.invokingState].transitions[0];if((o=e.nextTokens(s.followState)).contains(t))return!0;n=n.parentCtx}return!(!o.contains(r.EPSILON)||t!==r.EOF)},p.prototype.getExpectedTokens=function(){return this._interp.atn.getExpectedTokens(this.state,this._ctx)},p.prototype.getExpectedTokensWithinCurrentRule=function(){var t=this._interp.atn,e=t.states[this.state];return t.nextTokens(e)},p.prototype.getRuleIndex=function(t){var e=this.getRuleIndexMap()[t];return null!==e?e:-1},p.prototype.getRuleInvocationStack=function(t){null===(t=t||null)&&(t=this._ctx);for(var e=[];null!==t;){var n=t.ruleIndex;n<0?e.push("n/a"):e.push(this.ruleNames[n]),t=t.parentCtx}return e},p.prototype.getDFAStrings=function(){return this._interp.decisionToDFA.toString()},p.prototype.dumpDFA=function(){for(var t=!1,e=0;e<this._interp.decisionToDFA.length;e++){var 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)}},p.prototype.getSourceName=function(){return this._input.sourceName},p.prototype.setTrace=function(t){t?(null!==this._tracer&&this.removeParseListener(this._tracer),this._tracer=new h(this),this.addParseListener(this._tracer)):(this.removeParseListener(this._tracer),this._tracer=null)},e.Parser=p},function(t,e,n){var r=n(12),i=["悋Ꜫ脳맭䅼㯧瞆奤","ŝ\b\t\t","\t\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v","\f\t\f\r\t\r\t\t","\t\t\t\t","\t\t\t","\t\t\t\t","\t\t\t","\t\t \t ","","","","","","","","","","","","","","\b\b\t\t\n\n","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\v\v\v\v\v","\v\f\f\r\r","","Ó\n\fÖ","\v","Ü\n\fß\v","ã\n\fæ\v","ê\n","ï\n\fò","\v","ù\n","þ\n\fā\v","Ĉ\n","","","ę\n","Ĝ\n","ġ\n\rĢ","","ī\n\fĮ\v","","","Ŀ\n\fł","\v","Ō\n\f","ŏ\v ","    ŗ\n \f  Ś\v  "," ÔĬŀ!","\t\v\r\b\t\n\v\f\r","!#%","')+-/13579",";=?__C\\","2;C\\aac|c|$$^^\n$$11^^dd","hhppttvv))^^\n))11^^ddhhppttvv2;CHch",'\v\v""\f\f==~~',"ũ","\t","\v\r","","","","","!","#%","35","79;","=?","AI","K\t","\v\r","","","ÄÆ","ÈÊ","Ì!Ù","#à%é'ë",")õ+ú","-Ą/ĉ","1ď3đ","5ě7Ġ","9Ħ;Ĵ=Ň","?ŒABi","BCtCDcDEo","EFoFGcGHtH","IJ=J","KLuLMvMNc","NOvOPGPQzQR","rRStSTUTUr","UVnVWkWXv",'XY"YZ<Z["[\\',")\\]?]^?^_",'?_`"`auabv',"bcccdvdeg","efofggghphi",'vij"jk`kl"',"lm?mn?no?",'op"pqgqrzrs',"rstttuguvu","vwuwxkxyq",'yzpz{"{|x|}','"}~?~?',"?)",'"=\b',"<\n","~\f","gz","rt","gu","ukq","p","A","-",",","Og","cp","kp ","i ¡h¡¢","w¢£n£¤U","¤¥r¥¦n","¦§k§¨v¨",'©"©ª<ª«','"«¬)¬­',"?­®?®¯?",'¯°"°±o',"±²g²³c³","´p´µkµ¶","p¶·i·¸","h¸¹w¹ºn",'º»"»¼`','¼½"½¾?¾',"¿?¿À?ÀÁ",')ÁÂ"ÂÃ',"=ÃÄÅ","*ÅÆÇ","+ÇÈÉ","ÉÊË","0ËÌÔ","]ÍÎ^ÎÓ^","ÏÐ^ÐÓ_","ÑÓ\nÒÍ","ÒÏÒÑ","ÓÖÔÕ","ÔÒÕ×","ÖÔ×Ø_","Ø ÙÝ\tÚ","Ü\tÛÚÜ","ßÝÛÝ",'ÞÞ"ß',"Ýàä\tá","ã\tâáã","æäâä","åå$æ","äçê+è","ê'éçé","èê&ë","ð$ìï)íï","\nîìîí","ïòðî","ðññó","òðóô","$ô(õø","^öù\t÷ù/","øöø÷","ù*úÿ)","ûþ-üþ\n\býû","ýüþā","ÿýÿĀ","ĀĂāÿ","Ăă)ă,","Ąć^ąĈ\t\t","ĆĈ/ćą","ćĆĈ.","ĉĊwĊċ1","ċČ1Čč1č","Ď1Ď0ďĐ","\t\nĐ2đĒ%","Ēē!ēĔ","Ĕĕ\bĕ4","ĖĘėę\f","ĘėĘę","ęĜĚĜ\f","ěĖěĚ","ĜĝĝĞ\b","Ğ6ğġ\t\vĠ","ğġĢĢ","ĠĢģģ","ĤĤĥ\bĥ","8Ħħ1ħĨ",",ĨĬĩī","\vĪĩīĮ","ĬĭĬĪ","ĭįĮĬ","įİ,İı","1ıĲĲĳ","\bĳ:Ĵĵ","hĵĶtĶķc","ķĸiĸĹo","ĹĺgĺĻpĻ","ļvļŀĽ","Ŀ\vľĽĿ","łŀŁŀ","ľŁŃł","ŀŃń=ń","ŅŅņ\bņ","<Ňň1ňŉ","1ŉōŊŌ","\n\fŋŊŌŏ","ōŋōŎ","ŎŐŏō","Őő\bő>","Œœ/œŔ@","ŔŘŕŗ\n\r","ŖŕŗŚ","ŘŖŘř","řśŚŘ","śŜ\b Ŝ@","ÒÔÝäéîðøýÿćĘ","ěĢĬŀōŘ\b"].join(""),o=(new r.atn.ATNDeserializer).deserialize(i),s=o.decisionToState.map(function(t,e){return new r.dfa.DFA(t,e)});function a(t){return r.Lexer.call(this,t),this._interp=new r.atn.LexerATNSimulator(this,o,s,new r.PredictionContextCache),this}a.prototype=Object.create(r.Lexer.prototype),a.prototype.constructor=a,a.EOF=r.Token.EOF,a.T__0=1,a.T__1=2,a.T__2=3,a.T__3=4,a.T__4=5,a.T__5=6,a.T__6=7,a.T__7=8,a.T__8=9,a.T__9=10,a.T__10=11,a.T__11=12,a.T__12=13,a.T__13=14,a.Brackets=15,a.LexerIdentifier=16,a.ParserIdentifier=17,a.String=18,a.LabelForParserRule=19,a.Newline=20,a.WhiteSpace=21,a.BlockComment=22,a.FragmentComment=23,a.LineComment=24,a.ArrowComment=25,a.prototype.channelNames=["DEFAULT_TOKEN_CHANNEL","HIDDEN"],a.prototype.modeNames=["DEFAULT_MODE"],a.prototype.literalNames=[null,"'grammar'","';'","'statExprSplit : '=== statement ^ === expression v ===' ;'","':'","'|'","'expression'","'?'","'+'","'*'","'MeaningfulSplit : '=== meaningful ^ ===' ;'","'('","')'","'~'","'.'"],a.prototype.symbolicNames=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"Brackets","LexerIdentifier","ParserIdentifier","String","LabelForParserRule","Newline","WhiteSpace","BlockComment","FragmentComment","LineComment","ArrowComment"],a.prototype.ruleNames=["T__0","T__1","T__2","T__3","T__4","T__5","T__6","T__7","T__8","T__9","T__10","T__11","T__12","T__13","Brackets","LexerIdentifier","ParserIdentifier","String","STRING_double","ESC_double","STRING_single","ESC_single","UNICODE","HEX","LabelForParserRule","Newline","WhiteSpace","BlockComment","FragmentComment","LineComment","ArrowComment"],a.prototype.grammarFileName="BlocklyGrammer.g4",e.BlocklyGrammerLexer=a},function(t,e,n){var r=n(12),i=n(20).BlocklyGrammerVisitor,o=["悋Ꜫ脳맭䅼㯧瞆奤","Õ\t\t","\t\t\t\t","\b\t\b\t\t\t\n\t\n\v\t\v\f\t\f","\r\t\r\n\f"," \v$\n","\f'\v","","","8\n\r9","@\n\fC\v","F\n","L\n","Q\nS\n\fV\v","\\","\n\f_\vb\n","f\n\f","i\v\b\b\b\bn\n\b\bp\n\b","\b\b\b\bu\n\b\bw\n\b\b\b\b","\b|\n\b\b~\n\b\b\b\b\b\n\b","\b\n\b\b\n\b\t\t\n\t\f\t","\t\v\t\n\n\v\v\v","\v\v\v\v\v\v","\v\v\n\v\r\v\v","\v\v\v\v\v\v","\v\v¦\n\v\f\f\f\f«","\n\f\f­\n\f\f¯\n\f\r\f\f°\r","\r\r\r\r\r\r\r\r\r","\r\r\r\r\r\rÂ\n\r\r\r","\r\r\r\r\r\r\r\r","\rÎ\n\r\rÐ\n\r\f\r\rÓ\v\r\r","%\b\n\f","\t\v","\n\vð,","0\bE","\na\fc","","¥®","Á","\b"," ","!"," !%",'"$\n#"$\'',"%&%#","&('%()","\t)*\n*+\t+",",--../","/01","12334","4756","687589","979::;",";F<==A",">@\b?>@","CA?AB","BDCADF","E2E<F\t","GH\bHK","IL\fJLKI","KJLTMP","NQ\fOQPN","POQS","RMSVTR","TUUWVT","WbXYY]","Z\\\b[Z","\\_][]^","^`_]`b","aGaX","b\vcg\bdf","\bedfige","ghh\r","igjo\bkm\t","ln\tmlmn","npokop","pqv","rt\tsu\tts","tuuwvr","vwwx}","y{\tz|\t{z","{||~","}y}~~","\t","\t","","","j","qx","","\v","","","\f","","\f","¦","","\f","\f","","","¦"," ¡¡¢","¢£\r£¤","¤¦¥","¥¥ ","¦§¬","¨ª\t©«\t","ª©ª«","«­¬¨","¬­­¯","®§¯°","°®°±","±²³\b\r³","´\r´µ\rµ¶","¶Â·¸","¸Â\r\b¹Â","º»»¼","¼½½Â","¾Â¿Â","ÀÂÁ²","Á·Á¹","ÁºÁ¾","Á¿ÁÀ","ÂÑÃÄ\f","\vÄÅÅÐ","\r\fÆÇ\f\nÇÐ\r\v","ÈÉ\f\rÉÐ\tÊË","\f\fËÍ\tÌÎ\t","ÍÌÍÎ","ÎÐÏÃ","ÏÆÏÈ","ÏÊÐÓ","ÑÏÑÒ","ÒÓÑ"," %9AEKPT]agmotv{}¥","ª¬°ÁÍÏÑ"].join(""),s=(new r.atn.ATNDeserializer).deserialize(o),a=s.decisionToState.map(function(t,e){return new r.dfa.DFA(t,e)}),l=new r.PredictionContextCache,u=[null,"'grammar'","';'","'statExprSplit : '=== statement ^ === expression v ===' ;'","':'","'|'","'expression'","'?'","'+'","'*'","'MeaningfulSplit : '=== meaningful ^ ===' ;'","'('","')'","'~'","'.'"],c=[null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"Brackets","LexerIdentifier","ParserIdentifier","String","LabelForParserRule","Newline","WhiteSpace","BlockComment","FragmentComment","LineComment","ArrowComment"],h=["grammarFile","grammerDecl","statExprSplit","statementRule","expressionRule","arithmeticRuleCollection","parserRuleAtom","lexerRuleCollection","meaningfulSplit","lexerRule","strings","lexerRuleExpr"];function p(t){return r.Parser.call(this,t),this._interp=new r.atn.ParserATNSimulator(this,s,a,l),this.ruleNames=h,this.literalNames=u,this.symbolicNames=c,this}function f(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_grammarFile,this}function d(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_grammerDecl,this}function y(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_statExprSplit,this}function g(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_statementRule,this}function x(t,e){return g.call(this,t),g.prototype.copyFrom.call(this,e),this}function v(t,e){return g.call(this,t),g.prototype.copyFrom.call(this,e),this}function m(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_expressionRule,this}function _(t,e){return m.call(this,t),m.prototype.copyFrom.call(this,e),this}function T(t,e){return m.call(this,t),m.prototype.copyFrom.call(this,e),this}function S(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_arithmeticRuleCollection,this}function E(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_parserRuleAtom,this}function C(t,e){return E.call(this,t),E.prototype.copyFrom.call(this,e),this}function A(t,e){return E.call(this,t),E.prototype.copyFrom.call(this,e),this}function k(t,e){return E.call(this,t),E.prototype.copyFrom.call(this,e),this}function b(t,e){return E.call(this,t),E.prototype.copyFrom.call(this,e),this}function R(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_lexerRuleCollection,this}function L(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_meaningfulSplit,this}function N(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_lexerRule,this}function I(t,e){return N.call(this,t),N.prototype.copyFrom.call(this,e),this}function O(t,e){return N.call(this,t),N.prototype.copyFrom.call(this,e),this}function P(t,e){return N.call(this,t),N.prototype.copyFrom.call(this,e),this}function w(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_strings,this}function F(t,e,n){return void 0===e&&(e=null),void 0!==n&&null!==n||(n=-1),r.ParserRuleContext.call(this,e,n),this.parser=t,this.ruleIndex=p.RULE_lexerRuleExpr,this}p.prototype=Object.create(r.Parser.prototype),p.prototype.constructor=p,Object.defineProperty(p.prototype,"atn",{get:function(){return s}}),p.EOF=r.Token.EOF,p.T__0=1,p.T__1=2,p.T__2=3,p.T__3=4,p.T__4=5,p.T__5=6,p.T__6=7,p.T__7=8,p.T__8=9,p.T__9=10,p.T__10=11,p.T__11=12,p.T__12=13,p.T__13=14,p.Brackets=15,p.LexerIdentifier=16,p.ParserIdentifier=17,p.String=18,p.LabelForParserRule=19,p.Newline=20,p.WhiteSpace=21,p.BlockComment=22,p.FragmentComment=23,p.LineComment=24,p.ArrowComment=25,p.RULE_grammarFile=0,p.RULE_grammerDecl=1,p.RULE_statExprSplit=2,p.RULE_statementRule=3,p.RULE_expressionRule=4,p.RULE_arithmeticRuleCollection=5,p.RULE_parserRuleAtom=6,p.RULE_lexerRuleCollection=7,p.RULE_meaningfulSplit=8,p.RULE_lexerRule=9,p.RULE_strings=10,p.RULE_lexerRuleExpr=11,f.prototype=Object.create(r.ParserRuleContext.prototype),f.prototype.constructor=f,f.prototype.grammerDecl=function(){return this.getTypedRuleContext(d,0)},f.prototype.statExprSplit=function(){return this.getTypedRuleContext(y,0)},f.prototype.lexerRuleCollection=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(R):this.getTypedRuleContext(R,t)},f.prototype.meaningfulSplit=function(){return this.getTypedRuleContext(L,0)},f.prototype.statementRule=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(g):this.getTypedRuleContext(g,t)},f.prototype.expressionRule=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(m):this.getTypedRuleContext(m,t)},f.prototype.accept=function(t){return t instanceof i?t.visitGrammarFile(this):t.visitChildren(this)},p.GrammarFileContext=f,p.prototype.grammarFile=function(){var t=new f(this,this._ctx,this.state);this.enterRule(t,0,p.RULE_grammarFile);try{this.enterOuterAlt(t,1),this.state=24,this.grammerDecl(),this.state=28,this._errHandler.sync(this);for(var e=this._interp.adaptivePredict(this._input,0,this._ctx);1!=e&&e!=r.atn.ATN.INVALID_ALT_NUMBER;)2===e&&(this.state=25,this.statementRule()),this.state=30,this._errHandler.sync(this),e=this._interp.adaptivePredict(this._input,0,this._ctx);this.state=31,this.statExprSplit(),this.state=35,this._errHandler.sync(this);for(e=this._interp.adaptivePredict(this._input,1,this._ctx);1!=e&&e!=r.atn.ATN.INVALID_ALT_NUMBER;)2===e&&(this.state=32,this.expressionRule()),this.state=37,this._errHandler.sync(this),e=this._interp.adaptivePredict(this._input,1,this._ctx);this.state=38,this.lexerRuleCollection(),this.state=39,this.meaningfulSplit(),this.state=40,this.lexerRuleCollection()}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},d.prototype=Object.create(r.ParserRuleContext.prototype),d.prototype.constructor=d,d.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},d.prototype.accept=function(t){return t instanceof i?t.visitGrammerDecl(this):t.visitChildren(this)},p.GrammerDeclContext=d,p.prototype.grammerDecl=function(){var t=new d(this,this._ctx,this.state);this.enterRule(t,2,p.RULE_grammerDecl);try{this.enterOuterAlt(t,1),this.state=42,this.match(p.T__0),this.state=43,this.match(p.LexerIdentifier),this.state=44,this.match(p.T__1)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},y.prototype=Object.create(r.ParserRuleContext.prototype),y.prototype.constructor=y,y.prototype.accept=function(t){return t instanceof i?t.visitStatExprSplit(this):t.visitChildren(this)},p.StatExprSplitContext=y,p.prototype.statExprSplit=function(){var t=new y(this,this._ctx,this.state);this.enterRule(t,4,p.RULE_statExprSplit);try{this.enterOuterAlt(t,1),this.state=46,this.match(p.T__2)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},g.prototype=Object.create(r.ParserRuleContext.prototype),g.prototype.constructor=g,g.prototype.copyFrom=function(t){r.ParserRuleContext.prototype.copyFrom.call(this,t)},x.prototype=Object.create(g.prototype),x.prototype.constructor=x,p.StatValueContext=x,x.prototype.ParserIdentifier=function(){return this.getToken(p.ParserIdentifier,0)},x.prototype.parserRuleAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(E):this.getTypedRuleContext(E,t)},x.prototype.accept=function(t){return t instanceof i?t.visitStatValue(this):t.visitChildren(this)},v.prototype=Object.create(g.prototype),v.prototype.constructor=v,p.StatListContext=v,v.prototype.ParserIdentifier=function(t){return void 0===t&&(t=null),null===t?this.getTokens(p.ParserIdentifier):this.getToken(p.ParserIdentifier,t)},v.prototype.accept=function(t){return t instanceof i?t.visitStatList(this):t.visitChildren(this)},p.StatementRuleContext=g,p.prototype.statementRule=function(){var t=new g(this,this._ctx,this.state);this.enterRule(t,6,p.RULE_statementRule);var e=0;try{switch(this.state=67,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,4,this._ctx)){case 1:t=new v(this,t),this.enterOuterAlt(t,1),this.state=48,this.match(p.ParserIdentifier),this.state=49,this.match(p.T__3),this.state=50,this.match(p.ParserIdentifier),this.state=53,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=51,this.match(p.T__4),this.state=52,this.match(p.ParserIdentifier),this.state=55,this._errHandler.sync(this),e=this._input.LA(1)}while(e===p.T__4);this.state=57,this.match(p.T__1);break;case 2:for(t=new x(this,t),this.enterOuterAlt(t,2),this.state=58,this.match(p.ParserIdentifier),this.state=59,this.match(p.T__3),this.state=63,this._errHandler.sync(this),e=this._input.LA(1);0==(-32&e)&&0!=(1<<e&(1<<p.T__5|1<<p.LexerIdentifier|1<<p.ParserIdentifier|1<<p.String));)this.state=60,this.parserRuleAtom(),this.state=65,this._errHandler.sync(this),e=this._input.LA(1);this.state=66,this.match(p.T__1)}}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},m.prototype=Object.create(r.ParserRuleContext.prototype),m.prototype.constructor=m,m.prototype.copyFrom=function(t){r.ParserRuleContext.prototype.copyFrom.call(this,t)},_.prototype=Object.create(m.prototype),_.prototype.constructor=_,p.ExprExpressionContext=_,_.prototype.arithmeticRuleCollection=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(S):this.getTypedRuleContext(S,t)},_.prototype.ParserIdentifier=function(t){return void 0===t&&(t=null),null===t?this.getTokens(p.ParserIdentifier):this.getToken(p.ParserIdentifier,t)},_.prototype.accept=function(t){return t instanceof i?t.visitExprExpression(this):t.visitChildren(this)},T.prototype=Object.create(m.prototype),T.prototype.constructor=T,p.ExprValueContext=T,T.prototype.ParserIdentifier=function(){return this.getToken(p.ParserIdentifier,0)},T.prototype.parserRuleAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(E):this.getTypedRuleContext(E,t)},T.prototype.accept=function(t){return t instanceof i?t.visitExprValue(this):t.visitChildren(this)},p.ExpressionRuleContext=m,p.prototype.expressionRule=function(){var t=new m(this,this._ctx,this.state);this.enterRule(t,8,p.RULE_expressionRule);var e=0;try{switch(this.state=95,this._errHandler.sync(this),this._input.LA(1)){case p.T__5:switch(t=new _(this,t),this.enterOuterAlt(t,1),this.state=69,this.match(p.T__5),this.state=70,this.match(p.T__3),this.state=73,this._errHandler.sync(this),this._input.LA(1)){case p.T__5:this.state=71,this.arithmeticRuleCollection();break;case p.ParserIdentifier:this.state=72,this.match(p.ParserIdentifier);break;default:throw new r.error.NoViableAltException(this)}for(this.state=82,this._errHandler.sync(this),e=this._input.LA(1);e===p.T__4;){switch(this.state=75,this.match(p.T__4),this.state=78,this._errHandler.sync(this),this._input.LA(1)){case p.T__5:this.state=76,this.arithmeticRuleCollection();break;case p.ParserIdentifier:this.state=77,this.match(p.ParserIdentifier);break;default:throw new r.error.NoViableAltException(this)}this.state=84,this._errHandler.sync(this),e=this._input.LA(1)}this.state=85,this.match(p.T__1);break;case p.ParserIdentifier:for(t=new T(this,t),this.enterOuterAlt(t,2),this.state=86,this.match(p.ParserIdentifier),this.state=87,this.match(p.T__3),this.state=91,this._errHandler.sync(this),e=this._input.LA(1);0==(-32&e)&&0!=(1<<e&(1<<p.T__5|1<<p.LexerIdentifier|1<<p.ParserIdentifier|1<<p.String));)this.state=88,this.parserRuleAtom(),this.state=93,this._errHandler.sync(this),e=this._input.LA(1);this.state=94,this.match(p.T__1);break;default:throw new r.error.NoViableAltException(this)}}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},S.prototype=Object.create(r.ParserRuleContext.prototype),S.prototype.constructor=S,S.prototype.parserRuleAtom=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(E):this.getTypedRuleContext(E,t)},S.prototype.accept=function(t){return t instanceof i?t.visitArithmeticRuleCollection(this):t.visitChildren(this)},p.ArithmeticRuleCollectionContext=S,p.prototype.arithmeticRuleCollection=function(){var t=new S(this,this._ctx,this.state);this.enterRule(t,10,p.RULE_arithmeticRuleCollection);var e=0;try{for(this.enterOuterAlt(t,1),this.state=97,this.match(p.T__5),this.state=101,this._errHandler.sync(this),e=this._input.LA(1);0==(-32&e)&&0!=(1<<e&(1<<p.T__5|1<<p.LexerIdentifier|1<<p.ParserIdentifier|1<<p.String));)this.state=98,this.parserRuleAtom(),this.state=103,this._errHandler.sync(this),e=this._input.LA(1)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},E.prototype=Object.create(r.ParserRuleContext.prototype),E.prototype.constructor=E,E.prototype.copyFrom=function(t){r.ParserRuleContext.prototype.copyFrom.call(this,t)},C.prototype=Object.create(E.prototype),C.prototype.constructor=C,p.ParserAtomExprContext=C,C.prototype.accept=function(t){return t instanceof i?t.visitParserAtomExpr(this):t.visitChildren(this)},A.prototype=Object.create(E.prototype),A.prototype.constructor=A,p.ParserAtomParserIdContext=A,A.prototype.ParserIdentifier=function(){return this.getToken(p.ParserIdentifier,0)},A.prototype.accept=function(t){return t instanceof i?t.visitParserAtomParserId(this):t.visitChildren(this)},k.prototype=Object.create(E.prototype),k.prototype.constructor=k,p.ParserAtomStrContext=k,k.prototype.String=function(){return this.getToken(p.String,0)},k.prototype.accept=function(t){return t instanceof i?t.visitParserAtomStr(this):t.visitChildren(this)},b.prototype=Object.create(E.prototype),b.prototype.constructor=b,p.ParserAtomLexerIdContext=b,b.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},b.prototype.accept=function(t){return t instanceof i?t.visitParserAtomLexerId(this):t.visitChildren(this)},p.ParserRuleAtomContext=E,p.prototype.parserRuleAtom=function(){var t=new E(this,this._ctx,this.state);this.enterRule(t,12,p.RULE_parserRuleAtom);var e=0;try{switch(this.state=132,this._errHandler.sync(this),this._input.LA(1)){case p.T__5:t=new C(this,t),this.enterOuterAlt(t,1),this.state=104,this.match(p.T__5),this.state=109,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=105,this.match(p.T__6),this.state=107,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=106,this.match(p.T__6)));break;case p.ParserIdentifier:t=new A(this,t),this.enterOuterAlt(t,2),this.state=111,this.match(p.ParserIdentifier),this.state=116,this._errHandler.sync(this),0==(-32&(e=this._input.LA(1)))&&0!=(1<<e&(1<<p.T__6|1<<p.T__7|1<<p.T__8))&&(this.state=112,0!=(-32&(e=this._input.LA(1)))||0==(1<<e&(1<<p.T__6|1<<p.T__7|1<<p.T__8))?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=114,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=113,this.match(p.T__6)));break;case p.LexerIdentifier:t=new b(this,t),this.enterOuterAlt(t,3),this.state=118,this.match(p.LexerIdentifier),this.state=123,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=119,this.match(p.T__6),this.state=121,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=120,this.match(p.T__6)));break;case p.String:t=new k(this,t),this.enterOuterAlt(t,4),this.state=125,this.match(p.String),this.state=130,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=126,this.match(p.T__6),this.state=128,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=127,this.match(p.T__6)));break;default:throw new r.error.NoViableAltException(this)}}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},R.prototype=Object.create(r.ParserRuleContext.prototype),R.prototype.constructor=R,R.prototype.lexerRule=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(N):this.getTypedRuleContext(N,t)},R.prototype.accept=function(t){return t instanceof i?t.visitLexerRuleCollection(this):t.visitChildren(this)},p.LexerRuleCollectionContext=R,p.prototype.lexerRuleCollection=function(){var t=new R(this,this._ctx,this.state);this.enterRule(t,14,p.RULE_lexerRuleCollection);try{this.enterOuterAlt(t,1),this.state=137,this._errHandler.sync(this);for(var e=this._interp.adaptivePredict(this._input,20,this._ctx);1!=e&&e!=r.atn.ATN.INVALID_ALT_NUMBER;)2===e&&(this.state=134,this.lexerRule()),this.state=139,this._errHandler.sync(this),e=this._interp.adaptivePredict(this._input,20,this._ctx)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},L.prototype=Object.create(r.ParserRuleContext.prototype),L.prototype.constructor=L,L.prototype.accept=function(t){return t instanceof i?t.visitMeaningfulSplit(this):t.visitChildren(this)},p.MeaningfulSplitContext=L,p.prototype.meaningfulSplit=function(){var t=new L(this,this._ctx,this.state);this.enterRule(t,16,p.RULE_meaningfulSplit);try{this.enterOuterAlt(t,1),this.state=140,this.match(p.T__9)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},N.prototype=Object.create(r.ParserRuleContext.prototype),N.prototype.constructor=N,N.prototype.copyFrom=function(t){r.ParserRuleContext.prototype.copyFrom.call(this,t)},I.prototype=Object.create(N.prototype),I.prototype.constructor=I,p.LexerRuleStringsContext=I,I.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},I.prototype.strings=function(){return this.getTypedRuleContext(w,0)},I.prototype.accept=function(t){return t instanceof i?t.visitLexerRuleStrings(this):t.visitChildren(this)},O.prototype=Object.create(N.prototype),O.prototype.constructor=O,p.LexerRuleComplexContext=O,O.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},O.prototype.lexerRuleExpr=function(){return this.getTypedRuleContext(F,0)},O.prototype.accept=function(t){return t instanceof i?t.visitLexerRuleComplex(this):t.visitChildren(this)},P.prototype=Object.create(N.prototype),P.prototype.constructor=P,p.LexerRuleListContext=P,P.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},P.prototype.strings=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(w):this.getTypedRuleContext(w,t)},P.prototype.accept=function(t){return t instanceof i?t.visitLexerRuleList(this):t.visitChildren(this)},p.LexerRuleContext=N,p.prototype.lexerRule=function(){var t=new N(this,this._ctx,this.state);this.enterRule(t,18,p.RULE_lexerRule);var e=0;try{switch(this.state=163,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,22,this._ctx)){case 1:t=new I(this,t),this.enterOuterAlt(t,1),this.state=142,this.match(p.LexerIdentifier),this.state=143,this.match(p.T__3),this.state=144,this.strings(),this.state=145,this.match(p.T__1);break;case 2:t=new P(this,t),this.enterOuterAlt(t,2),this.state=147,this.match(p.LexerIdentifier),this.state=148,this.match(p.T__3),this.state=149,this.strings(),this.state=152,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=150,this.match(p.T__4),this.state=151,this.strings(),this.state=154,this._errHandler.sync(this),e=this._input.LA(1)}while(e===p.T__4);this.state=156,this.match(p.T__1);break;case 3:t=new O(this,t),this.enterOuterAlt(t,3),this.state=158,this.match(p.LexerIdentifier),this.state=159,this.match(p.T__3),this.state=160,this.lexerRuleExpr(0),this.state=161,this.match(p.T__1)}}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},w.prototype=Object.create(r.ParserRuleContext.prototype),w.prototype.constructor=w,w.prototype.String=function(t){return void 0===t&&(t=null),null===t?this.getTokens(p.String):this.getToken(p.String,t)},w.prototype.accept=function(t){return t instanceof i?t.visitStrings(this):t.visitChildren(this)},p.StringsContext=w,p.prototype.strings=function(){var t=new w(this,this._ctx,this.state);this.enterRule(t,20,p.RULE_strings);var e=0;try{this.enterOuterAlt(t,1),this.state=172,this._errHandler.sync(this),e=this._input.LA(1);do{this.state=165,this.match(p.String),this.state=170,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=166,this.match(p.T__6),this.state=168,this._errHandler.sync(this),(e=this._input.LA(1))===p.T__6&&(this.state=167,this.match(p.T__6))),this.state=174,this._errHandler.sync(this),e=this._input.LA(1)}while(e===p.String)}catch(e){if(!(e instanceof r.error.RecognitionException))throw e;t.exception=e,this._errHandler.reportError(this,e),this._errHandler.recover(this,e)}finally{this.exitRule()}return t},F.prototype=Object.create(r.ParserRuleContext.prototype),F.prototype.constructor=F,F.prototype.lexerRuleExpr=function(t){return void 0===t&&(t=null),null===t?this.getTypedRuleContexts(F):this.getTypedRuleContext(F,t)},F.prototype.LexerIdentifier=function(){return this.getToken(p.LexerIdentifier,0)},F.prototype.String=function(t){return void 0===t&&(t=null),null===t?this.getTokens(p.String):this.getToken(p.String,t)},F.prototype.Brackets=function(){return this.getToken(p.Brackets,0)},F.prototype.accept=function(t){return t instanceof i?t.visitLexerRuleExpr(this):t.visitChildren(this)},p.prototype.lexerRuleExpr=function(t){void 0===t&&(t=0);var e=this._ctx,n=this.state,i=new F(this,this._ctx,n);this.enterRecursionRule(i,22,p.RULE_lexerRuleExpr,t);var o=0;try{switch(this.enterOuterAlt(i,1),this.state=191,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,26,this._ctx)){case 1:this.state=177,this.match(p.T__10),this.state=178,this.lexerRuleExpr(0),this.state=179,this.match(p.T__11);break;case 2:this.state=181,this.match(p.T__12),this.state=182,this.lexerRuleExpr(6);break;case 3:this.state=183,this.match(p.LexerIdentifier);break;case 4:this.state=184,this.match(p.String),this.state=185,this.match(p.T__13),this.state=186,this.match(p.T__13),this.state=187,this.match(p.String);break;case 5:this.state=188,this.match(p.String);break;case 6:this.state=189,this.match(p.T__13);break;case 7:this.state=190,this.match(p.Brackets)}this._ctx.stop=this._input.LT(-1),this.state=207,this._errHandler.sync(this);for(var s=this._interp.adaptivePredict(this._input,29,this._ctx);2!=s&&s!=r.atn.ATN.INVALID_ALT_NUMBER;){if(1===s)switch(null!==this._parseListeners&&this.triggerExitRuleEvent(),i,this.state=205,this._errHandler.sync(this),this._interp.adaptivePredict(this._input,28,this._ctx)){case 1:if(i=new F(this,e,n),this.pushNewRecursionContext(i,22,p.RULE_lexerRuleExpr),this.state=193,!this.precpred(this._ctx,9))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 9)");this.state=194,this.match(p.T__4),this.state=195,this.lexerRuleExpr(10);break;case 2:if(i=new F(this,e,n),this.pushNewRecursionContext(i,22,p.RULE_lexerRuleExpr),this.state=196,!this.precpred(this._ctx,8))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 8)");this.state=197,this.lexerRuleExpr(9);break;case 3:if(i=new F(this,e,n),this.pushNewRecursionContext(i,22,p.RULE_lexerRuleExpr),this.state=198,!this.precpred(this._ctx,11))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 11)");this.state=199,this.match(p.T__6);break;case 4:if(i=new F(this,e,n),this.pushNewRecursionContext(i,22,p.RULE_lexerRuleExpr),this.state=200,!this.precpred(this._ctx,10))throw new r.error.FailedPredicateException(this,"this.precpred(this._ctx, 10)");this.state=201,(o=this._input.LA(1))!==p.T__7&&o!==p.T__8?this._errHandler.recoverInline(this):(this._errHandler.reportMatch(this),this.consume()),this.state=203,this._errHandler.sync(this),1===this._interp.adaptivePredict(this._input,27,this._ctx)&&(this.state=202,this.match(p.T__6))}this.state=209,this._errHandler.sync(this),s=this._interp.adaptivePredict(this._input,29,this._ctx)}}catch(t){if(!(t instanceof r.error.RecognitionException))throw t;i.exception=t,this._errHandler.reportError(this,t),this._errHandler.recover(this,t)}finally{this.unrollRecursionContexts(e)}return i},p.prototype.sempred=function(t,e,n){switch(e){case 11:return this.lexerRuleExpr_sempred(t,n);default:throw"No predicate with index:"+e}},p.prototype.lexerRuleExpr_sempred=function(t,e){switch(e){case 0:return this.precpred(this._ctx,9);case 1:return this.precpred(this._ctx,8);case 2:return this.precpred(this._ctx,11);case 3:return this.precpred(this._ctx,10);default:throw"No predicate with index:"+e}},e.BlocklyGrammerParser=p},function(module,exports,__webpack_require__){var antlr4=__webpack_require__(12),BlocklyGrammerVisitor=__webpack_require__(20).BlocklyGrammerVisitor;function SymbolVisitor(){return BlocklyGrammerVisitor.call(this),this}function EvalVisitor(){return BlocklyGrammerVisitor.call(this),this}SymbolVisitor.prototype=Object.create(BlocklyGrammerVisitor.prototype),SymbolVisitor.prototype.constructor=SymbolVisitor,SymbolVisitor.prototype.init=function(){return this.statementRules=[],this.expressionRules=[],this.expression_arithmetic_num=0,this.lexerRules={},this.grammerName="",this},SymbolVisitor.prototype.error=function(t){throw new Error(t)},SymbolVisitor.prototype.checkSymbol=function(){for(var t,e={},n=function(t,e){for(var n,r=0;n=t[r];r++)if(n[0]===e)return n[1];return[]},r=0;t=this.statementRules[r];r++)if(t[1].length>1)for(var i,o=0;i=t[1][o];o++)e[i]&&this.error("语句 "+i+" 同时在两个语句集合 "+e[i]+" 和 "+t[0]+" 中出现了"),e[i]=t[0],n(this.statementRules,i).length>1&&this.error(t[0]+" 下的子规则 "+i+' 包含了"|"');var s;for(r=0;s=this.expressionRules[r];r++)s[1].length>1&&"expression"!==s[0]&&this.error("表达式 "+s[0]+' 包含了"|"')},SymbolVisitor.prototype.visitGrammarFile=function(t){return this.visit(t.grammerDecl()),this.visit(t.statementRule()),this.visit(t.expressionRule()),this.visit(t.lexerRuleCollection(0)),this},SymbolVisitor.prototype.visitGrammerDecl=function(t){this.grammerName=t.children[1].getText()},SymbolVisitor.prototype.visitStatList=function(t){for(var e,n=t.ParserIdentifier(),r=0;e=n[r];r++)n[r]=e.getText();var i=n.shift();this.statementRules.push([i,n])},SymbolVisitor.prototype.visitStatValue=function(t){var e=t.ParserIdentifier(0).getText();this.statementRules.push([e,[e]])},SymbolVisitor.prototype.visitExprExpression=function(t){var e=[];this.expression_arithmetic_num=t.arithmeticRuleCollection().length;for(var n=0;n<this.expression_arithmetic_num;n++){var r="expression_arithmetic_"+n;e.push(r),this.expressionRules.push([r,[r]])}var i,o=t.ParserIdentifier();for(n=0;i=o[n];n++)o[n]=i.getText();e=e.concat(o),this.expressionRules.push(["expression",e])},SymbolVisitor.prototype.visitExprValue=function(t){var e=t.ParserIdentifier(0).getText();this.expressionRules.push([e,[e]])},SymbolVisitor.prototype.visitLexerRuleCollection=function(t){for(var e,n=t.lexerRule()||[],r=0;e=n[r];r++){var i=e.LexerIdentifier(0).getText();this.lexerRules[i]=""}},EvalVisitor.prototype=Object.create(BlocklyGrammerVisitor.prototype),EvalVisitor.prototype.constructor=EvalVisitor,EvalVisitor.prototype.init=function(t,e){this.rawInput=e;var n=function(t){for(var e,n={},r=0;e=t[r];r++)n[e[0]]={check:e[1],user:{}};return n};return this.grammerName=t.grammerName,this.statementRules=n(t.statementRules),this.expressionRules=n(t.expressionRules),this.lexerRules=t.lexerRules,this.notEntry={},this.valueColor=330,this.statementColor=160,this.entryColor=260,this.generLanguage="JavaScript",this.recieveOrder="ORDER_ATOMIC",this.sendOrder="ORDER_NONE",this.varPrefix="",this.blocks="",this},EvalVisitor.prototype.error=function(t){throw new Error(t)},EvalVisitor.prototype.setRule=function(t,e,n){"lexer"===t&&(this.lexerRules[e]=n),"statement"===t&&(this.statementRules[e]=n),"value"===t&&(this.expressionRules[e]=n)},EvalVisitor.prototype.getRule=function(t,e){return"lexer"===t?this.lexerRules[e]:"statement"===t?this.statementRules[e]:"value"===t?this.expressionRules[e]:void 0},EvalVisitor.prototype.escapeString=function(string_){return eval(string_)},EvalVisitor.prototype.matchInject=function(t){var e=new RegExp("/\\*[^\\S\\r\\n]*"+t+"\\b[\\r\\n]*([^]*?)[\\r\\n]*\\*/"),n=this.rawInput.match(e);return n?n[1]:""},EvalVisitor.prototype.inject=["type","json","generFunc","args","argsType","argsGrammarName","fieldDefault","menu","xmlText","colour","tooltip","helpUrl","default","override","name"],EvalVisitor.prototype.loadInject=function(injectStr){if(!injectStr)return{default:[],name:[]};var obj={},keyvaluepart=/^((?:(?:[^\S\r\n]+|\s*\w+\s*:[^\r\n]*)[\r\n]+)*)/.exec(injectStr);obj.generFunc=injectStr.slice(0,keyvaluepart.index)+injectStr.slice(keyvaluepart.index+keyvaluepart[0].length);for(var lines=keyvaluepart[1].split("\n"),ii=0;ii<lines.length;ii++){var line=lines[ii];if(!/^\s*$/.exec(line)){var match=/^\s*(\w+)\s*:\s*([^\r\n]*?)\s*$/.exec(line);obj[match[1]]=match[2]}}obj.colour&&(obj.colour=eval(obj.colour));for(var ii=0,key;key=["default","name"][ii];ii++)obj[key]?obj[key]=eval(obj[key]):obj[key]=[];return obj},EvalVisitor.prototype.initAssemble=function(t){t.inject=this.loadInject(this.matchInject(t.name));var e=[];t.vars=[];for(var n,r=!1,i=0,o=0,s=0,a={};n=t.args[s];s++){var l=JSON.parse(JSON.stringify(n.data)),u=null;if(n.id&&"field_image"!=n.data.type){if(a[n.id]=a[n.id]?a[n.id]:0,l.name=n.id+"_"+a[n.id],a[n.id]++,"field"!==n.blockType){var c=this.getRule(n.blockType,n.id),h=c.check;l.check=1===h.length?h[0]:h,c.user[t.name]=t.type,this.notEntry[n.id]=!0,this.setRule(n.blockType,n.id,c)}else{l={name:l.name};var p={field_input:"text",field_multilinetext:"text",field_number:"value",field_dropdown:"default",field_checkbox:"checked",field_colour:"colour",field_angle:"angle"}[n.data.type];void 0===(u=t.inject.default[i])&&(u=null),null!==u&&(l[p]=u),i++}o++}l.name?(t.inject.name[o-1]&&(l.name=t.inject.name[o-1]),t.vars.push(l.name)):(t.vars.push(null),r=!0),e.push(l)}var f={type:t.name,message0:t.message.join(" "),args0:e,inputsInline:!0,tooltip:t.inject.tooltip||"",helpUrl:t.inject.helpUrl||""};0===e.length&&delete f.args0,r&&delete f.inputsInline;var d=this.getRule(t.type,t.name);h=1===(h=d.check).length?h[0]:h,"value"===t.type?(f.colour=t.inject.colour||this.valueColor,f.output=h):(f.colour=t.inject.colour||this.statementColor,f.previousStatement=h,f.nextStatement=h),d.blockjs=f,d.blockobj=t,this.setRule(t.type,t.name,d)},EvalVisitor.prototype.assemble=function(){for(var t=Object.keys(this.statementRules),e=0;o=this.statementRules[t[e]];e++)if(o.check.length>1){this.notEntry[t[e]]=!0;for(var n,r=0;n=o.check[r];r++){var i=this.getRule("statement",n);i.blockjs.nextStatement=o.check,this.setRule("statement",n,i),this.notEntry[n]=!0}}for(e=0;o=this.statementRules[t[e]];e++)this.notEntry[t[e]]||(this.notEntry[t[e]]=!1,delete o.blockjs.previousStatement,delete o.blockjs.nextStatement,delete o.blockjs.inputsInline,o.blockjs.colour=this.entryColor);var o,s=[],a=[];for(e=0;o=this.statementRules[t[e]];e++)if(o.check.length>1)a.push([t[e],o]);else{s.push(o),o.type="statement";var l=[],u="",c=function(t){t>0&&(u+=Array(2*t+1).join(" ")),t<0&&(u=u.slice(0,2*t))},h="Blockly."+this.generLanguage+".";l.push(u+"function(block) {\n"),c(1);for(r=0;y=o.blockobj.args[r];r++){var p=this.varPrefix+o.blockobj.vars[r];if(y.id&&"field_image"!=y.data.type)"value"===y.blockType?(l.push(u+"var "+p+" = "+h+"valueToCode(block, '"),l.push(p+"', \n  "+u+h+this.recieveOrder+")")):"statement"===y.blockType?(l.push(u+"var "+p+" = "+h+"statementToCode(block, '"),l.push(p+"')")):(l.push(u+"var "+p+" = block.getFieldValue('"),l.push(p+"')")),"field_checkbox"===y.data.type&&l.push(" === 'TRUE'"),l.push(";\n"),y.multi,{field_checkbox:!0,field_dropdown:!0,field_number:!0,field_colour:!0,field_angle:!0,field_image:!0}[y.data.type]||y.omitted||(l.push(u+"if ("+p+"==='') {\n"),c(1),l.push(u+"throw new OmitedError(block,'"+p+"','"),l.push(t[e]+"');\n"),c(-1),l.push(u+"}\n")),"field"===y.blockType&&(l.push(u+p+" = "+this.grammerName+"Functions.pre('"),l.push(y.id+"')("+p+");\n"))}o.blockobj.inject.generFunc?(o.blockobj.inject.override&&(c(-9999),(l=[]).push(u+"function(block) {\n"),c(1)),l.push(u+o.blockobj.inject.generFunc.split("\n").join("\n"+u)),l.push("\n")):(l.push(u+"var code = "+this.grammerName+"Functions.defaultCode('"),l.push(o.check[0]+"',["+o.blockobj.vars.map(function(t){return null==t?'"\\n"':t}).join(",")+"]);\n"),l.push(u+"return code;\n")),c(-1),l.push(u+"}"),o.generFunc=l.join("")}t=Object.keys(this.expressionRules);var f;for(e=0;f=this.expressionRules[t[e]];e++)if(f.check.length>1)a.push([t[e],f]);else{s.push(f),f.type="value";l=[],u="",c=function(t){t>0&&(u+=Array(2*t+1).join(" ")),t<0&&(u=u.slice(0,2*t))},h="Blockly."+this.generLanguage+".";l.push(u+"function(block) {\n"),c(1);for(r=0;y=f.blockobj.args[r];r++){p=this.varPrefix+f.blockobj.vars[r];if(y.id)"value"===y.blockType?(l.push(u+"var "+p+" = "+h+"valueToCode(block, '"),l.push(p+"', \n  "+u+h+this.recieveOrder+")")):"statement"===y.blockType?(l.push(u+"var "+p+" = "+h+"statementToCode(block, '"),l.push(p+"')")):(l.push(u+"var "+p+" = block.getFieldValue('"),l.push(p+"')")),"field_checkbox"===y.data.type&&l.push(" === 'TRUE'"),l.push(";\n"),y.multi,{field_checkbox:!0,field_dropdown:!0,field_number:!0,field_colour:!0,field_angle:!0,field_image:!0}[y.data.type]||y.omitted||(l.push(u+"if ("+p+"==='') {\n"),c(1),l.push(u+"throw new OmitedError(block,'"+p+"','"),l.push(t[e]+"');\n"),c(-1),l.push(u+"}\n")),"field"===y.blockType&&(l.push(u+p+" = "+this.grammerName+"Functions.pre('"),l.push(y.id+"')("+p+");\n"))}f.blockobj.inject.generFunc?(f.blockobj.inject.override&&(c(-9999),(l=[]).push(u+"function(block) {\n"),c(1)),l.push(u+f.blockobj.inject.generFunc.split("\n").join("\n"+u)),l.push("\n")):(l.push(u+"var code = "+this.grammerName+"Functions.defaultCode('"),l.push(f.check[0]+"',["+f.blockobj.vars.map(function(t){return null==t?'"\\n"':t}).join(",")+"]);\n"),l.push(u+"return [code, "+h+this.sendOrder+"];\n")),c(-1),l.push(u+"}"),f.generFunc=l.join("")}var d;for(e=0;d=s[e];e++){d.args=[],d.argsType=[],d.argsGrammarName=[];var y;for(r=0;y=d.blockobj.args[r];r++)y.id&&"field_image"!=y.data.type&&(d.args.push(d.blockobj.vars[r]),d.argsType.push(y.blockType),d.argsGrammarName.push(y.id));l=[],u="",c=function(t){t>0&&(u+=Array(2*t+1).join(" ")),t<0&&(u=u.slice(0,2*t))};var g=this.grammerName,x=d.check[0];l.push(u+"function (inputs,isShadow,comment) {\n"),c(1),l.push(u+"return "+g+"Functions.xmlText('"),l.push(x+"',inputs,isShadow,comment);\n"),c(-1),l.push(u+"}"),d.xmlText=l.join(""),l=[],c(-9999),l.push(u+"function (keyOrIndex) {\n"),c(1),l.push(u+"return "+g+"Functions.fieldDefault('"),l.push(x+"',keyOrIndex);\n"),c(-1),l.push(u+"}"),d.fieldDefault=l.join("")}this.temp_xml=s,this.temp_collection=a},EvalVisitor.prototype.generBlocks=function(){var t=[],e="",n=function(t){t>0&&(e+=Array(2*t+1).join(" ")),t<0&&(e=e.slice(0,2*t))},r=this.temp_xml;delete this.temp_xml;var i=this.temp_collection;delete this.temp_collection,t.push(e+"// 语句集合和表达式集合\n"),t.push(e+this.grammerName+"Blocks = {\n"),n(1);for(var o,s=0;o=i[s];s++)t.push(e+'"'+o[0]+'": '),t.push(JSON.stringify(o[1].check,null,2).split("\n").join("\n"+e)),t.push(",\n");function a(t,e,n){for(var r=JSON.parse(JSON.stringify(e.blockjs)),o={},s=0;c=e.blockobj.args[s];s++)if(c.id){var a=t.getRule(c.blockType,c.id);a&&1!==a.check.length&&(r.args0[s].check="1_fry2_3_inrgv"+c.id,o['"1_fry2_3_inrgv'+c.id+'"']=t.grammerName+"Blocks."+c.id)}if(r.nextStatement)for(var l,u=0;l=i[u];u++)if(-1!==l[1].check.indexOf(r.type)){r.nextStatement="1_fry2_3_inrgv"+l[0],o['"1_fry2_3_inrgv'+l[0]+'"']=t.grammerName+"Blocks."+l[0];break}s=0;for(var c,h=0;c=e.blockobj.args[s];s++)c.id&&"field_image"!=c.data.type&&"field"==e.argsType[h++]&&(o['"1_fry2_3_inrgv'+c.id+r.args0[s].name+'"']="Object.assign({},"+t.grammerName+"Blocks."+c.id+","+JSON.stringify(r.args0[s],null,2).split("\n").join("\n"+n+"    ")+")",r.args0[s]="1_fry2_3_inrgv"+c.id+r.args0[s].name);var p=JSON.stringify(r,null,2).split("\n").join("\n"+n);for(var f in o)p=p.split(f).join(o[f]);return p}t.pop(),t.push("\n"),n(-1),t.push(e+"}\n"),t.push(e+"// 所有域的默认行为\n"),t.push(e+this.grammerName+"Blocks = Object.assign("),t.push(this.grammerName+"Blocks,"),t.push(function(t){var n=0,r={},i=JSON.stringify(t,function(t,i){return"options"===t&&"string"==typeof i&&"function"===i.slice(0,8)?(r['"_'+ ++n+'_1_fry2_3_inrgv"']=i.split("\n").join("\n    "+e),"_"+n+"_1_fry2_3_inrgv"):i},2).split("\n").join("\n"+e);for(var o in r)i=i.split(o).join(r[o]);return i}(this.lexerRules)),t.push(e+");\n"),t.push(e+"// 所有方块的实际内容\n"),t.push(e+this.grammerName+"Blocks = Object.assign("),t.push(this.grammerName+"Blocks,{\n"),n(1);var l;for(s=0;l=r[s];s++){for(var u in t.push(e+'"'+l.check[0]+'": {\n'),n(1),t.push(e+'"type": "'+l.type+'",\n'),t.push(e+'"json": '),t.push(a(this,l,e)),t.push(",\n"),t.push(e+'"generFunc": '),t.push(l.generFunc.split("\n").join("\n"+e)),t.push(",\n"),t.push(e+'"args": '),t.push(JSON.stringify(l.args,null,2).split("\n").join("\n"+e)),t.push(",\n"),t.push(e+'"argsType": '),t.push(JSON.stringify(l.argsType,null,0)),t.push(",\n"),t.push(e+'"argsGrammarName": '),t.push(JSON.stringify(l.argsGrammarName,null,0)),t.push(",\n"),t.push(e+'"fieldDefault": '),t.push(l.fieldDefault.split("\n").join("\n"+e)),t.push(",\n"),t.push(e+'"menu": '),t.push(l.blockobj.inject.menu||"[]"),t.push(",\n"),l.blockobj.inject)-1===this.inject.indexOf(u)&&(t.push(e+'"'+u+'": '),t.push(JSON.stringify(l.blockobj.inject[u],null,0)),t.push(",\n"));t.push(e+'"xmlText": '),t.push(l.xmlText.split("\n").join("\n"+e)),t.push("\n"),n(-1),t.push(e+"},\n")}t.pop(),t.push(e+"}\n"),n(-1),t.push(e+"});\n"),this.blocks=t.join("")},EvalVisitor.prototype.SpeicalLexerRule=function(t){var e={};return"Bool"===t?(e={type:"field_checkbox",checked:!0},this.setRule("lexer",t,e),!0):"Int"===t?(e={type:"field_number",value:0,min:0,precision:1},this.setRule("lexer",t,e),!0):"Number"===t?(e={type:"field_number",value:0},this.setRule("lexer",t,e),!0):"Colour"===t?(e={type:"field_colour",colour:"#ff0000"},this.setRule("lexer",t,e),!0):"Angle"===t?(e={type:"field_angle",angle:90},this.setRule("lexer",t,e),!0):"BGNL"===t&&(e={type:"input_dummy"},this.setRule("lexer",t,e),!0)},EvalVisitor.prototype.visitGrammarFile=function(t){this.visit(t.lexerRuleCollection(0)),this.visit(t.statementRule()),this.expression_arithmetic_num=0,this.visit(t.expressionRule()),this.assemble()},EvalVisitor.prototype.visitStrings=function(t){for(var e,n=t.String(),r=0;e=n[r];r++)n[r]=this.escapeString(e.getText());return n.join(" ")},EvalVisitor.prototype.visitLexerRuleStrings=function(t){var e=t.LexerIdentifier(0).getText();if(!this.SpeicalLexerRule(e)){var n=this.visit(t.strings(0));this.setRule("lexer",e,n)}},EvalVisitor.prototype.visitLexerRuleList=function(ctx){var lexerId=ctx.LexerIdentifier(0).getText();if(!this.SpeicalLexerRule(lexerId))if("_List"===lexerId.slice(-5)||"_Img"===lexerId.slice(-4)){var strings=ctx.strings(),values=this.matchInject(lexerId);if(values=values?eval("("+values+")"):[],"function"!=typeof values){for(var ii=0,value;value=strings[ii];ii++){var string_=this.visit(value);strings[ii]=[string_,null==values[ii]?string_:values[ii]]}if("_List"===lexerId.slice(-5))var lexervalue={type:"field_dropdown",options:strings,default:strings[0][1]};else var lexervalue={type:"field_image",src:strings[0][0],width:strings[1]&&strings[1][0]||0,height:strings[2]&&strings[2][0]||0,alt:strings[3]&&strings[3][0]||"img"};this.setRule("lexer",lexerId,lexervalue)}else{var lexervalue={type:"field_dropdown",options:values.toString(),default:this.visit(strings[1])};this.setRule("lexer",lexerId,lexervalue)}}else this.visitLexerRuleComplex(ctx)},EvalVisitor.prototype.visitLexerRuleComplex=function(t){var e=t.LexerIdentifier(0).getText();if(!this.SpeicalLexerRule(e)){var n={type:"_Multi"!==e.slice(-6)?"field_input":"field_multilinetext",text:e+"_default"};this.setRule("lexer",e,n)}},EvalVisitor.prototype.visitStatValue=function(t){this.status={name:t.ParserIdentifier(0).getText(),type:"statement",message:[],args:[]},this.visitChildren(t);var e=this.status;delete this.status,this.initAssemble(e)},BlocklyGrammerVisitor.prototype.visitArithmeticRuleCollection=function(t){this.status={name:"expression",type:"value",message:["%1"],args:[{id:"expression",blockType:"value",omitted:!1,data:{type:"input_value"}}]},this.visitChildren(t),this.status.name="expression_arithmetic_"+this.expression_arithmetic_num,this.expression_arithmetic_num++;var e=this.status;delete this.status,this.initAssemble(e)},BlocklyGrammerVisitor.prototype.visitExprValue=function(t){this.status={name:t.ParserIdentifier(0).getText(),type:"value",message:[],args:[]},this.visitChildren(t);var e=this.status;delete this.status,this.initAssemble(e)},EvalVisitor.prototype.visitParserAtomExpr=function(t){var e={id:"expression",blockType:"value",omitted:t.children.length>1,data:{type:"input_value"}};this.status.args.push(e),this.status.message.push("%"+this.status.args.length)},EvalVisitor.prototype.visitParserAtomParserId=function(t){var e=t.children[0].getText(),n=t.children.length>1&&t.children[1].getText()||"",r=this.getRule("value",e)?"value":"statement",i={id:e,blockType:r,omitted:"?"===n||"*"===n,multi:"+"===n||"*"===n,data:{type:"input_"+r}};"value"===r&&i.multi&&this.error(this.status.name+" 下出现了复数组合的表达式 "+e+n),this.status.args.push(i),this.status.message.push("%"+this.status.args.length)},EvalVisitor.prototype.visitParserAtomLexerId=function(t){var e=t.children[0].getText(),n=this.getRule("lexer",e);if(n){var r={id:e,blockType:"field",omitted:t.children.length>1,data:n};"BGNL"===e&&(r={data:n}),"string"!=typeof n?(this.status.args.push(r),this.status.message.push("%"+this.status.args.length)):this.status.message.push(n)}},EvalVisitor.prototype.visitParserAtomStr=function(t){var e=this.escapeString(t.String().getText());this.status.message.push(e)},exports.SymbolVisitor=SymbolVisitor,exports.EvalVisitor=EvalVisitor},function(t,e){e.OmitedError=function(){return"//生成代码中,当一个不允许省略的值或块省略时,会抛出这个错误\nfunction OmitedError(block, var_, rule, fileName, lineNumber) {\n  var message = 'no omitted '+var_+' at '+rule;\n  var instance = new Error(message, fileName, lineNumber);\n  instance.block = block;\n  instance.varName = var_;\n  instance.blockName = rule;\n  instance.name = 'OmitedError';\n  Object.setPrototypeOf(instance, Object.getPrototypeOf(this));\n  if (Error.captureStackTrace) {\n    Error.captureStackTrace(instance, OmitedError);\n  }\n  return instance;\n}\n\nOmitedError.prototype = Object.create(Error.prototype);\nOmitedError.prototype.constructor = OmitedError;\n//处理此错误的omitedcheckUpdateFunction定义在下面\n"},e.Functions_pre=function(t){return`${t}Functions.Int_pre = function(intstr) {\n  return parseInt(intstr);\n}\n\n${t}Functions.Number_pre = function(intstr) {\n  return parseFloat(intstr);\n}\n\n//返回各LexerRule文本域的预处理函数,方便用来统一转义等等\n${t}Functions.pre = function(LexerId) {\n  if (${t}Functions.hasOwnProperty(LexerId+'_pre')) {\n    return ${t}Functions[LexerId+'_pre'];\n  }\n  return function(obj){return obj}\n}\n`},e.Functions_fieldDefault=function(t){return`// ${t}Functions.fieldDefault\n// 根据输入是整数字符串或null\n// 第index个或者名字为key的域的默认值, null时返回所有field默认值的数组\n${t}Functions.fieldDefault = function (ruleName,keyOrIndex) {\n  var rule = ${t}Blocks[ruleName];\n  var iskey=typeof keyOrIndex==typeof '';\n  var isindex=typeof keyOrIndex==typeof 0;\n  function args0_content_to_default(cnt) {\n    var key = ({\n      'field_input':'text',\n      'field_multilinetext':'text',\n      'field_number':'value',\n      'field_dropdown':'default',\n      'field_checkbox':'checked',\n      'field_colour':'colour',\n      'field_angle':'angle',\n      // 'field_image':'src'\n    })[cnt.type];\n    return cnt[key];\n  }\n  var allDefault=[];\n  for(var ii=0,index=-1,cnt;cnt=rule.json.args0[ii];ii++){\n    if (!cnt.name || cnt.type.slice(0,5)!='field' || cnt.type=='field_image') continue;\n    index++;\n    if (iskey && cnt.name==keyOrIndex)return args0_content_to_default(cnt);\n    if (isindex && index==keyOrIndex)return args0_content_to_default(cnt);\n    allDefault.push(args0_content_to_default(cnt))\n  }\n  if (iskey || isindex) return undefined;\n  return allDefault;\n}\n`},e.Functions_defaultCode=function(t){return`// ${t}Functions.defaultCode\n${t}Functions.defaultCode = function (ruleName,args) {\n  var rule = ${t}Blocks[ruleName];\n  var message=rule.json.message0;\n  for(var ii=0;ii<args.length;ii++){\n    message=message.split(new RegExp('%'+(ii+1)+'\\\\b'))\n    if (args[ii]==='\\n') {\n      message[1]=message[1].slice(1);\n    }\n    if (rule.json.args0[ii].type=="input_statement") {\n      message[0]=message[0]+'\\n';\n      message[1]=message[1].slice(1);\n    }\n    message=message.join(args[ii]);\n  }\n  if (rule.type=='statement') {\n    message=message+'\\n';\n  }\n  return message;\n}\n`},e.Functions_xmlText=function(t){return`// ${t}Functions.xmlText\n// 构造这个方法是为了能够不借助workspace,从语法树直接构造图块结构\n// inputs的第i个元素是第i个args的xmlText,null或undefined表示空\n// inputs的第rule.args.length个元素是其下一个语句的xmlText\n${t}Functions.xmlText = function (ruleName,inputs,isShadow,comment) {\n  var rule = ${t}Blocks[ruleName];\n  var blocktext = isShadow?'shadow':'block';\n  var xmlText = [];\n  xmlText.push('<'+blocktext+' type="'+ruleName+'">');\n  if(!inputs)inputs=[];\n  for (var ii=0,inputType;inputType=rule.argsType[ii];ii++) {\n    var input = inputs[ii];\n    var _input = '';\n    var noinput = (input===null || input===undefined);\n    if(noinput && inputType==='field' && ${t}Blocks[rule.argsGrammarName[ii]].type!=='field_dropdown') continue;\n    if(noinput && inputType==='field') {\n      noinput = false;\n      input = rule.fieldDefault(rule.args[ii])\n    }\n    if(noinput) input = '';\n    if(inputType!=='field') {\n      var subList = false;\n      var subrulename = rule.argsGrammarName[ii];\n      var subrule = ${t}Blocks[subrulename];\n      if (subrule instanceof Array) {\n        subrulename=subrule[subrule.length-1];\n        subrule = ${t}Blocks[subrulename];\n        subList = true;\n      }\n      _input = subrule.xmlText([],true);\n      if(noinput && !subList && !isShadow) {\n        //无输入的默认行为是: 如果语句块的备选方块只有一个,直接代入方块\n        input = subrule.xmlText();\n      }\n    }\n    xmlText.push('<'+inputType+' name="'+rule.args[ii]+'">');\n    xmlText.push(_input+input);\n    xmlText.push('</'+inputType+'>');\n  }\n  if(comment){\n    xmlText.push('<comment><![CDATA[');\n    xmlText.push(comment.replace(/]]>/g,'] ] >'));\n    xmlText.push(']]></comment>');\n  }\n  var next = inputs[rule.args.length];\n  if (next) {//next\n    xmlText.push('<next>');\n    xmlText.push(next);\n    xmlText.push('</next>');\n  }\n  xmlText.push('</'+blocktext+'>');\n  return xmlText.join('');\n}\n`},e.Functions_blocksIniter=function(t,e){return`// ${t}Functions.blocksIniter\n// 把各方块的信息注册到Blockly中\n${t}Functions.blocksIniter = function(){\n  var blocksobj = ${t}Blocks;\n  for(var key in blocksobj) {\n    var value = blocksobj[key];\n    if(value instanceof Array)continue;\n    if(/^[A-Z].*$/.exec(key))continue;\n    (function(key,value){\n      if (value.menu && value.menu.length) {\n        var menuRegisterMixin={\n          customContextMenu: function(options) {\n            for(var ii=0,op;op=value.menu[ii];ii++){\n              var option = {enabled: true};\n              option.text = op[0];\n              var check = 'function('\n              if (option.text.slice(0,check.length)==check){\n                option.text=eval('('+option.text+')(this)');\n              }\n              (function(block,fstr){\n                option.callback = function(){\n                  eval(fstr)\n                }\n              })(this,op[1]);\n              options.push(option);\n            }\n          }\n        };\n        value.json.extensions=value.json.extensions||[];\n        var mixinName = 'contextMenu_${t}_'+value.json.type\n        value.json.extensions.push(mixinName)\n        Blockly.Extensions.registerMixin(mixinName,menuRegisterMixin);\n      }\n      Blockly.Blocks[key] = {\n        init: function() {this.jsonInit(value.json);}\n      }\n      Blockly.${e}[key] = value.generFunc;\n    })(key,value);\n  }\n}\n`},e.ToolboxObj=function(t,e,n){return`\nvar ${t} = (function(){\n\n  var toolboxXml=document.createElement('xml')\n\n  // 调整这个obj来更改侧边栏和其中的方块\n  // 可以直接填 '<block type="xxx">...</block>'\n  // 标签 '<label text="标签文本"></label>'\n  var toolboxObj = ${e}\n\n  var getCategory = function(toolboxXml,name,custom){\n    var node = document.createElement('category');\n    node.setAttribute('name',name);\n    if(custom)node.setAttribute('custom',custom);\n    toolboxXml.appendChild(node);\n    return node;\n  }\n\n  var toolboxGap = '<sep gap="${n}"></sep>'\n\n  for (var name in toolboxObj){\n    var custom = null;\n    if(name=='xxxxxx')custom='xxxxxx';\n    if(name=='zzzzzz')custom='zzzzzz';\n    getCategory(toolboxXml,name,custom).innerHTML = toolboxObj[name].join(toolboxGap);\n    var node = document.createElement('sep');\n    node.setAttribute('gap',${n}*3);\n    toolboxXml.appendChild(node);\n  }\n\n  return toolboxXml;\n})();\n`},e.mainFileTPL=function(t,e,n,r,i,o,s,a){return[`<!doctype html>\n<head>\n<meta charset="utf-8">\n<title>${t} --antlr-blockly</title>`,'\n<script src="blockly_compressed.js"><\/script>\n<script src="blocks_compressed.js"><\/script>\n<script src="javascript_compressed.js"><\/script>\n<script src="zh-hans.js"><\/script>\n\x3c!-- <script src="en.js"><\/script> --\x3e',"\n</head>\n<body>",`\n\n<p>\n<button onclick="showXML()">Show XML</button>\n<button onclick="runCode()">console.log(obj=code)</button>\n</p>\n<div id="${n}" style="height: 480px; width: 940px;"></div>\n<pre id="${r}"></pre>\n`,"\n<script>\n",`\n${a}\n`,`\n${i}\n\nvar ${o} = Blockly.inject('${n}',{\n  media: 'media/',\n  toolbox: ${s},\n  zoom:{\n    controls: true,\n    wheel: true,//false\n    startScale: 1.0,\n    maxScale: 3,\n    minScale: 0.3,\n    scaleSpeed: 1.08\n  },\n  trashcan: false,\n});\n\nfunction omitedcheckUpdateFunction(event) {\n  console.log(event);\n  try {\n    var code = Blockly.${e}.workspaceToCode(${o});\n    document.getElementById('${r}').innerText = code;\n  } catch (error) {\n    document.getElementById('${r}').innerText = String(error);\n    if (error instanceof OmitedError){\n      var blockName = error.blockName;\n      var varName = error.varName;\n      var block = error.block;\n    }\n    console.log(error);\n  }\n}\n\n${o}.addChangeListener(omitedcheckUpdateFunction);\n\n${o}.addChangeListener(Blockly.Events.disableOrphans);\n//自动禁用任何未连接到根块的块\n`,`\n\nfunction showXML() {\n  xml = Blockly.Xml.workspaceToDom(${o});\n  xml_text = Blockly.Xml.domToPrettyText(xml);\n  console.log(xml_text);\n  xml_text = Blockly.Xml.domToText(xml);\n  console.log(xml_text);\n  console.log(xml);\n}\n\nfunction runCode() {\n  // Generate ${e} code and run it.\n  window.LoopTrap = 1000;\n  Blockly.${e}.INFINITE_LOOP_TRAP =\n    'if (--window.LoopTrap == 0) throw "Infinite loop.";\\n';\n  code = Blockly.${e}.workspaceToCode(${o});\n  Blockly.${e}.INFINITE_LOOP_TRAP = null;\n  try {\n    eval('obj=' + code);\n    console.log(obj);\n  } catch (e) {\n    alert(e);\n  }\n}\n`,"\n<\/script>\n\n","</body>\n</html>\n"]}}]);