GGD/node_modules/chevrotain/lib/chevrotain.min.js

2 lines
154 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

/*! chevrotain - v6.5.0 */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("chevrotain",[],e):"object"==typeof exports?exports.chevrotain=e():t.chevrotain=e()}("undefined"!=typeof self?self:this,function(){return 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}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return 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=18)}([function(t,e,n){"use strict";function r(t){return t&&0===t.length}function i(t){return null==t?[]:Object.keys(t)}function o(t){for(var e=[],n=Object.keys(t),r=0;r<n.length;r++)e.push(t[n[r]]);return e}function a(t,e){for(var n=[],r=i(t),o=0;o<r.length;o++){var a=r[o];n.push(e.call(null,t[a],a))}return n}function s(t,e){for(var n=[],r=0;r<t.length;r++)n.push(e.call(null,t[r],r));return n}function c(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];Array.isArray(r)?e=e.concat(c(r)):e.push(r)}return e}function u(t){return r(t)?void 0:t[0]}function l(t){var e=t&&t.length;return e?t[e-1]:void 0}function p(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)e.call(null,t[n],n);else{if(!x(t))throw Error("non exhaustive match");var r=i(t);for(n=0;n<r.length;n++){var o=r[n],a=t[o];e.call(null,a,o)}}}function h(t){return"string"==typeof t}function f(t){return void 0===t}function d(t){return t instanceof Function}function m(t,e){return void 0===e&&(e=1),t.slice(e,t.length)}function E(t,e){return void 0===e&&(e=1),t.slice(0,t.length-e)}function T(t,e){var n=[];if(Array.isArray(t))for(var r=0;r<t.length;r++){var i=t[r];e.call(null,i)&&n.push(i)}return n}function y(t,e){return T(t,function(t){return!e(t)})}function v(t,e){for(var n=Object.keys(t),r={},i=0;i<n.length;i++){var o=n[i],a=t[o];e(a)&&(r[o]=a)}return r}function R(t,e){return!!x(t)&&t.hasOwnProperty(e)}function A(t,e){return void 0!==N(t,function(t){return t===e})}function _(t){for(var e=[],n=0;n<t.length;n++)e.push(t[n]);return e}function g(t){var e={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function N(t,e){for(var n=0;n<t.length;n++){var r=t[n];if(e.call(null,r))return r}}function I(t,e){for(var n=[],r=0;r<t.length;r++){var i=t[r];e.call(null,i)&&n.push(i)}return n}function O(t,e,n){for(var r=Array.isArray(t),a=r?t:o(t),s=r?[]:i(t),c=n,u=0;u<a.length;u++)c=e.call(null,c,a[u],r?u:s[u]);return c}function S(t){return y(t,function(t){return null==t})}function L(t,e){void 0===e&&(e=function(t){return t});var n=[];return O(t,function(t,r){var i=e(r);return A(n,i)?t:(n.push(i),t.concat(r))},[])}function P(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=[null].concat(e);return Function.bind.apply(t,r)}function C(t){return Array.isArray(t)}function k(t){return t instanceof RegExp}function x(t){return t instanceof Object}function M(t,e){for(var n=0;n<t.length;n++)if(!e(t[n],n))return!1;return!0}function F(t,e){return y(t,function(t){return A(e,t)})}function b(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return!0;return!1}function D(t,e){for(var n=0;n<t.length;n++)if(t[n]===e)return n;return-1}function U(t,e){var n=_(t);return n.sort(function(t,n){return e(t)-e(n)}),n}function w(t,e){if(t.length!==e.length)throw Error("can't zipObject with different number of keys and values!");for(var n={},r=0;r<t.length;r++)n[t[r]]=e[r];return n}function G(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++)for(var o=e[r],a=i(o),s=0;s<a.length;s++){var c=a[s];t[c]=o[c]}return t}function K(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var o=e[r];if(!f(o))for(var a=i(o),s=0;s<a.length;s++){var c=a[s];R(t,c)||(t[c]=o[c])}}return t}function B(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return K.apply(null,[{}].concat(t))}function W(t,e){var n={};return p(t,function(t){var r=e(t),i=n[r];i?i.push(t):n[r]=[t]}),n}function j(t,e){for(var n=g(t),r=i(e),o=0;o<r.length;o++){var a=r[o],s=e[a];n[a]=s}return n}function V(){}function Y(t){return t}function X(t){for(var e=[],n=0;n<t.length;n++){var r=t[n];e.push(void 0!==r?r:void 0)}return e}function z(t){console&&console.error&&console.error("Error: "+t)}function H(t){console&&console.warn&&console.warn("Warning: "+t)}function q(){return"function"==typeof Map}function $(t,e){e.forEach(function(e){var n=e.prototype;Object.getOwnPropertyNames(n).forEach(function(r){if("constructor"!==r){var i=Object.getOwnPropertyDescriptor(n,r);i&&(i.get||i.set)?Object.defineProperty(t.prototype,r,i):t.prototype[r]=e.prototype[r]}})})}function Z(t){function e(){}e.prototype=t;var n=new e;function r(){return typeof n.bar}return r(),r(),t}function Q(t){return t[t.length-1]}function J(t){var e=(new Date).getTime(),n=t();return{time:(new Date).getTime()-e,value:n}}Object.defineProperty(e,"__esModule",{value:!0}),e.isEmpty=r,e.keys=i,e.values=o,e.mapValues=a,e.map=s,e.flatten=c,e.first=u,e.last=l,e.forEach=p,e.isString=h,e.isUndefined=f,e.isFunction=d,e.drop=m,e.dropRight=E,e.filter=T,e.reject=y,e.pick=v,e.has=R,e.contains=A,e.cloneArr=_,e.cloneObj=g,e.find=N,e.findAll=I,e.reduce=O,e.compact=S,e.uniq=L,e.partial=P,e.isArray=C,e.isRegExp=k,e.isObject=x,e.every=M,e.difference=F,e.some=b,e.indexOf=D,e.sortBy=U,e.zipObject=w,e.assign=G,e.assignNoOverwrite=K,e.defaults=B,e.groupBy=W,e.merge=j,e.NOOP=V,e.IDENTITY=Y,e.packArray=X,e.PRINT_ERROR=z,e.PRINT_WARNING=H,e.isES2015MapSupported=q,e.applyMixins=$,e.toFastProperties=Z,e.peek=Q,e.timer=J},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(3),s=function(){function t(t){this.definition=t}return t.prototype.accept=function(t){t.visit(this),o.forEach(this.definition,function(e){e.accept(t)})},t}();e.AbstractProduction=s;var c=function(t){function e(e){var n=t.call(this,[])||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),Object.defineProperty(e.prototype,"definition",{get:function(){return void 0!==this.referencedRule?this.referencedRule.definition:[]},set:function(t){},enumerable:!0,configurable:!0}),e.prototype.accept=function(t){t.visit(this)},e}(s);e.NonTerminal=c;var u=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.orgText="",o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.Rule=u;var l=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.ignoreAmbiguities=!1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.Flat=l;var p=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.Option=p;var h=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.RepetitionMandatory=h;var f=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.RepetitionMandatoryWithSeparator=f;var d=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.Repetition=d;var m=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.RepetitionWithSeparator=m;var E=function(t){function e(e){var n=t.call(this,e.definition)||this;return n.idx=1,n.ignoreAmbiguities=!1,n.hasPredicates=!1,o.assign(n,o.pick(e,function(t){return void 0!==t})),n}return i(e,t),e}(s);e.Alternation=E;var T=function(){function t(t){this.idx=1,o.assign(this,o.pick(t,function(t){return void 0!==t}))}return t.prototype.accept=function(t){t.visit(this)},t}();function y(t){function e(t){return o.map(t,y)}if(t instanceof c)return{type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};if(t instanceof l)return{type:"Flat",definition:e(t.definition)};if(t instanceof p)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof h)return{type:"RepetitionMandatory",name:t.name,idx:t.idx,definition:e(t.definition)};if(t instanceof f)return{type:"RepetitionMandatoryWithSeparator",name:t.name,idx:t.idx,separator:y(new T({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof m)return{type:"RepetitionWithSeparator",name:t.name,idx:t.idx,separator:y(new T({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof d)return{type:"Repetition",name:t.name,idx:t.idx,definition:e(t.definition)};if(t instanceof E)return{type:"Alternation",name:t.name,idx:t.idx,definition:e(t.definition)};if(t instanceof T){var n={type:"Terminal",name:t.terminalType.name,label:a.tokenLabel(t.terminalType),idx:t.idx},r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=o.isRegExp(r)?r.source:r),n}if(t instanceof u)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}e.Terminal=T,e.serializeGrammar=function(t){return o.map(t,y)},e.serializeProduction=y},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(27),s=n(3),c=n(17),u=n(10),l=n(24),p=n(25),h=n(30),f=n(31),d=n(33),m=n(34),E=n(35),T=n(36),y=n(37),v=n(38),R=n(39);e.END_OF_FILE=s.createTokenInstance(s.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(e.END_OF_FILE),e.DEFAULT_PARSER_CONFIG=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:u.defaultParserErrorProvider,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),e.DEFAULT_RULE_CONFIG=Object.freeze({recoveryValueFunc:function(){},resyncEnabled:!0}),function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.INVALID_NESTED_RULE_NAME=10]="INVALID_NESTED_RULE_NAME",t[t.DUPLICATE_NESTED_NAME=11]="DUPLICATE_NESTED_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=12]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=13]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=14]="TOO_MANY_ALTS"}(e.ParserDefinitionErrorType||(e.ParserDefinitionErrorType={})),e.EMPTY_ALT=function(t){return void 0===t&&(t=void 0),function(){return t}};var A=function(){function t(t,n){void 0===n&&(n=e.DEFAULT_PARSER_CONFIG),this.ignoredIssues=e.DEFAULT_PARSER_CONFIG.ignoredIssues,this.definitionErrors=[],this.selfAnalysisDone=!1;this.initErrorHandler(n),this.initLexerAdapter(),this.initLooksAhead(n),this.initRecognizerEngine(t,n),this.initRecoverable(n),this.initTreeBuilder(n),this.initContentAssist(),this.initGastRecorder(n),this.initPerformanceTracer(n),o.has(n,"ignoredIssues")&&n.ignoredIssues!==e.DEFAULT_PARSER_CONFIG.ignoredIssues&&o.PRINT_WARNING("The <ignoredIssues> IParserConfig property is soft-deprecated and will be removed in future versions.\n\tPlease use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead."),this.ignoredIssues=o.has(n,"ignoredIssues")?n.ignoredIssues:e.DEFAULT_PARSER_CONFIG.ignoredIssues,this.skipValidations=o.has(n,"skipValidations")?n.skipValidations:e.DEFAULT_PARSER_CONFIG.skipValidations}return t.performSelfAnalysis=function(t){t.performSelfAnalysis()},t.prototype.performSelfAnalysis=function(){var e=this;this.TRACE_INIT("performSelfAnalysis",function(){var n;e.selfAnalysisDone=!0;var r=e.className;e.TRACE_INIT("toFastProps",function(){o.toFastProperties(e)}),e.TRACE_INIT("Grammar Recording",function(){try{e.enableRecording(),o.forEach(e.definedRulesNames,function(t){var n=e[t].originalGrammarAction,r=void 0;e.TRACE_INIT(t+" Rule",function(){r=e.topLevelRuleRecord(t,n)}),e.gastProductionsCache[t]=r})}finally{e.disableRecording()}});var i=[];if(e.TRACE_INIT("Grammar Resolving",function(){i=l.resolveGrammar({rules:o.values(e.gastProductionsCache)}),e.definitionErrors.push.apply(e.definitionErrors,i)}),e.TRACE_INIT("Grammar Validations",function(){if(o.isEmpty(i)&&!1===e.skipValidations){var t=l.validateGrammar({rules:o.values(e.gastProductionsCache),maxLookahead:e.maxLookahead,tokenTypes:o.values(e.tokensMap),ignoredIssues:e.ignoredIssues,errMsgProvider:u.defaultGrammarValidatorErrorProvider,grammarName:r});e.definitionErrors.push.apply(e.definitionErrors,t)}}),o.isEmpty(e.definitionErrors)&&(e.recoveryEnabled&&e.TRACE_INIT("computeAllProdsFollows",function(){var t=a.computeAllProdsFollows(o.values(e.gastProductionsCache));e.resyncFollows=t}),e.TRACE_INIT("ComputeLookaheadFunctions",function(){e.preComputeLookaheadFunctions(o.values(e.gastProductionsCache))})),e.TRACE_INIT("expandAllNestedRuleNames",function(){var t=c.expandAllNestedRuleNames(o.values(e.gastProductionsCache),e.fullRuleNameToShort);e.allRuleNames=t.allRuleNames}),!t.DEFER_DEFINITION_ERRORS_HANDLING&&!o.isEmpty(e.definitionErrors))throw n=o.map(e.definitionErrors,function(t){return t.message}),new Error("Parser Definition Errors detected:\n "+n.join("\n-------------------------------\n"))})},t.DEFER_DEFINITION_ERRORS_HANDLING=!1,t}();e.Parser=A,o.applyMixins(A,[p.Recoverable,h.LooksAhead,f.TreeBuilder,d.LexerAdapter,E.RecognizerEngine,m.RecognizerApi,T.ErrorHandler,y.ContentAssist,v.GastRecorder,R.PerformanceTracer]);var _=function(t){function n(n,r){void 0===r&&(r=e.DEFAULT_PARSER_CONFIG);var i=o.cloneObj(r);return i.outputCst=!0,t.call(this,n,i)||this}return i(n,t),n}(A);e.CstParser=_;var g=function(t){function n(n,r){void 0===r&&(r=e.DEFAULT_PARSER_CONFIG);var i=o.cloneObj(r);return i.outputCst=!1,t.call(this,n,i)||this}return i(n,t),n}(A);e.EmbeddedActionsParser=g},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(9),o=n(5);function a(t){return r.isString(t.LABEL)&&""!==t.LABEL}e.tokenLabel=function(t){return a(t)?t.LABEL:t.name},e.tokenName=function(t){return t.name},e.hasTokenLabel=a;var s="parent",c="categories",u="label",l="group",p="push_mode",h="pop_mode",f="longer_alt",d="line_breaks",m="start_chars_hint";function E(t){return function(t){var e=t.pattern,n={};n.name=t.name,r.isUndefined(e)||(n.PATTERN=e);if(r.has(t,s))throw"The parent property is no longer supported.\nSee: https://github.com/SAP/chevrotain/issues/564#issuecomment-349062346 for details.";r.has(t,c)&&(n.CATEGORIES=t[c]);o.augmentTokenTypes([n]),r.has(t,u)&&(n.LABEL=t[u]);r.has(t,l)&&(n.GROUP=t[l]);r.has(t,h)&&(n.POP_MODE=t[h]);r.has(t,p)&&(n.PUSH_MODE=t[p]);r.has(t,f)&&(n.LONGER_ALT=t[f]);r.has(t,d)&&(n.LINE_BREAKS=t[d]);r.has(t,m)&&(n.START_CHARS_HINT=t[m]);return n}(t)}e.createToken=E,e.EOF=E({name:"EOF",pattern:i.Lexer.NA}),o.augmentTokenTypes([e.EOF]),e.createTokenInstance=function(t,e,n,r,i,o,a,s){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:o,startColumn:a,endColumn:s,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}},e.tokenMatcher=function(t,e){return o.tokenStructuredMatcher(t,e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),i=function(){function t(){}return t.prototype.visit=function(t){var e=t;switch(e.constructor){case r.NonTerminal:return this.visitNonTerminal(e);case r.Flat:return this.visitFlat(e);case r.Option:return this.visitOption(e);case r.RepetitionMandatory:return this.visitRepetitionMandatory(e);case r.RepetitionMandatoryWithSeparator:return this.visitRepetitionMandatoryWithSeparator(e);case r.RepetitionWithSeparator:return this.visitRepetitionWithSeparator(e);case r.Repetition:return this.visitRepetition(e);case r.Alternation:return this.visitAlternation(e);case r.Terminal:return this.visitTerminal(e);case r.Rule:return this.visitRule(e);default:throw Error("non exhaustive match")}},t.prototype.visitNonTerminal=function(t){},t.prototype.visitFlat=function(t){},t.prototype.visitOption=function(t){},t.prototype.visitRepetition=function(t){},t.prototype.visitRepetitionMandatory=function(t){},t.prototype.visitRepetitionMandatoryWithSeparator=function(t){},t.prototype.visitRepetitionWithSeparator=function(t){},t.prototype.visitAlternation=function(t){},t.prototype.visitTerminal=function(t){},t.prototype.visitRule=function(t){},t}();e.GAstVisitor=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);function i(t){for(var e=r.cloneArr(t),n=t,i=!0;i;){n=r.compact(r.flatten(r.map(n,function(t){return t.CATEGORIES})));var o=r.difference(n,e);e=e.concat(o),r.isEmpty(o)?i=!1:n=o}return e}function o(t){r.forEach(t,function(t){u(t)||(e.tokenIdxToClass[e.tokenShortNameIdx]=t,t.tokenTypeIdx=e.tokenShortNameIdx++),l(t)&&!r.isArray(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),l(t)||(t.CATEGORIES=[]),p(t)||(t.categoryMatches=[]),h(t)||(t.categoryMatchesMap={})})}function a(t){r.forEach(t,function(t){t.categoryMatches=[],r.forEach(t.categoryMatchesMap,function(n,r){t.categoryMatches.push(e.tokenIdxToClass[r].tokenTypeIdx)})})}function s(t){r.forEach(t,function(t){c([],t)})}function c(t,e){r.forEach(t,function(t){e.categoryMatchesMap[t.tokenTypeIdx]=!0}),r.forEach(e.CATEGORIES,function(n){var i=t.concat(e);r.contains(i,n)||c(i,n)})}function u(t){return r.has(t,"tokenTypeIdx")}function l(t){return r.has(t,"CATEGORIES")}function p(t){return r.has(t,"categoryMatches")}function h(t){return r.has(t,"categoryMatchesMap")}e.tokenStructuredMatcher=function(t,e){var n=t.tokenTypeIdx;return n===e.tokenTypeIdx||!0===e.isParent&&!0===e.categoryMatchesMap[n]},e.tokenStructuredMatcherNoCategories=function(t,e){return t.tokenTypeIdx===e.tokenTypeIdx},e.tokenShortNameIdx=1,e.tokenIdxToClass={},e.augmentTokenTypes=function(t){var e=i(t);o(e),s(e),a(e),r.forEach(e,function(t){t.isParent=t.categoryMatches.length>0})},e.expandCategories=i,e.assignTokenDefaultProps=o,e.assignCategoriesTokensProp=a,e.assignCategoriesMapProp=s,e.singleAssignCategoriesToksMap=c,e.hasShortKeyProperty=u,e.hasCategoriesProperty=l,e.hasExtendingTokensTypesProperty=p,e.hasExtendingTokensTypesMapProperty=h,e.isTokenType=function(t){return r.has(t,"tokenTypeIdx")}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(1),s=n(4);e.isSequenceProd=function(t){return t instanceof a.Flat||t instanceof a.Option||t instanceof a.Repetition||t instanceof a.RepetitionMandatory||t instanceof a.RepetitionMandatoryWithSeparator||t instanceof a.RepetitionWithSeparator||t instanceof a.Terminal||t instanceof a.Rule},e.isOptionalProd=function t(e,n){return void 0===n&&(n=[]),!!(e instanceof a.Option||e instanceof a.Repetition||e instanceof a.RepetitionWithSeparator)||(e instanceof a.Alternation?o.some(e.definition,function(e){return t(e,n)}):!(e instanceof a.NonTerminal&&o.contains(n,e))&&e instanceof a.AbstractProduction&&(e instanceof a.NonTerminal&&n.push(e),o.every(e.definition,function(e){return t(e,n)})))},e.isBranchingProd=function(t){return t instanceof a.Alternation},e.getProductionDslName=function(t){if(t instanceof a.NonTerminal)return"SUBRULE";if(t instanceof a.Option)return"OPTION";if(t instanceof a.Alternation)return"OR";if(t instanceof a.RepetitionMandatory)return"AT_LEAST_ONE";if(t instanceof a.RepetitionMandatoryWithSeparator)return"AT_LEAST_ONE_SEP";if(t instanceof a.RepetitionWithSeparator)return"MANY_SEP";if(t instanceof a.Repetition)return"MANY";if(t instanceof a.Terminal)return"CONSUME";throw Error("non exhaustive match")};var c=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.separator="-",e.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]},e}return i(e,t),e.prototype.reset=function(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}},e.prototype.visitTerminal=function(t){var e=t.terminalType.name+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitNonTerminal=function(t){var e=t.nonTerminalName+this.separator+"Terminal";o.has(this.dslMethods,e)||(this.dslMethods[e]=[]),this.dslMethods[e].push(t)},e.prototype.visitOption=function(t){this.dslMethods.option.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.dslMethods.repetitionWithSeparator.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.dslMethods.repetitionMandatory.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.dslMethods.repetitionMandatoryWithSeparator.push(t)},e.prototype.visitRepetition=function(t){this.dslMethods.repetition.push(t)},e.prototype.visitAlternation=function(t){this.dslMethods.alternation.push(t)},e}(s.GAstVisitor);e.DslMethodsCollectorVisitor=c;var u=new c;e.collectMethods=function(t){u.reset(),t.accept(u);var e=u.dslMethods;return u.reset(),e}},function(t,e,n){"use strict";function r(t,e,n){return n|e|t}Object.defineProperty(e,"__esModule",{value:!0}),e.BITS_FOR_METHOD_TYPE=4,e.BITS_FOR_OCCURRENCE_IDX=8,e.BITS_FOR_RULE_IDX=12,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1<<e.BITS_FOR_OCCURRENCE_IDX,e.OPTION_IDX=2<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_IDX=3<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_IDX=4<<e.BITS_FOR_OCCURRENCE_IDX,e.MANY_SEP_IDX=5<<e.BITS_FOR_OCCURRENCE_IDX,e.AT_LEAST_ONE_SEP_IDX=6<<e.BITS_FOR_OCCURRENCE_IDX,e.getKeyForAutomaticLookahead=r;var i=32-e.BITS_FOR_ALT_IDX;e.getKeyForAltIndex=function(t,e,n,o){var a=o+1<<i;return r(t,e,n)|a}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i="MismatchedTokenException",o="NoViableAltException",a="EarlyExitException",s="NotAllInputParsedException",c=[i,o,a,s];function u(t,e,n){this.name=i,this.message=t,this.token=e,this.previousToken=n,this.resyncedTokens=[]}function l(t,e,n){this.name=o,this.message=t,this.token=e,this.previousToken=n,this.resyncedTokens=[]}function p(t,e){this.name=s,this.message=t,this.token=e,this.resyncedTokens=[]}function h(t,e,n){this.name=a,this.message=t,this.token=e,this.previousToken=n,this.resyncedTokens=[]}Object.freeze(c),e.isRecognitionException=function(t){return r.contains(c,t.name)},e.MismatchedTokenException=u,u.prototype=Error.prototype,e.NoViableAltException=l,l.prototype=Error.prototype,e.NotAllInputParsedException=p,p.prototype=Error.prototype,e.EarlyExitException=h,h.prototype=Error.prototype},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(20),i=n(0),o=n(5),a=n(21),s=n(16);!function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK"}(e.LexerDefinitionErrorType||(e.LexerDefinitionErrorType={}));var c={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:["\n","\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:a.defaultLexerErrorProvider,traceInitPerf:!1,skipValidations:!1};Object.freeze(c);var u=function(){function t(t,e){var n=this;if(void 0===e&&(e=c),this.lexerDefinition=t,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.config=void 0,this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},"boolean"==typeof e)throw Error("The second argument to the Lexer constructor is now an ILexerConfig Object.\na boolean 2nd argument is no longer supported");this.config=i.merge(c,e);var a=this.config.traceInitPerf;!0===a?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):"number"==typeof a&&(this.traceInitMaxIdent=a,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",function(){var a,u=!0;n.TRACE_INIT("Lexer Config handling",function(){if(n.config.lineTerminatorsPattern===c.lineTerminatorsPattern)n.config.lineTerminatorsPattern=r.LineTerminatorOptimizedTester;else if(n.config.lineTerminatorCharacters===c.lineTerminatorCharacters)throw Error("Error: Missing <lineTerminatorCharacters> property on the Lexer config.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS");if(e.safeMode&&e.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');n.trackStartLines=/full|onlyStart/i.test(n.config.positionTracking),n.trackEndLines=/full/i.test(n.config.positionTracking),i.isArray(t)?((a={modes:{}}).modes[r.DEFAULT_MODE]=i.cloneArr(t),a[r.DEFAULT_MODE]=r.DEFAULT_MODE):(u=!1,a=i.cloneObj(t))}),!1===n.config.skipValidations&&(n.TRACE_INIT("performRuntimeChecks",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.performRuntimeChecks(a,n.trackStartLines,n.config.lineTerminatorCharacters))}),n.TRACE_INIT("performWarningRuntimeChecks",function(){n.lexerDefinitionWarning=n.lexerDefinitionWarning.concat(r.performWarningRuntimeChecks(a,n.trackStartLines,n.config.lineTerminatorCharacters))})),a.modes=a.modes?a.modes:{},i.forEach(a.modes,function(t,e){a.modes[e]=i.reject(t,function(t){return i.isUndefined(t)})});var l=i.keys(a.modes);if(i.forEach(a.modes,function(t,a){n.TRACE_INIT("Mode: <"+a+"> processing",function(){var s;(n.modes.push(a),!1===n.config.skipValidations&&n.TRACE_INIT("validatePatterns",function(){n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.validatePatterns(t,l))}),i.isEmpty(n.lexerDefinitionErrors))&&(o.augmentTokenTypes(t),n.TRACE_INIT("analyzeTokenTypes",function(){s=r.analyzeTokenTypes(t,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode,tracer:n.TRACE_INIT.bind(n)})}),n.patternIdxToConfig[a]=s.patternIdxToConfig,n.charCodeToPatternIdxToConfig[a]=s.charCodeToPatternIdxToConfig,n.emptyGroups=i.merge(n.emptyGroups,s.emptyGroups),n.hasCustom=s.hasCustom||n.hasCustom,n.canModeBeOptimized[a]=s.canBeOptimized)})}),n.defaultMode=a.defaultMode,!i.isEmpty(n.lexerDefinitionErrors)&&!n.config.deferDefinitionErrorsHandling){var p=i.map(n.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+p)}i.forEach(n.lexerDefinitionWarning,function(t){i.PRINT_WARNING(t.message)}),n.TRACE_INIT("Choosing sub-methods implementations",function(){if(r.SUPPORT_STICKY?(n.chopInput=i.IDENTITY,n.match=n.matchWithTest):(n.updateLastIndex=i.NOOP,n.match=n.matchWithExec),u&&(n.handleModes=i.NOOP),!1===n.trackStartLines&&(n.computeNewColumn=i.IDENTITY),!1===n.trackEndLines&&(n.updateTokenEndLineColumnLocation=i.NOOP),/full/i.test(n.config.positionTracking))n.createTokenInstance=n.createFullToken;else if(/onlyStart/i.test(n.config.positionTracking))n.createTokenInstance=n.createStartOnlyToken;else{if(!/onlyOffset/i.test(n.config.positionTracking))throw Error('Invalid <positionTracking> config option: "'+n.config.positionTracking+'"');n.createTokenInstance=n.createOffsetOnlyToken}n.hasCustom?(n.addToken=n.addTokenUsingPush,n.handlePayload=n.handlePayloadWithCustom):(n.addToken=n.addTokenUsingMemberAccess,n.handlePayload=n.handlePayloadNoCustom)}),n.TRACE_INIT("Failed Optimization Warnings",function(){var t=i.reduce(n.canModeBeOptimized,function(t,e,n){return!1===e&&t.push(n),t},[]);if(e.ensureOptimizations&&!i.isEmpty(t))throw Error("Lexer Modes: < "+t.join(", ")+' > cannot be optimized.\n\t Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.\n\t Or inspect the console log for details on how to resolve these issues.')}),n.TRACE_INIT("clearRegExpParserCache",function(){s.clearRegExpParserCache()}),n.TRACE_INIT("toFastProperties",function(){i.toFastProperties(n)})})}return t.prototype.tokenize=function(t,e){if(void 0===e&&(e=this.defaultMode),!i.isEmpty(this.lexerDefinitionErrors)){var n=i.map(this.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Unable to Tokenize because Errors detected in definition of Lexer:\n"+n)}return this.tokenizeInternal(t,e)},t.prototype.tokenizeInternal=function(t,e){var n,o,a,s,c,u,l,p,h,f,d,m,E,T,y=this,v=t,R=v.length,A=0,_=0,g=this.hasCustom?0:Math.floor(t.length/10),N=new Array(g),I=[],O=this.trackStartLines?1:void 0,S=this.trackStartLines?1:void 0,L=r.cloneEmptyGroups(this.emptyGroups),P=this.trackStartLines,C=this.config.lineTerminatorsPattern,k=0,x=[],M=[],F=[],b=[];Object.freeze(b);var D=void 0;function U(){return x}function w(t){var e=r.charCodeToOptimizedIndex(t),n=M[e];return void 0===n?b:n}var G,K=function(t){if(1===F.length&&void 0===t.tokenType.PUSH_MODE){var e=y.config.errorMessageProvider.buildUnableToPopLexerModeMessage(t);I.push({offset:t.startOffset,line:void 0!==t.startLine?t.startLine:void 0,column:void 0!==t.startColumn?t.startColumn:void 0,length:t.image.length,message:e})}else{F.pop();var n=i.last(F);x=y.patternIdxToConfig[n],M=y.charCodeToPatternIdxToConfig[n],k=x.length;var r=y.canModeBeOptimized[n]&&!1===y.config.safeMode;D=M&&r?w:U}};function B(t){F.push(t),M=this.charCodeToPatternIdxToConfig[t],x=this.patternIdxToConfig[t],k=x.length,k=x.length;var e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;D=M&&e?w:U}for(B.call(this,e);A<R;){c=null;var W=v.charCodeAt(A),j=D(W),V=j.length;for(n=0;n<V;n++){var Y=(G=j[n]).pattern;if(u=null,!1!==(et=G.short)?W===et&&(c=Y):!0===G.isCustom?null!==(T=Y.exec(v,A,N,L))?(c=T[0],void 0!==T.payload&&(u=T.payload)):c=null:(this.updateLastIndex(Y,A),c=this.match(Y,t,A)),null!==c){if(void 0!==(s=G.longerAlt)){var X=x[s],z=X.pattern;l=null,!0===X.isCustom?null!==(T=z.exec(v,A,N,L))?(a=T[0],void 0!==T.payload&&(l=T.payload)):a=null:(this.updateLastIndex(z,A),a=this.match(z,t,A)),a&&a.length>c.length&&(c=a,u=l,G=X)}break}}if(null!==c){if(p=c.length,void 0!==(h=G.group)&&(f=G.tokenTypeIdx,d=this.createTokenInstance(c,A,f,G.tokenType,O,S,p),this.handlePayload(d,u),!1===h?_=this.addToken(N,_,d):L[h].push(d)),t=this.chopInput(t,p),A+=p,S=this.computeNewColumn(S,p),!0===P&&!0===G.canLineTerminator){var H=0,q=void 0,$=void 0;C.lastIndex=0;do{!0===(q=C.test(c))&&($=C.lastIndex-1,H++)}while(!0===q);0!==H&&(O+=H,S=p-$,this.updateTokenEndLineColumnLocation(d,h,$,H,O,S,p))}this.handleModes(G,K,B,d)}else{for(var Z=A,Q=O,J=S,tt=!1;!tt&&A<R;)for(v.charCodeAt(A),t=this.chopInput(t,1),A++,o=0;o<k;o++){var et,nt=x[o];Y=nt.pattern;if(!1!==(et=nt.short)?v.charCodeAt(A)===et&&(tt=!0):!0===nt.isCustom?tt=null!==Y.exec(v,A,N,L):(this.updateLastIndex(Y,A),tt=null!==Y.exec(t)),!0===tt)break}m=A-Z,E=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(v,Z,m,Q,J),I.push({offset:Z,line:Q,column:J,length:m,message:E})}}return this.hasCustom||(N.length=_),{tokens:N,groups:L,errors:I}},t.prototype.handleModes=function(t,e,n,r){if(!0===t.pop){var i=t.push;e(r),void 0!==i&&n.call(this,i)}else void 0!==t.push&&n.call(this,t.push)},t.prototype.chopInput=function(t,e){return t.substring(e)},t.prototype.updateLastIndex=function(t,e){t.lastIndex=e},t.prototype.updateTokenEndLineColumnLocation=function(t,e,n,r,i,o,a){var s,c;void 0!==e&&(c=(s=n===a-1)?-1:0,1===r&&!0===s||(t.endLine=i+c,t.endColumn=o-1-c))},t.prototype.computeNewColumn=function(t,e){return t+e},t.prototype.createTokenInstance=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return null},t.prototype.createOffsetOnlyToken=function(t,e,n,r){return{image:t,startOffset:e,tokenTypeIdx:n,tokenType:r}},t.prototype.createStartOnlyToken=function(t,e,n,r,i,o){return{image:t,startOffset:e,startLine:i,startColumn:o,tokenTypeIdx:n,tokenType:r}},t.prototype.createFullToken=function(t,e,n,r,i,o,a){return{image:t,startOffset:e,endOffset:e+a-1,startLine:i,endLine:i,startColumn:o,endColumn:o+a-1,tokenTypeIdx:n,tokenType:r}},t.prototype.addToken=function(t,e,n){return 666},t.prototype.addTokenUsingPush=function(t,e,n){return t.push(n),e},t.prototype.addTokenUsingMemberAccess=function(t,e,n){return t[e]=n,++e},t.prototype.handlePayload=function(t,e){},t.prototype.handlePayloadNoCustom=function(t,e){},t.prototype.handlePayloadWithCustom=function(t,e){null!==e&&(t.payload=e)},t.prototype.match=function(t,e,n){return null},t.prototype.matchWithTest=function(t,e,n){return!0===t.test(e)?e.substring(n,t.lastIndex):null},t.prototype.matchWithExec=function(t,e){var n=t.exec(e);return null!==n?n[0]:n},t.prototype.TRACE_INIT=function(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+t+">");var r=i.timer(e),o=r.time,a=r.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+t+"> time: "+o+"ms"),this.traceInitIndent--,a}return e()},t.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",t.NA=/NOT_APPLICABLE/,t}();e.Lexer=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(0),o=n(0),a=n(1),s=n(6),c=n(11);e.defaultParserErrorProvider={buildMismatchTokenMessage:function(t){var e=t.expected,n=t.actual;t.previous,t.ruleName;return"Expecting "+(r.hasTokenLabel(e)?"--\x3e "+r.tokenLabel(e)+" <--":"token of type --\x3e "+e.name+" <--")+" but found --\x3e '"+n.image+"' <--"},buildNotAllInputParsedMessage:function(t){var e=t.firstRedundant;t.ruleName;return"Redundant input, expecting EOF but found: "+e.image},buildNoViableAltMessage:function(t){var e=t.expectedPathsPerAlt,n=t.actual,i=(t.previous,t.customUserDescription),a=(t.ruleName,"\nbut found: '"+o.first(n).image+"'");if(i)return"Expecting: "+i+a;var s=o.reduce(e,function(t,e){return t.concat(e)},[]),c=o.map(s,function(t){return"["+o.map(t,function(t){return r.tokenLabel(t)}).join(", ")+"]"});return"Expecting: "+("one of these possible Token sequences:\n"+o.map(c,function(t,e){return" "+(e+1)+". "+t}).join("\n"))+a},buildEarlyExitMessage:function(t){var e=t.expectedIterationPaths,n=t.actual,i=t.customUserDescription,a=(t.ruleName,"\nbut found: '"+o.first(n).image+"'");return i?"Expecting: "+i+a:"Expecting: "+("expecting at least one iteration which starts with one of these possible Token sequences::\n <"+o.map(e,function(t){return"["+o.map(t,function(t){return r.tokenLabel(t)}).join(",")+"]"}).join(" ,")+">")+a}},Object.freeze(e.defaultParserErrorProvider),e.defaultGrammarResolverErrorProvider={buildRuleNotFoundError:function(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+"<-\ninside top level rule: ->"+t.name+"<-"}},e.defaultGrammarValidatorErrorProvider={buildDuplicateFoundError:function(t,e){var n,r=t.name,i=o.first(e),c=i.idx,u=s.getProductionDslName(i),l=(n=i)instanceof a.Terminal?n.terminalType.name:n instanceof a.NonTerminal?n.nonTerminalName:"",p="->"+u+(c>0?c:"")+"<- "+(l?"with argument: ->"+l+"<-":"")+"\n appears more than once ("+e.length+" times) in the top level rule: ->"+r+"<-. \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return p=(p=p.replace(/[ \t]+/g," ")).replace(/\s\s+/g,"\n")},buildInvalidNestedRuleNameError:function(t,e){return"Invalid nested rule name: ->"+e.name+"<- inside rule: ->"+t.name+"<-\nit must match the pattern: ->"+c.validNestedRuleName.toString()+"<-.\nNote that this means a nested rule name must start with the '$'(dollar) sign."},buildDuplicateNestedRuleNameError:function(t,e){return"Duplicate nested rule name: ->"+o.first(e).name+"<- inside rule: ->"+t.name+"<-\nA nested name must be unique in the scope of a top level grammar rule."},buildNamespaceConflictError:function(t){return"Namespace conflict found in grammar.\nThe grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <"+t.name+">.\nTo resolve this make sure each Terminal and Non-Terminal names are unique\nThis is easy to accomplish by using the convention that Terminal names start with an uppercase letter\nand Non-Terminal names start with a lower case letter."},buildAlternationPrefixAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx;return"Ambiguous alternatives: <"+t.ambiguityIndices.join(" ,")+"> due to common lookahead prefix\nin <OR"+n+"> inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\nSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX\nFor Further details."},buildAlternationAmbiguityError:function(t){var e=o.map(t.prefixPath,function(t){return r.tokenLabel(t)}).join(", "),n=0===t.alternation.idx?"":t.alternation.idx,i="Ambiguous Alternatives Detected: <"+t.ambiguityIndices.join(" ,")+"> in <OR"+n+"> inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\n";return i+="See: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES\nFor Further details."},buildEmptyRepetitionError:function(t){var e=s.getProductionDslName(t.repetition);return 0!==t.repetition.idx&&(e+=t.repetition.idx),"The repetition <"+e+"> within Rule <"+t.topLevelRule.name+"> can never consume any tokens.\nThis could lead to an infinite loop."},buildTokenNameError:function(t){return"Invalid Grammar Token name: ->"+t.tokenType.name+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(t){return"Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+"> in <OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+"> Rule.\nOnly the last alternative may be an empty alternative."},buildTooManyAlternativesError:function(t){return"An Alternation cannot have more than 256 alternatives:\n<OR"+t.alternation.idx+"> inside <"+t.topLevelRule.name+"> Rule.\n has "+(t.alternation.definition.length+1)+" alternatives."},buildLeftRecursionError:function(t){var e=t.topLevelRule.name;return"Left Recursion found in grammar.\nrule: <"+e+"> can be invoked from itself (directly or indirectly)\nwithout consuming any Tokens. The grammar path that causes this is: \n "+(e+" --\x3e "+i.map(t.leftRecursionPath,function(t){return t.name}).concat([e]).join(" --\x3e "))+"\n To fix this refactor your grammar to remove the left recursion.\nsee: https://en.wikipedia.org/wiki/LL_parser#Left_Factoring."},buildInvalidRuleNameError:function(t){return"Invalid grammar rule name: ->"+t.topLevelRule.name+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildDuplicateRuleNameError:function(t){return"Duplicate definition, rule: ->"+(t.topLevelRule instanceof a.Rule?t.topLevelRule.name:t.topLevelRule)+"<- is already defined in the grammar: ->"+t.grammarName+"<-"}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(0),s=n(2),c=n(6),u=n(12),l=n(17),p=n(13),h=n(1),f=n(4);function d(t){return c.getProductionDslName(t)+"_#_"+t.idx+"_#_"+m(t)}function m(t){return t instanceof h.Terminal?t.terminalType.name:t instanceof h.NonTerminal?t.nonTerminalName:""}e.validateGrammar=function(t,e,n,r,i,u){var p=o.map(t,function(t){return function(t,e){var n=new E;t.accept(n);var r=n.allProductions,i=o.groupBy(r,d),a=o.pick(i,function(t){return t.length>1});return o.map(o.values(a),function(n){var r=o.first(n),i=e.buildDuplicateFoundError(t,n),a=c.getProductionDslName(r),u={message:i,type:s.ParserDefinitionErrorType.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:a,occurrence:r.idx},l=m(r);return l&&(u.parameter=l),u})}(t,i)}),h=o.map(t,function(t){return A(t,t,i)}),f=[],_=[],g=[];a.every(h,a.isEmpty)&&(f=a.map(t,function(t){return N(t,i)}),_=a.map(t,function(t){return I(t,e,r,i)}),g=L(t,e,i));var O=function(t,e,n){var r=[],i=a.map(e,function(t){return t.name});return a.forEach(t,function(t){var e=t.name;if(a.contains(i,e)){var o=n.buildNamespaceConflictError(t);r.push({message:o,type:s.ParserDefinitionErrorType.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:e})}}),r}(t,n,i),P=o.map(n,function(t){return v(t,i)}),C=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.map(r.result,function(t){return t.orgProd});n.push(a.map(i,function(n){return y(t,n,e)}))}),a.flatten(n)}(t,i),k=function(t,e){var n=[];return a.forEach(t,function(t){var r=new l.NamedDSLMethodsCollectorVisitor("");t.accept(r);var i=a.groupBy(r.result,function(t){return t.name}),o=a.pick(i,function(t){return t.length>1});a.forEach(a.values(o),function(r){var i=a.map(r,function(t){return t.orgProd}),o=e.buildDuplicateNestedRuleNameError(t,i);n.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_NESTED_NAME,ruleName:t.name})})}),n}(t,i),x=a.map(t,function(t){return S(t,i)}),M=a.map(t,function(t){return T(t,i)}),F=a.map(t,function(e){return R(e,t,u,i)});return o.flatten(p.concat(P,C,k,g,h,f,_,O,x,M,F))},e.identifyProductionForDuplicates=d;var E=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitNonTerminal=function(t){this.allProductions.push(t)},e.prototype.visitOption=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e.prototype.visitAlternation=function(t){this.allProductions.push(t)},e.prototype.visitTerminal=function(t){this.allProductions.push(t)},e}(f.GAstVisitor);function T(t,n){var r=[],i=t.name;return i.match(e.validTermsPattern)||r.push({message:n.buildInvalidRuleNameError({topLevelRule:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_RULE_NAME,ruleName:i}),r}function y(t,n,r){var i,o=[];return n.name.match(e.validNestedRuleName)||(i=r.buildInvalidNestedRuleNameError(t,n),o.push({message:i,type:s.ParserDefinitionErrorType.INVALID_NESTED_RULE_NAME,ruleName:t.name})),o}function v(t,n){var r=[];return t.name.match(e.validTermsPattern)||r.push({message:n.buildTokenNameError({tokenType:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function R(t,e,n,r){var i=[];if(a.reduce(e,function(e,n){return n.name===t.name?e+1:e},0)>1){var o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:s.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function A(t,e,n,r){void 0===r&&(r=[]);var i=[],a=_(e.definition);if(o.isEmpty(a))return[];var c=t.name;o.contains(a,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:s.ParserDefinitionErrorType.LEFT_RECURSION,ruleName:c});var u=o.difference(a,r.concat([t])),l=o.map(u,function(e){var i=o.cloneArr(r);return i.push(e),A(t,e,n,i)});return i.concat(o.flatten(l))}function _(t){var e=[];if(o.isEmpty(t))return e;var n=o.first(t);if(n instanceof h.NonTerminal)e.push(n.referencedRule);else if(n instanceof h.Flat||n instanceof h.Option||n instanceof h.RepetitionMandatory||n instanceof h.RepetitionMandatoryWithSeparator||n instanceof h.RepetitionWithSeparator||n instanceof h.Repetition)e=e.concat(_(n.definition));else if(n instanceof h.Alternation)e=o.flatten(o.map(n.definition,function(t){return _(t.definition)}));else if(!(n instanceof h.Terminal))throw Error("non exhaustive match");var r=c.isOptionalProd(n),i=t.length>1;if(r&&i){var a=o.drop(t);return e.concat(_(a))}return e}e.OccurrenceValidationCollector=E,e.validTermsPattern=/^[a-zA-Z_]\w*$/,e.validNestedRuleName=new RegExp(e.validTermsPattern.source.replace("^","^\\$")),e.validateRuleName=T,e.validateNestedRuleName=y,e.validateTokenName=v,e.validateRuleDoesNotAlreadyExist=R,e.validateRuleIsOverridden=function(t,e,n){var r,i=[];return o.contains(e,t)||(r="Invalid rule override, rule: ->"+t+"<- cannot be overridden in the grammar: ->"+n+"<-as it is not defined in any of the super grammars ",i.push({message:r,type:s.ParserDefinitionErrorType.INVALID_RULE_OVERRIDE,ruleName:t})),i},e.validateNoLeftRecursion=A,e.getFirstNoneTerminal=_;var g=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.alternations=[],e}return i(e,t),e.prototype.visitAlternation=function(t){this.alternations.push(t)},e}(f.GAstVisitor);function N(t,e){var n=new g;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){var i=o.dropRight(r.definition),a=o.map(i,function(n,i){var a=p.nextPossibleTokensAfter([n],[],null,1);return o.isEmpty(a)?{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:r,emptyChoiceIdx:i}),type:s.ParserDefinitionErrorType.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:r.idx,alternative:i+1}:null});return n.concat(o.compact(a))},[])}function I(t,e,n,r){var i=new g;t.accept(i);var l=i.alternations,p=n[t.name];return p&&(l=a.reject(l,function(t){return p[c.getProductionDslName(t)+(0===t.idx?"":t.idx)]})),l=a.reject(l,function(t){return!0===t.ignoreAmbiguities}),o.reduce(l,function(n,i){var c=i.idx,l=i.maxLookahead||e,p=u.getLookaheadPathsForOr(c,t,l,i),h=function(t,e,n,r){var i=[],c=a.reduce(t,function(n,r,o){return!0===e.definition[o].ignoreAmbiguities?n:(a.forEach(r,function(r){var s=[o];a.forEach(t,function(t,n){o!==n&&u.containsPath(t,r)&&!0!==e.definition[n].ignoreAmbiguities&&s.push(n)}),s.length>1&&!u.containsPath(i,r)&&(i.push(r),n.push({alts:s,path:r}))}),n)},[]);return o.map(c,function(t){var i=a.map(t.alts,function(t){return t+1}),o=r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path});return{message:o,type:s.ParserDefinitionErrorType.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:[t.alts]}})}(p,i,t,r),f=P(p,i,t,r);return n.concat(h,f)},[])}e.validateEmptyOrAlternative=N,e.validateAmbiguousAlternationAlternatives=I;var O=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.allProductions=[],e}return i(e,t),e.prototype.visitRepetitionWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatory=function(t){this.allProductions.push(t)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.allProductions.push(t)},e.prototype.visitRepetition=function(t){this.allProductions.push(t)},e}(f.GAstVisitor);function S(t,e){var n=new g;t.accept(n);var r=n.alternations;return o.reduce(r,function(n,r){return r.definition.length>255&&n.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:s.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}),n},[])}function L(t,e,n){var r=[];return a.forEach(t,function(t){var i=new O;t.accept(i);var o=i.allProductions;a.forEach(o,function(i){var o=u.getProdType(i),c=i.maxLookahead||e,l=i.idx,p=u.getLookaheadPathsForOptionalProd(l,t,o,c)[0];if(a.isEmpty(a.flatten(p))){var h=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:h,type:s.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}})}),r}function P(t,e,n,r){var i=[],o=a.reduce(t,function(t,e,n){var r=a.map(e,function(t){return{idx:n,path:t}});return t.concat(r)},[]);return a.forEach(o,function(t){if(!0!==e.definition[t.idx].ignoreAmbiguities){var c=t.idx,l=t.path,p=a.findAll(o,function(t){return!0!==e.definition[t.idx].ignoreAmbiguities&&t.idx<c&&u.isStrictPrefixOfPath(t.path,l)}),h=a.map(p,function(t){var i=[t.idx+1,c+1],o=0===e.idx?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:i,prefixPath:t.path}),type:s.ParserDefinitionErrorType.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:o,alternatives:i}});i=i.concat(h)}}),i}e.RepetionCollector=O,e.validateTooManyAlts=S,e.validateSomeNonEmptyLookaheadPath=L,e.checkPrefixAlternativesAmbiguities=P},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o,a=n(0),s=n(13),c=n(14),u=n(5),l=n(1),p=n(4);!function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"}(o=e.PROD_TYPE||(e.PROD_TYPE={})),e.getProdType=function(t){if(t instanceof l.Option)return o.OPTION;if(t instanceof l.Repetition)return o.REPETITION;if(t instanceof l.RepetitionMandatory)return o.REPETITION_MANDATORY;if(t instanceof l.RepetitionMandatoryWithSeparator)return o.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof l.RepetitionWithSeparator)return o.REPETITION_WITH_SEPARATOR;if(t instanceof l.Alternation)return o.ALTERNATION;throw Error("non exhaustive match")},e.buildLookaheadFuncForOr=function(t,e,n,r,i,o){var a=y(t,e,n);return o(a,r,A(a)?u.tokenStructuredMatcherNoCategories:u.tokenStructuredMatcher,i)},e.buildLookaheadFuncForOptionalProd=function(t,e,n,r,i,o){var a=v(t,e,i,n),s=A(a)?u.tokenStructuredMatcherNoCategories:u.tokenStructuredMatcher;return o(a[0],s,r)},e.buildAlternativesLookAheadFunc=function(t,e,n,r){var i=t.length,o=a.every(t,function(t){return a.every(t,function(t){return 1===t.length})});if(e)return function(e){for(var r=a.map(e,function(t){return t.GATE}),o=0;o<i;o++){var s=t[o],c=s.length,u=r[o];if(void 0===u||!1!==u.call(this))t:for(var l=0;l<c;l++){for(var p=s[l],h=p.length,f=0;f<h;f++){var d=this.LA(f+1);if(!1===n(d,p[f]))continue t}return o}}};if(o&&!r){var s=a.map(t,function(t){return a.flatten(t)}),c=a.reduce(s,function(t,e,n){return a.forEach(e,function(e){a.has(t,e.tokenTypeIdx)||(t[e.tokenTypeIdx]=n),a.forEach(e.categoryMatches,function(e){a.has(t,e)||(t[e]=n)})}),t},[]);return function(){var t=this.LA(1);return c[t.tokenTypeIdx]}}return function(){for(var e=0;e<i;e++){var r=t[e],o=r.length;t:for(var a=0;a<o;a++){for(var s=r[a],c=s.length,u=0;u<c;u++){var l=this.LA(u+1);if(!1===n(l,s[u]))continue t}return e}}}},e.buildSingleAlternativeLookaheadFunction=function(t,e,n){var r=a.every(t,function(t){return 1===t.length}),i=t.length;if(r&&!n){var o=a.flatten(t);if(1===o.length&&a.isEmpty(o[0].categoryMatches)){var s=o[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===s}}var c=a.reduce(o,function(t,e,n){return t[e.tokenTypeIdx]=!0,a.forEach(e.categoryMatches,function(e){t[e]=!0}),t},[]);return function(){var t=this.LA(1);return!0===c[t.tokenTypeIdx]}}return function(){t:for(var n=0;n<i;n++){for(var r=t[n],o=r.length,a=0;a<o;a++){var s=this.LA(a+1);if(!1===e(s,r[a]))continue t}return!0}return!1}};var h=function(t){function e(e,n,r){var i=t.call(this)||this;return i.topProd=e,i.targetOccurrence=n,i.targetProdType=r,i}return i(e,t),e.prototype.startWalking=function(){return this.walk(this.topProd),this.restDef},e.prototype.checkIsTarget=function(t,e,n,r){return t.idx===this.targetOccurrence&&this.targetProdType===e&&(this.restDef=n.concat(r),!0)},e.prototype.walkOption=function(e,n,r){this.checkIsTarget(e,o.OPTION,n,r)||t.prototype.walkOption.call(this,e,n,r)},e.prototype.walkAtLeastOne=function(e,n,r){this.checkIsTarget(e,o.REPETITION_MANDATORY,n,r)||t.prototype.walkOption.call(this,e,n,r)},e.prototype.walkAtLeastOneSep=function(e,n,r){this.checkIsTarget(e,o.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||t.prototype.walkOption.call(this,e,n,r)},e.prototype.walkMany=function(e,n,r){this.checkIsTarget(e,o.REPETITION,n,r)||t.prototype.walkOption.call(this,e,n,r)},e.prototype.walkManySep=function(e,n,r){this.checkIsTarget(e,o.REPETITION_WITH_SEPARATOR,n,r)||t.prototype.walkOption.call(this,e,n,r)},e}(c.RestWalker),f=function(t){function e(e,n,r){var i=t.call(this)||this;return i.targetOccurrence=e,i.targetProdType=n,i.targetRef=r,i.result=[],i}return i(e,t),e.prototype.checkIsTarget=function(t,e){t.idx!==this.targetOccurrence||this.targetProdType!==e||void 0!==this.targetRef&&t!==this.targetRef||(this.result=t.definition)},e.prototype.visitOption=function(t){this.checkIsTarget(t,o.OPTION)},e.prototype.visitRepetition=function(t){this.checkIsTarget(t,o.REPETITION)},e.prototype.visitRepetitionMandatory=function(t){this.checkIsTarget(t,o.REPETITION_MANDATORY)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.checkIsTarget(t,o.REPETITION_MANDATORY_WITH_SEPARATOR)},e.prototype.visitRepetitionWithSeparator=function(t){this.checkIsTarget(t,o.REPETITION_WITH_SEPARATOR)},e.prototype.visitAlternation=function(t){this.checkIsTarget(t,o.ALTERNATION)},e}(p.GAstVisitor);function d(t){for(var e=new Array(t),n=0;n<t;n++)e[n]=[];return e}function m(t){for(var e=[""],n=0;n<t.length;n++){for(var r=t[n],i=[],o=0;o<e.length;o++){var a=e[o];i.push(a+"_"+r.tokenTypeIdx);for(var s=0;s<r.categoryMatches.length;s++){var c="_"+r.categoryMatches[s];i.push(a+c)}}e=i}return e}function E(t,e,n){for(var r=0;r<t.length;r++)if(r!==n)for(var i=t[r],o=0;o<e.length;o++){if(!0===i[e[o]])return!1}return!0}function T(t,e){for(var n=a.map(t,function(t){return s.possiblePathsFrom([t],1)}),r=d(n.length),i=a.map(n,function(t){var e={};return a.forEach(t,function(t){var n=m(t.partialPath);a.forEach(n,function(t){e[t]=!0})}),e}),o=n,c=1;c<=e;c++){var u=o;o=d(u.length);for(var l=function(t){for(var n=u[t],l=0;l<n.length;l++){var p=n[l].partialPath,h=n[l].suffixDef,f=m(p);if(E(i,f,t)||a.isEmpty(h)||p.length===e){var d=r[t];if(!1===R(d,p)){d.push(p);for(var T=0;T<f.length;T++){var y=f[T];i[t][y]=!0}}}else{var v=s.possiblePathsFrom(h,c+1,p);o[t]=o[t].concat(v),a.forEach(v,function(e){var n=m(e.partialPath);a.forEach(n,function(e){i[t][e]=!0})})}}},p=0;p<u.length;p++)l(p)}return r}function y(t,e,n,r){var i=new f(t,o.ALTERNATION,r);return e.accept(i),T(i.result,n)}function v(t,e,n,r){var i=new f(t,n);e.accept(i);var o=i.result,a=new h(e,t,n).startWalking();return T([new l.Flat({definition:o}),new l.Flat({definition:a})],r)}function R(t,e){t:for(var n=0;n<t.length;n++){var r=t[n];if(r.length===e.length){for(var i=0;i<r.length;i++){var o=e[i],a=r[i];if(!1===(o===a||void 0!==a.categoryMatchesMap[o.tokenTypeIdx]))continue t}return!0}}return!1}function A(t){return a.every(t,function(t){return a.every(t,function(t){return a.every(t,function(t){return a.isEmpty(t.categoryMatches)})})})}e.lookAheadSequenceFromAlternatives=T,e.getLookaheadPathsForOr=y,e.getLookaheadPathsForOptionalProd=v,e.containsPath=R,e.isStrictPrefixOfPath=function(t,e){return t.length<e.length&&a.every(t,function(t,n){var r=e[n];return t===r||r.categoryMatchesMap[t.tokenTypeIdx]})},e.areTokenCategoriesNotUsed=A},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(14),a=n(0),s=n(22),c=n(1),u=function(t){function e(e,n){var r=t.call(this)||this;return r.topProd=e,r.path=n,r.possibleTokTypes=[],r.nextProductionName="",r.nextProductionOccurrence=0,r.found=!1,r.isAtEndOfPath=!1,r}return i(e,t),e.prototype.startWalking=function(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=a.cloneArr(this.path.ruleStack).reverse(),this.occurrenceStack=a.cloneArr(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes},e.prototype.walk=function(e,n){void 0===n&&(n=[]),this.found||t.prototype.walk.call(this,e,n)},e.prototype.walkProdRef=function(t,e,n){if(t.referencedRule.name===this.nextProductionName&&t.idx===this.nextProductionOccurrence){var r=e.concat(n);this.updateExpectedNext(),this.walk(t.referencedRule,r)}},e.prototype.updateExpectedNext=function(){a.isEmpty(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())},e}(o.RestWalker);e.AbstractNextPossibleTokensWalker=u;var l=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.path=n,r.nextTerminalName="",r.nextTerminalOccurrence=0,r.nextTerminalName=r.path.lastTok.name,r.nextTerminalOccurrence=r.path.lastTokOccurrence,r}return i(e,t),e.prototype.walkTerminal=function(t,e,n){if(this.isAtEndOfPath&&t.terminalType.name===this.nextTerminalName&&t.idx===this.nextTerminalOccurrence&&!this.found){var r=e.concat(n),i=new c.Flat({definition:r});this.possibleTokTypes=s.first(i),this.found=!0}},e}(u);e.NextAfterTokenWalker=l;var p=function(t){function e(e,n){var r=t.call(this)||this;return r.topRule=e,r.occurrence=n,r.result={token:void 0,occurrence:void 0,isEndOfRule:void 0},r}return i(e,t),e.prototype.startWalking=function(){return this.walk(this.topRule),this.result},e}(o.RestWalker);e.AbstractNextTerminalAfterProductionWalker=p;var h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.walkMany=function(e,n,r){if(e.idx===this.occurrence){var i=a.first(n.concat(r));this.result.isEndOfRule=void 0===i,i instanceof c.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else t.prototype.walkMany.call(this,e,n,r)},e}(p);e.NextTerminalAfterManyWalker=h;var f=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.walkManySep=function(e,n,r){if(e.idx===this.occurrence){var i=a.first(n.concat(r));this.result.isEndOfRule=void 0===i,i instanceof c.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else t.prototype.walkManySep.call(this,e,n,r)},e}(p);e.NextTerminalAfterManySepWalker=f;var d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.walkAtLeastOne=function(e,n,r){if(e.idx===this.occurrence){var i=a.first(n.concat(r));this.result.isEndOfRule=void 0===i,i instanceof c.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else t.prototype.walkAtLeastOne.call(this,e,n,r)},e}(p);e.NextTerminalAfterAtLeastOneWalker=d;var m=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return i(e,t),e.prototype.walkAtLeastOneSep=function(e,n,r){if(e.idx===this.occurrence){var i=a.first(n.concat(r));this.result.isEndOfRule=void 0===i,i instanceof c.Terminal&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else t.prototype.walkAtLeastOneSep.call(this,e,n,r)},e}(p);function E(t,e,n,r){var i=a.cloneArr(n);i.push(t.name);var o=a.cloneArr(r);return o.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:o}}e.NextTerminalAfterAtLeastOneSepWalker=m,e.possiblePathsFrom=function t(e,n,r){void 0===r&&(r=[]),r=a.cloneArr(r);var i=[],o=0;function s(s){var c=t(s.concat(a.drop(e,o+1)),n,r);return i.concat(c)}for(;r.length<n&&o<e.length;){var u=e[o];if(u instanceof c.Flat)return s(u.definition);if(u instanceof c.NonTerminal)return s(u.definition);if(u instanceof c.Option)i=s(u.definition);else{if(u instanceof c.RepetitionMandatory)return s(l=u.definition.concat([new c.Repetition({definition:u.definition})]));if(u instanceof c.RepetitionMandatoryWithSeparator)return s(l=[new c.Flat({definition:u.definition}),new c.Repetition({definition:[new c.Terminal({terminalType:u.separator})].concat(u.definition)})]);if(u instanceof c.RepetitionWithSeparator){var l=u.definition.concat([new c.Repetition({definition:[new c.Terminal({terminalType:u.separator})].concat(u.definition)})]);i=s(l)}else if(u instanceof c.Repetition)l=u.definition.concat([new c.Repetition({definition:u.definition})]),i=s(l);else{if(u instanceof c.Alternation)return a.forEach(u.definition,function(t){i=s(t.definition)}),i;if(!(u instanceof c.Terminal))throw Error("non exhaustive match");r.push(u.terminalType)}}o++}return i.push({partialPath:r,suffixDef:a.drop(e,o)}),i},e.nextPossibleTokensAfter=function(t,e,n,r){var i=["EXIT_NONE_TERMINAL"],o=!1,s=e.length,u=s-r-1,l=[],p=[];for(p.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!a.isEmpty(p);){var h=p.pop();if("EXIT_ALTERNATIVE"!==h){var f=h.def,d=h.idx,m=h.ruleStack,T=h.occurrenceStack;if(!a.isEmpty(f)){var y=f[0];if("EXIT_NONE_TERMINAL"===y){var v={idx:d,def:a.drop(f),ruleStack:a.dropRight(m),occurrenceStack:a.dropRight(T)};p.push(v)}else if(y instanceof c.Terminal)if(d<s-1){var R=d+1;n(e[R],y.terminalType)&&(v={idx:R,def:a.drop(f),ruleStack:m,occurrenceStack:T},p.push(v))}else{if(d!==s-1)throw Error("non exhaustive match");l.push({nextTokenType:y.terminalType,nextTokenOccurrence:y.idx,ruleStack:m,occurrenceStack:T}),o=!0}else if(y instanceof c.NonTerminal){var A=a.cloneArr(m);A.push(y.nonTerminalName);var _=a.cloneArr(T);_.push(y.idx),v={idx:d,def:y.definition.concat(i,a.drop(f)),ruleStack:A,occurrenceStack:_},p.push(v)}else if(y instanceof c.Option){var g={idx:d,def:a.drop(f),ruleStack:m,occurrenceStack:T};p.push(g),p.push("EXIT_ALTERNATIVE");var N={idx:d,def:y.definition.concat(a.drop(f)),ruleStack:m,occurrenceStack:T};p.push(N)}else if(y instanceof c.RepetitionMandatory){var I=new c.Repetition({definition:y.definition,idx:y.idx});v={idx:d,def:y.definition.concat([I],a.drop(f)),ruleStack:m,occurrenceStack:T},p.push(v)}else if(y instanceof c.RepetitionMandatoryWithSeparator){var O=new c.Terminal({terminalType:y.separator});I=new c.Repetition({definition:[O].concat(y.definition),idx:y.idx}),v={idx:d,def:y.definition.concat([I],a.drop(f)),ruleStack:m,occurrenceStack:T},p.push(v)}else if(y instanceof c.RepetitionWithSeparator){g={idx:d,def:a.drop(f),ruleStack:m,occurrenceStack:T},p.push(g),p.push("EXIT_ALTERNATIVE"),O=new c.Terminal({terminalType:y.separator});var S=new c.Repetition({definition:[O].concat(y.definition),idx:y.idx});N={idx:d,def:y.definition.concat([S],a.drop(f)),ruleStack:m,occurrenceStack:T},p.push(N)}else if(y instanceof c.Repetition)g={idx:d,def:a.drop(f),ruleStack:m,occurrenceStack:T},p.push(g),p.push("EXIT_ALTERNATIVE"),S=new c.Repetition({definition:y.definition,idx:y.idx}),N={idx:d,def:y.definition.concat([S],a.drop(f)),ruleStack:m,occurrenceStack:T},p.push(N);else if(y instanceof c.Alternation)for(var L=y.definition.length-1;L>=0;L--){var P={idx:d,def:y.definition[L].definition.concat(a.drop(f)),ruleStack:m,occurrenceStack:T};p.push(P),p.push("EXIT_ALTERNATIVE")}else if(y instanceof c.Flat)p.push({idx:d,def:y.definition.concat(a.drop(f)),ruleStack:m,occurrenceStack:T});else{if(!(y instanceof c.Rule))throw Error("non exhaustive match");p.push(E(y,d,m,T))}}}else o&&a.last(p).idx<=u&&p.pop()}return l}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=function(){function t(){}return t.prototype.walk=function(t,e){var n=this;void 0===e&&(e=[]),r.forEach(t.definition,function(o,a){var s=r.drop(t.definition,a+1);if(o instanceof i.NonTerminal)n.walkProdRef(o,s,e);else if(o instanceof i.Terminal)n.walkTerminal(o,s,e);else if(o instanceof i.Flat)n.walkFlat(o,s,e);else if(o instanceof i.Option)n.walkOption(o,s,e);else if(o instanceof i.RepetitionMandatory)n.walkAtLeastOne(o,s,e);else if(o instanceof i.RepetitionMandatoryWithSeparator)n.walkAtLeastOneSep(o,s,e);else if(o instanceof i.RepetitionWithSeparator)n.walkManySep(o,s,e);else if(o instanceof i.Repetition)n.walkMany(o,s,e);else{if(!(o instanceof i.Alternation))throw Error("non exhaustive match");n.walkOr(o,s,e)}})},t.prototype.walkTerminal=function(t,e,n){},t.prototype.walkProdRef=function(t,e,n){},t.prototype.walkFlat=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkOption=function(t,e,n){var r=e.concat(n);this.walk(t,r)},t.prototype.walkAtLeastOne=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkAtLeastOneSep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkMany=function(t,e,n){var r=[new i.Option({definition:t.definition})].concat(e,n);this.walk(t,r)},t.prototype.walkManySep=function(t,e,n){var r=a(t,e,n);this.walk(t,r)},t.prototype.walkOr=function(t,e,n){var o=this,a=e.concat(n);r.forEach(t.definition,function(t){var e=new i.Flat({definition:[t]});o.walk(e,a)})},t}();function a(t,e,n){return[new i.Option({definition:[new i.Terminal({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}e.RestWalker=o},function(t,e,n){var r,i,o;"undefined"!=typeof self&&self,i=[],void 0===(o="function"==typeof(r=function(){function t(){}t.prototype.saveState=function(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}},t.prototype.restoreState=function(t){this.idx=t.idx,this.input=t.input,this.groupIdx=t.groupIdx},t.prototype.pattern=function(t){this.idx=0,this.input=t,this.groupIdx=0,this.consumeChar("/");var e=this.disjunction();this.consumeChar("/");for(var n={type:"Flags",global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};this.isRegExpFlag();)switch(this.popChar()){case"g":s(n,"global");break;case"i":s(n,"ignoreCase");break;case"m":s(n,"multiLine");break;case"u":s(n,"unicode");break;case"y":s(n,"sticky")}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:n,value:e}},t.prototype.disjunction=function(){var t=[];for(t.push(this.alternative());"|"===this.peekChar();)this.consumeChar("|"),t.push(this.alternative());return{type:"Disjunction",value:t}},t.prototype.alternative=function(){for(var t=[];this.isTerm();)t.push(this.term());return{type:"Alternative",value:t}},t.prototype.term=function(){return this.isAssertion()?this.assertion():this.atom()},t.prototype.assertion=function(){switch(this.popChar()){case"^":return{type:"StartAnchor"};case"$":return{type:"EndAnchor"};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary"};case"B":return{type:"NonWordBoundary"}}throw Error("Invalid Assertion Escape");case"(":var t;switch(this.consumeChar("?"),this.popChar()){case"=":t="Lookahead";break;case"!":t="NegativeLookahead"}c(t);var e=this.disjunction();return this.consumeChar(")"),{type:t,value:e}}!function(){throw Error("Internal Error - Should never get here!")}()},t.prototype.quantifier=function(t){var e;switch(this.popChar()){case"*":e={atLeast:0,atMost:1/0};break;case"+":e={atLeast:1,atMost:1/0};break;case"?":e={atLeast:0,atMost:1};break;case"{":var n=this.integerIncludingZero();switch(this.popChar()){case"}":e={atLeast:n,atMost:n};break;case",":var r;this.isDigit()?(r=this.integerIncludingZero(),e={atLeast:n,atMost:r}):e={atLeast:n,atMost:1/0},this.consumeChar("}")}if(!0===t&&void 0===e)return;c(e)}if(!0!==t||void 0!==e)return c(e),"?"===this.peekChar(0)?(this.consumeChar("?"),e.greedy=!1):e.greedy=!0,e.type="Quantifier",e},t.prototype.atom=function(){var t;switch(this.peekChar()){case".":t=this.dotAll();break;case"\\":t=this.atomEscape();break;case"[":t=this.characterClass();break;case"(":t=this.group()}return void 0===t&&this.isPatternCharacter()&&(t=this.patternCharacter()),c(t),this.isQuantifier()&&(t.quantifier=this.quantifier()),t},t.prototype.dotAll=function(){return this.consumeChar("."),{type:"Set",complement:!0,value:[o("\n"),o("\r"),o("\u2028"),o("\u2029")]}},t.prototype.atomEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.decimalEscapeAtom=function(){var t=this.positiveInteger();return{type:"GroupBackReference",value:t}},t.prototype.characterClassEscape=function(){var t,e=!1;switch(this.popChar()){case"d":t=u;break;case"D":t=u,e=!0;break;case"s":t=p;break;case"S":t=p,e=!0;break;case"w":t=l;break;case"W":t=l,e=!0}return c(t),{type:"Set",value:t,complement:e}},t.prototype.controlEscapeAtom=function(){var t;switch(this.popChar()){case"f":t=o("\f");break;case"n":t=o("\n");break;case"r":t=o("\r");break;case"t":t=o("\t");break;case"v":t=o("\v")}return c(t),{type:"Character",value:t}},t.prototype.controlLetterEscapeAtom=function(){this.consumeChar("c");var t=this.popChar();if(!1===/[a-zA-Z]/.test(t))throw Error("Invalid ");var e=t.toUpperCase().charCodeAt(0)-64;return{type:"Character",value:e}},t.prototype.nulCharacterAtom=function(){return this.consumeChar("0"),{type:"Character",value:o("\0")}},t.prototype.hexEscapeSequenceAtom=function(){return this.consumeChar("x"),this.parseHexDigits(2)},t.prototype.regExpUnicodeEscapeSequenceAtom=function(){return this.consumeChar("u"),this.parseHexDigits(4)},t.prototype.identityEscapeAtom=function(){var t=this.popChar();return{type:"Character",value:o(t)}},t.prototype.classPatternCharacterAtom=function(){switch(this.peekChar()){case"\n":case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:var t=this.popChar();return{type:"Character",value:o(t)}}},t.prototype.characterClass=function(){var t=[],e=!1;for(this.consumeChar("["),"^"===this.peekChar(0)&&(this.consumeChar("^"),e=!0);this.isClassAtom();){var n=this.classAtom(),r="Character"===n.type;if(r&&this.isRangeDash()){this.consumeChar("-");var i=this.classAtom(),s="Character"===i.type;if(s){if(i.value<n.value)throw Error("Range out of order in character class");t.push({from:n.value,to:i.value})}else a(n.value,t),t.push(o("-")),a(i.value,t)}else a(n.value,t)}return this.consumeChar("]"),{type:"Set",complement:e,value:t}},t.prototype.classAtom=function(){switch(this.peekChar()){case"]":case"\n":case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}},t.prototype.classEscape=function(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:o("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}},t.prototype.group=function(){var t=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),t=!1;break;default:this.groupIdx++}var e=this.disjunction();this.consumeChar(")");var n={type:"Group",capturing:t,value:e};return t&&(n.idx=this.groupIdx),n},t.prototype.positiveInteger=function(){var t=this.popChar();if(!1===i.test(t))throw Error("Expecting a positive integer");for(;r.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)},t.prototype.integerIncludingZero=function(){var t=this.popChar();if(!1===r.test(t))throw Error("Expecting an integer");for(;r.test(this.peekChar(0));)t+=this.popChar();return parseInt(t,10)},t.prototype.patternCharacter=function(){var t=this.popChar();switch(t){case"\n":case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:o(t)}}},t.prototype.isRegExpFlag=function(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}},t.prototype.isRangeDash=function(){return"-"===this.peekChar()&&this.isClassAtom(1)},t.prototype.isDigit=function(){return r.test(this.peekChar(0))},t.prototype.isClassAtom=function(t){switch(void 0===t&&(t=0),this.peekChar(t)){case"]":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.isTerm=function(){return this.isAtom()||this.isAssertion()},t.prototype.isAtom=function(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}},t.prototype.isAssertion=function(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return"?"===this.peekChar(1)&&("="===this.peekChar(2)||"!"===this.peekChar(2));default:return!1}},t.prototype.isQuantifier=function(){var t=this.saveState();try{return void 0!==this.quantifier(!0)}catch(t){return!1}finally{this.restoreState(t)}},t.prototype.isPatternCharacter=function(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case"\n":case"\r":case"\u2028":case"\u2029":return!1;default:return!0}},t.prototype.parseHexDigits=function(t){for(var e="",r=0;r<t;r++){var i=this.popChar();if(!1===n.test(i))throw Error("Expecting a HexDecimal digits");e+=i}var o=parseInt(e,16);return{type:"Character",value:o}},t.prototype.peekChar=function(t){return void 0===t&&(t=0),this.input[this.idx+t]},t.prototype.popChar=function(){var t=this.peekChar(0);return this.consumeChar(),t},t.prototype.consumeChar=function(t){if(void 0!==t&&this.input[this.idx]!==t)throw Error("Expected: '"+t+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++};var e,n=/[0-9a-fA-F]/,r=/[0-9]/,i=/[1-9]/;function o(t){return t.charCodeAt(0)}function a(t,e){void 0!==t.length?t.forEach(function(t){e.push(t)}):e.push(t)}function s(t,e){if(!0===t[e])throw"duplicate flag "+e;t[e]=!0}function c(t){if(void 0===t)throw Error("Internal Error - Should never get here!")}var u=[];for(e=o("0");e<=o("9");e++)u.push(e);var l=[o("_")].concat(u);for(e=o("a");e<=o("z");e++)l.push(e);for(e=o("A");e<=o("Z");e++)l.push(e);var p=[o(" "),o("\f"),o("\n"),o("\r"),o("\t"),o("\v"),o("\t"),o(" "),o(""),o(" "),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o(""),o("\u2028"),o("\u2029"),o(""),o(""),o(" "),o("\ufeff")];function h(){}return h.prototype.visitChildren=function(t){for(var e in t){var n=t[e];t.hasOwnProperty(e)&&(void 0!==n.type?this.visit(n):Array.isArray(n)&&n.forEach(function(t){this.visit(t)},this))}},h.prototype.visit=function(t){switch(t.type){case"Pattern":this.visitPattern(t);break;case"Flags":this.visitFlags(t);break;case"Disjunction":this.visitDisjunction(t);break;case"Alternative":this.visitAlternative(t);break;case"StartAnchor":this.visitStartAnchor(t);break;case"EndAnchor":this.visitEndAnchor(t);break;case"WordBoundary":this.visitWordBoundary(t);break;case"NonWordBoundary":this.visitNonWordBoundary(t);break;case"Lookahead":this.visitLookahead(t);break;case"NegativeLookahead":this.visitNegativeLookahead(t);break;case"Character":this.visitCharacter(t);break;case"Set":this.visitSet(t);break;case"Group":this.visitGroup(t);break;case"GroupBackReference":this.visitGroupBackReference(t);break;case"Quantifier":this.visitQuantifier(t)}this.visitChildren(t)},h.prototype.visitPattern=function(t){},h.prototype.visitFlags=function(t){},h.prototype.visitDisjunction=function(t){},h.prototype.visitAlternative=function(t){},h.prototype.visitStartAnchor=function(t){},h.prototype.visitEndAnchor=function(t){},h.prototype.visitWordBoundary=function(t){},h.prototype.visitNonWordBoundary=function(t){},h.prototype.visitLookahead=function(t){},h.prototype.visitNegativeLookahead=function(t){},h.prototype.visitCharacter=function(t){},h.prototype.visitSet=function(t){},h.prototype.visitGroup=function(t){},h.prototype.visitGroupBackReference=function(t){},h.prototype.visitQuantifier=function(t){},{RegExpParser:t,BaseRegExpVisitor:h,VERSION:"0.4.0"}})?r.apply(e,i):r)||(t.exports=o)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(15),i={},o=new r.RegExpParser;e.getRegExpAst=function(t){var e=t.toString();if(i.hasOwnProperty(e))return i[e];var n=o.pattern(e);return i[e]=n,n},e.clearRegExpParserCache=function(){i={}}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(0),a=n(7),s=n(1),c=n(4);e.setNodeLocationOnlyOffset=function(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset==1&&(t.endOffset=e.endOffset)},e.setNodeLocationFull=function(t,e){!0===isNaN(t.startOffset)?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset==1&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)},e.addTerminalToCst=function(t,e,n){void 0===t.children[n]?t.children[n]=[e]:t.children[n].push(e)},e.addNoneTerminalToCst=function(t,e,n){void 0===t.children[e]?t.children[e]=[n]:t.children[e].push(n)};var u=function(t){function e(e){var n=t.call(this)||this;return n.result=[],n.ruleIdx=e,n}return i(e,t),e.prototype.collectNamedDSLMethod=function(t,e,n){if(!o.isUndefined(t.name)){var r=void 0;if(t instanceof s.Option||t instanceof s.Repetition||t instanceof s.RepetitionMandatory||t instanceof s.Alternation)r=new e({definition:t.definition,idx:t.idx});else{if(!(t instanceof s.RepetitionMandatoryWithSeparator||t instanceof s.RepetitionWithSeparator))throw Error("non exhaustive match");r=new e({definition:t.definition,idx:t.idx,separator:t.separator})}var i=[r],c=a.getKeyForAutomaticLookahead(this.ruleIdx,n,t.idx);this.result.push({def:i,key:c,name:t.name,orgProd:t})}},e.prototype.visitOption=function(t){this.collectNamedDSLMethod(t,s.Option,a.OPTION_IDX)},e.prototype.visitRepetition=function(t){this.collectNamedDSLMethod(t,s.Repetition,a.MANY_IDX)},e.prototype.visitRepetitionMandatory=function(t){this.collectNamedDSLMethod(t,s.RepetitionMandatory,a.AT_LEAST_ONE_IDX)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.collectNamedDSLMethod(t,s.RepetitionMandatoryWithSeparator,a.AT_LEAST_ONE_SEP_IDX)},e.prototype.visitRepetitionWithSeparator=function(t){this.collectNamedDSLMethod(t,s.RepetitionWithSeparator,a.MANY_SEP_IDX)},e.prototype.visitAlternation=function(t){var e=this;this.collectNamedDSLMethod(t,s.Alternation,a.OR_IDX);var n=t.definition.length>1;o.forEach(t.definition,function(r,i){if(!o.isUndefined(r.name)){var c=r.definition;c=n?[new s.Option({definition:r.definition})]:r.definition;var u=a.getKeyForAltIndex(e.ruleIdx,a.OR_IDX,t.idx,i);e.result.push({def:c,key:u,name:r.name,orgProd:r})}})},e}(c.GAstVisitor);e.NamedDSLMethodsCollectorVisitor=u,e.expandAllNestedRuleNames=function(t,e){var n={allRuleNames:[]};return o.forEach(t,function(t){var r=e[t.name];n.allRuleNames.push(t.name);var i=new u(r);t.accept(i),o.forEach(i.result,function(e){e.def,e.key;var r=e.name;n.allRuleNames.push(t.name+r)})}),n}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);e.VERSION=r.VERSION;var i=n(2);e.Parser=i.Parser,e.CstParser=i.CstParser,e.EmbeddedActionsParser=i.EmbeddedActionsParser,e.ParserDefinitionErrorType=i.ParserDefinitionErrorType,e.EMPTY_ALT=i.EMPTY_ALT;var o=n(9);e.Lexer=o.Lexer,e.LexerDefinitionErrorType=o.LexerDefinitionErrorType;var a=n(3);e.createToken=a.createToken,e.createTokenInstance=a.createTokenInstance,e.EOF=a.EOF,e.tokenLabel=a.tokenLabel,e.tokenMatcher=a.tokenMatcher,e.tokenName=a.tokenName;var s=n(10);e.defaultGrammarResolverErrorProvider=s.defaultGrammarResolverErrorProvider,e.defaultGrammarValidatorErrorProvider=s.defaultGrammarValidatorErrorProvider,e.defaultParserErrorProvider=s.defaultParserErrorProvider;var c=n(8);e.EarlyExitException=c.EarlyExitException,e.isRecognitionException=c.isRecognitionException,e.MismatchedTokenException=c.MismatchedTokenException,e.NotAllInputParsedException=c.NotAllInputParsedException,e.NoViableAltException=c.NoViableAltException;var u=n(21);e.defaultLexerErrorProvider=u.defaultLexerErrorProvider;var l=n(1);e.Alternation=l.Alternation,e.Flat=l.Flat,e.NonTerminal=l.NonTerminal,e.Option=l.Option,e.Repetition=l.Repetition,e.RepetitionMandatory=l.RepetitionMandatory,e.RepetitionMandatoryWithSeparator=l.RepetitionMandatoryWithSeparator,e.RepetitionWithSeparator=l.RepetitionWithSeparator,e.Rule=l.Rule,e.Terminal=l.Terminal;var p=n(1);e.serializeGrammar=p.serializeGrammar,e.serializeProduction=p.serializeProduction;var h=n(4);e.GAstVisitor=h.GAstVisitor;var f=n(24);e.assignOccurrenceIndices=f.assignOccurrenceIndices,e.resolveGrammar=f.resolveGrammar,e.validateGrammar=f.validateGrammar,e.clearCache=function(){console.warn("The clearCache function was 'soft' removed from the Chevrotain API.\n\t It performs no action other than printing this message.\n\t Please avoid using it as it will be completely removed in the future")};var d=n(40);e.createSyntaxDiagramsCode=d.createSyntaxDiagramsCode;var m=n(41);e.generateParserFactory=m.generateParserFactory,e.generateParserModule=m.generateParserModule},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION="6.5.0"},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),a=n(9),s=n(0),c=n(28),u=n(16),l="PATTERN";function p(t){var e=s.filter(t,function(t){return!s.has(t,l)});return{errors:s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- missing static 'PATTERN' property",type:a.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[t]}}),valid:s.difference(t,e)}}function h(t){var e=s.filter(t,function(t){var e=t[l];return!(s.isRegExp(e)||s.isFunction(e)||s.has(e,"exec")||s.isString(e))});return{errors:s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:a.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[t]}}),valid:s.difference(t,e)}}e.DEFAULT_MODE="defaultMode",e.MODES="modes",e.SUPPORT_STICKY="boolean"==typeof new RegExp("(?:)").sticky,e.disableSticky=function(){e.SUPPORT_STICKY=!1},e.enableSticky=function(){e.SUPPORT_STICKY=!0},e.analyzeTokenTypes=function(t,n){var r,i=(n=s.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"],tracer:function(t,e){return e()}})).tracer;i("initCharCodeToOptimizedIndexMap",function(){!function(){if(s.isEmpty(x)){x=new Array(65536);for(var t=0;t<65536;t++)x[t]=t>255?255+~~(t/255):t}}()}),i("Reject Lexer.NA",function(){r=s.reject(t,function(t){return t[l]===a.Lexer.NA})});var o,u,p,h,f,d,m,E,T,y,v,R=!1;i("Transform Patterns",function(){R=!1,o=s.map(r,function(t){var e=t[l];if(s.isRegExp(e)){var r=e.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||s.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?n.useSticky?N(e):g(e):r[1]}if(s.isFunction(e))return R=!0,{exec:e};if(s.has(e,"exec"))return R=!0,e;if("string"==typeof e){if(1===e.length)return e;var i=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),o=new RegExp(i);return n.useSticky?N(o):g(o)}throw Error("non exhaustive match")})}),i("misc mapping",function(){u=s.map(r,function(t){return t.tokenTypeIdx}),p=s.map(r,function(t){var e=t.GROUP;if(e!==a.Lexer.SKIPPED){if(s.isString(e))return e;if(s.isUndefined(e))return!1;throw Error("non exhaustive match")}}),h=s.map(r,function(t){var e=t.LONGER_ALT;if(e)return s.indexOf(r,e)}),f=s.map(r,function(t){return t.PUSH_MODE}),d=s.map(r,function(t){return s.has(t,"POP_MODE")})}),i("Line Terminator Handling",function(){var t=P(n.lineTerminatorCharacters);m=s.map(r,function(t){return!1}),"onlyOffset"!==n.positionTracking&&(m=s.map(r,function(e){return s.has(e,"LINE_BREAKS")?e.LINE_BREAKS:!1===S(e,t)?c.canMatchCharCode(t,e.PATTERN):void 0}))}),i("Misc Mapping #2",function(){E=s.map(r,I),T=s.map(o,O),y=s.reduce(r,function(t,e){var n=e.GROUP;return s.isString(n)&&n!==a.Lexer.SKIPPED&&(t[n]=[]),t},{}),v=s.map(o,function(t,e){return{pattern:o[e],longerAlt:h[e],canLineTerminator:m[e],isCustom:E[e],short:T[e],group:p[e],push:f[e],pop:d[e],tokenTypeIdx:u[e],tokenType:r[e]}})});var A=!0,_=[];return n.safeMode||i("First Char Optimization",function(){_=s.reduce(r,function(t,e,r){if("string"==typeof e.PATTERN){var i=k(e.PATTERN.charCodeAt(0));C(t,i,v[r])}else if(s.isArray(e.START_CHARS_HINT)){var o;s.forEach(e.START_CHARS_HINT,function(e){var n=k("string"==typeof e?e.charCodeAt(0):e);o!==n&&(o=n,C(t,n,v[r]))})}else if(s.isRegExp(e.PATTERN))if(e.PATTERN.unicode)A=!1,n.ensureOptimizations&&s.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tUnable to analyze < "+e.PATTERN.toString()+" > pattern.\n\tThe regexp unicode flag is not currently supported by the regexp-to-ast library.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE");else{var a=c.getOptimizedStartCodesIndices(e.PATTERN,n.ensureOptimizations);s.isEmpty(a)&&(A=!1),s.forEach(a,function(e){C(t,e,v[r])})}else n.ensureOptimizations&&s.PRINT_ERROR(c.failedOptimizationPrefixMsg+"\tTokenType: <"+e.name+"> is using a custom token pattern without providing <start_chars_hint> parameter.\n\tThis will disable the lexer's first char optimizations.\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE"),A=!1;return t},[])}),i("ArrayPacking",function(){_=s.packArray(_)}),{emptyGroups:y,patternIdxToConfig:v,charCodeToPatternIdxToConfig:_,hasCustom:R,canBeOptimized:A}},e.validatePatterns=function(t,e){var n=[],r=p(t);n=n.concat(r.errors);var i=h(r.valid),o=i.valid;return n=(n=(n=(n=(n=n.concat(i.errors)).concat(function(t){var e=[],n=s.filter(t,function(t){return s.isRegExp(t[l])});return e=(e=(e=(e=(e=e.concat(d(n))).concat(T(n))).concat(y(n))).concat(v(n))).concat(m(n))}(o))).concat(R(o))).concat(A(o,e))).concat(_(o))},e.findMissingPatterns=p,e.findInvalidPatterns=h;var f=/[^\\][\$]/;function d(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitEndAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=s.filter(t,function(t){var n=t[l];try{var r=u.getRegExpAst(n),i=new e;return i.visit(r),i.found}catch(t){return f.test(n.source)}});return s.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:a.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[t]}})}function m(t){var e=s.filter(t,function(t){return t[l].test("")});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' must not match an empty string",type:a.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[t]}})}e.findEndOfInputAnchor=d,e.findEmptyMatchRegExps=m;var E=/[^\\[][\^]|^\^/;function T(t){var e=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.found=!1,e}return i(e,t),e.prototype.visitStartAnchor=function(t){this.found=!0},e}(o.BaseRegExpVisitor),n=s.filter(t,function(t){var n=t[l];try{var r=u.getRegExpAst(n),i=new e;return i.visit(r),i.found}catch(t){return E.test(n.source)}});return s.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+t.name+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:a.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[t]}})}function y(t){var e=s.filter(t,function(t){var e=t[l];return e instanceof RegExp&&(e.multiline||e.global)});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:a.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]}})}function v(t){var e=[],n=s.map(t,function(n){return s.reduce(t,function(t,r){return n.PATTERN.source!==r.PATTERN.source||s.contains(e,r)||r.PATTERN===a.Lexer.NA?t:(e.push(r),t.push(r),t)},[])});n=s.compact(n);var r=s.filter(n,function(t){return t.length>1});return s.map(r,function(t){var e=s.map(t,function(t){return t.name});return{message:"The same RegExp pattern ->"+s.first(t).PATTERN+"<-has been used in all of the following Token Types: "+e.join(", ")+" <-",type:a.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}})}function R(t){var e=s.filter(t,function(t){if(!s.has(t,"GROUP"))return!1;var e=t.GROUP;return e!==a.Lexer.SKIPPED&&e!==a.Lexer.NA&&!s.isString(e)});return s.map(e,function(t){return{message:"Token Type: ->"+t.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:a.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]}})}function A(t,e){var n=s.filter(t,function(t){return void 0!==t.PUSH_MODE&&!s.contains(e,t.PUSH_MODE)});return s.map(n,function(t){return{message:"Token Type: ->"+t.name+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+t.PUSH_MODE+"<-which does not exist",type:a.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]}})}function _(t){var e=[],n=s.reduce(t,function(t,e,n){var r,i=e.PATTERN;return i===a.Lexer.NA?t:(s.isString(i)?t.push({str:i,idx:n,tokenType:e}):s.isRegExp(i)&&(r=i,void 0===s.find([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(t){return-1!==r.source.indexOf(t)}))&&t.push({str:i.source,idx:n,tokenType:e}),t)},[]);return s.forEach(t,function(t,r){s.forEach(n,function(n){var i=n.str,o=n.idx,c=n.tokenType;if(r<o&&function(t,e){if(s.isRegExp(e)){var n=e.exec(t);return null!==n&&0===n.index}if(s.isFunction(e))return e(t,0,[],{});if(s.has(e,"exec"))return e.exec(t,0,[],{});if("string"==typeof e)return e===t;throw Error("non exhaustive match")}(i,t.PATTERN)){var u="Token: ->"+c.name+"<- can never be matched.\nBecause it appears AFTER the Token Type ->"+t.name+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";e.push({message:u,type:a.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[t,c]})}})}),e}function g(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function N(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function I(t){var e=t.PATTERN;if(s.isRegExp(e))return!1;if(s.isFunction(e))return!0;if(s.has(e,"exec"))return!0;if(s.isString(e))return!1;throw Error("non exhaustive match")}function O(t){return!(!s.isString(t)||1!==t.length)&&t.charCodeAt(0)}function S(t,e){if(s.has(t,"LINE_BREAKS"))return!1;if(s.isRegExp(t.PATTERN)){try{c.canMatchCharCode(e,t.PATTERN)}catch(t){return{issue:a.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(s.isString(t.PATTERN))return!1;if(I(t))return{issue:a.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function L(t,e){if(e.issue===a.LexerDefinitionErrorType.IDENTIFY_TERMINATOR)return"Warning: unable to identify line terminator usage in pattern.\n\tThe problem is in the <"+t.name+"> Token Type\n\t Root cause: "+e.errMsg+".\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR";if(e.issue===a.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the <line_breaks> option.\n\tThe problem is in the <"+t.name+"> Token Type\n\tFor details See: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK";throw Error("non exhaustive match")}function P(t){return s.map(t,function(t){return s.isString(t)&&t.length>0?t.charCodeAt(0):t})}function C(t,e,n){void 0===t[e]?t[e]=[n]:t[e].push(n)}function k(t){return t<e.minOptimizationVal?t:x[t]}e.findStartOfInputAnchor=T,e.findUnsupportedFlags=y,e.findDuplicatePatterns=v,e.findInvalidGroupType=R,e.findModesThatDoNotExist=A,e.findUnreachablePatterns=_,e.addStartOfInput=g,e.addStickyFlag=N,e.performRuntimeChecks=function(t,n,r){var i=[];return s.has(t,e.DEFAULT_MODE)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.DEFAULT_MODE+"> property in its definition\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),s.has(t,e.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.MODES+"> property in its definition\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),s.has(t,e.MODES)&&s.has(t,e.DEFAULT_MODE)&&!s.has(t.modes,t.defaultMode)&&i.push({message:"A MultiMode Lexer cannot be initialized with a "+e.DEFAULT_MODE+": <"+t.defaultMode+">which does not exist\n",type:a.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),s.has(t,e.MODES)&&s.forEach(t.modes,function(t,e){s.forEach(t,function(t,n){s.isUndefined(t)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+e+"> at index: <"+n+">\n",type:a.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i},e.performWarningRuntimeChecks=function(t,e,n){var r=[],i=!1,o=s.compact(s.flatten(s.mapValues(t.modes,function(t){return t}))),u=s.reject(o,function(t){return t[l]===a.Lexer.NA}),p=P(n);return e&&s.forEach(u,function(t){var e=S(t,p);if(!1!==e){var n={message:L(t,e),type:e.issue,tokenType:t};r.push(n)}else s.has(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):c.canMatchCharCode(p,t.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:"Warning: No LINE_BREAKS Found.\n\tThis Lexer has been defined to track line and column information,\n\tBut none of the Token Types can be identified as matching a line terminator.\n\tSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#LINE_BREAKS \n\tfor details.",type:a.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),r},e.cloneEmptyGroups=function(t){var e={},n=s.keys(t);return s.forEach(n,function(n){var r=t[n];if(!s.isArray(r))throw Error("non exhaustive match");e[n]=[]}),e},e.isCustomPattern=I,e.isShortPattern=O,e.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,n=this.lastIndex;n<e;n++){var r=t.charCodeAt(n);if(10===r)return this.lastIndex=n+1,!0;if(13===r)return 10===t.charCodeAt(n+1)?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0},e.buildLineBreakIssueMessage=L,e.minOptimizationVal=256,e.charCodeToOptimizedIndex=k;var x=[]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defaultLexerErrorProvider={buildUnableToPopLexerModeMessage:function(t){return"Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty"},buildUnexpectedCharactersMessage:function(t,e,n,r,i){return"unexpected character: ->"+t.charAt(e)+"<- at offset: "+e+", skipped "+n+" characters."}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(6);function a(t){if(t instanceof i.NonTerminal)return a(t.referencedRule);if(t instanceof i.Terminal)return u(t);if(o.isSequenceProd(t))return s(t);if(o.isBranchingProd(t))return c(t);throw Error("non exhaustive match")}function s(t){for(var e,n=[],i=t.definition,s=0,c=i.length>s,u=!0;c&&u;)e=i[s],u=o.isOptionalProd(e),n=n.concat(a(e)),s+=1,c=i.length>s;return r.uniq(n)}function c(t){var e=r.map(t.definition,function(t){return a(t)});return r.uniq(r.flatten(e))}function u(t){return[t.terminalType]}e.first=a,e.firstForSequence=s,e.firstForBranching=c,e.firstForTerminal=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.IN="_~IN~_"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(29),o=n(11),a=n(10),s=n(6);e.resolveGrammar=function(t){t=r.defaults(t,{errMsgProvider:a.defaultGrammarResolverErrorProvider});var e={};return r.forEach(t.rules,function(t){e[t.name]=t}),i.resolveGrammar(e,t.errMsgProvider)},e.validateGrammar=function(t){return t=r.defaults(t,{errMsgProvider:a.defaultGrammarValidatorErrorProvider,ignoredIssues:{}}),o.validateGrammar(t.rules,t.maxLookahead,t.tokenTypes,t.ignoredIssues,t.errMsgProvider,t.grammarName)},e.assignOccurrenceIndices=function(t){r.forEach(t.rules,function(t){var e=new s.DslMethodsCollectorVisitor;t.accept(e),r.forEach(e.dslMethods,function(t){r.forEach(t,function(t,e){t.idx=e+1})})})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=n(0),o=n(8),a=n(23),s=n(2);function c(t){this.name=e.IN_RULE_RECOVERY_EXCEPTION,this.message=t}e.EOF_FOLLOW_KEY={},e.IN_RULE_RECOVERY_EXCEPTION="InRuleRecoveryException",e.InRuleRecoveryException=c,c.prototype=Error.prototype;var u=function(){function t(){}return t.prototype.initRecoverable=function(t){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=i.has(t,"recoveryEnabled")?t.recoveryEnabled:s.DEFAULT_PARSER_CONFIG.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=l)},t.prototype.getTokenToInsert=function(t){var e=r.createTokenInstance(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e},t.prototype.canTokenTypeBeInsertedInRecovery=function(t){return!0},t.prototype.tryInRepetitionRecovery=function(t,e,n,r){for(var a=this,s=this.findReSyncTokenType(),c=this.exportLexerState(),u=[],l=!1,p=this.LA(1),h=this.LA(1),f=function(){var t=a.LA(0),e=a.errorMessageProvider.buildMismatchTokenMessage({expected:r,actual:p,previous:t,ruleName:a.getCurrRuleFullName()}),n=new o.MismatchedTokenException(e,p,a.LA(0));n.resyncedTokens=i.dropRight(u),a.SAVE_ERROR(n)};!l;){if(this.tokenMatcher(h,r))return void f();if(n.call(this))return f(),void t.apply(this,e);this.tokenMatcher(h,s)?l=!0:(h=this.SKIP_TOKEN(),this.addToResyncTokens(h,u))}this.importLexerState(c)},t.prototype.shouldInRepetitionRecoveryBeTried=function(t,e,n){return!1!==n&&(void 0!==t&&void 0!==e&&(!this.tokenMatcher(this.LA(1),t)&&(!this.isBackTracking()&&!this.canPerformInRuleRecovery(t,this.getFollowsForInRuleRecovery(t,e)))))},t.prototype.getFollowsForInRuleRecovery=function(t,e){var n=this.getCurrentGrammarPath(t,e);return this.getNextPossibleTokenTypes(n)},t.prototype.tryInRuleRecovery=function(t,e){if(this.canRecoverWithSingleTokenInsertion(t,e))return this.getTokenToInsert(t);if(this.canRecoverWithSingleTokenDeletion(t)){var n=this.SKIP_TOKEN();return this.consumeToken(),n}throw new c("sad sad panda")},t.prototype.canPerformInRuleRecovery=function(t,e){return this.canRecoverWithSingleTokenInsertion(t,e)||this.canRecoverWithSingleTokenDeletion(t)},t.prototype.canRecoverWithSingleTokenInsertion=function(t,e){var n=this;if(!this.canTokenTypeBeInsertedInRecovery(t))return!1;if(i.isEmpty(e))return!1;var r=this.LA(1);return void 0!==i.find(e,function(t){return n.tokenMatcher(r,t)})},t.prototype.canRecoverWithSingleTokenDeletion=function(t){return this.tokenMatcher(this.LA(2),t)},t.prototype.isInCurrentRuleReSyncSet=function(t){var e=this.getCurrFollowKey(),n=this.getFollowSetFromFollowKey(e);return i.contains(n,t)},t.prototype.findReSyncTokenType=function(){for(var t=this.flattenFollowSet(),e=this.LA(1),n=2;;){var r=e.tokenType;if(i.contains(t,r))return r;e=this.LA(n),n++}},t.prototype.getCurrFollowKey=function(){if(1===this.RULE_STACK.length)return e.EOF_FOLLOW_KEY;var t=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(t),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}},t.prototype.buildFullFollowKeyStack=function(){var t=this,n=this.RULE_STACK,r=this.RULE_OCCURRENCE_STACK;return i.isEmpty(this.LAST_EXPLICIT_RULE_STACK)||(n=i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.RULE_STACK[e]}),r=i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.RULE_OCCURRENCE_STACK[e]})),i.map(n,function(i,o){return 0===o?e.EOF_FOLLOW_KEY:{ruleName:t.shortRuleNameToFullName(i),idxInCallingRule:r[o],inRule:t.shortRuleNameToFullName(n[o-1])}})},t.prototype.flattenFollowSet=function(){var t=this,e=i.map(this.buildFullFollowKeyStack(),function(e){return t.getFollowSetFromFollowKey(e)});return i.flatten(e)},t.prototype.getFollowSetFromFollowKey=function(t){if(t===e.EOF_FOLLOW_KEY)return[r.EOF];var n=t.ruleName+t.idxInCallingRule+a.IN+t.inRule;return this.resyncFollows[n]},t.prototype.addToResyncTokens=function(t,e){return this.tokenMatcher(t,r.EOF)||e.push(t),e},t.prototype.reSyncTo=function(t){for(var e=[],n=this.LA(1);!1===this.tokenMatcher(n,t);)n=this.SKIP_TOKEN(),this.addToResyncTokens(n,e);return i.dropRight(e)},t.prototype.attemptInRepetitionRecovery=function(t,e,n,r,i,o,a){},t.prototype.getCurrentGrammarPath=function(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:i.cloneArr(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}},t.prototype.getHumanReadableRuleStack=function(){var t=this;return i.isEmpty(this.LAST_EXPLICIT_RULE_STACK)?i.map(this.RULE_STACK,function(e){return t.shortRuleNameToFullName(e)}):i.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.shortRuleNameToFullName(t.RULE_STACK[e])})},t}();function l(t,e,n,i,o,a,s){var c=this.getKeyForAutomaticLookahead(i,o),u=this.firstAfterRepMap[c];if(void 0===u){var l=this.getCurrRuleFullName();u=new a(this.getGAstProductions()[l],o).startWalking(),this.firstAfterRepMap[c]=u}var p=u.token,h=u.occurrence,f=u.isEndOfRule;1===this.RULE_STACK.length&&f&&void 0===p&&(p=r.EOF,h=1),this.shouldInRepetitionRecoveryBeTried(p,h,s)&&this.tryInRepetitionRecovery(t,e,n,p)}e.Recoverable=u,e.attemptInRepetitionRecovery=l},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0);e.classNameFromInstance=function(t){return a(t.constructor)};var i=/^\s*function\s*(\S*)\s*\(/,o="name";function a(t){var e=t.name;return e||t.toString().match(i)[1]}e.functionName=a,e.defineNameProp=function(t,e){var n=Object.getOwnPropertyDescriptor(t,o);return!(!r.isUndefined(n)&&!n.configurable||(Object.defineProperty(t,o,{enumerable:!1,configurable:!0,writable:!1,value:e}),0))}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(14),a=n(22),s=n(0),c=n(23),u=n(1),l=function(t){function e(e){var n=t.call(this)||this;return n.topProd=e,n.follows={},n}return i(e,t),e.prototype.startWalking=function(){return this.walk(this.topProd),this.follows},e.prototype.walkTerminal=function(t,e,n){},e.prototype.walkProdRef=function(t,e,n){var r=p(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(n),o=new u.Flat({definition:i}),s=a.first(o);this.follows[r]=s},e}(o.RestWalker);function p(t,e){return t.name+e+c.IN}e.ResyncFollowsWalker=l,e.computeAllProdsFollows=function(t){var e={};return s.forEach(t,function(t){var n=new l(t).startWalking();s.assign(e,n)}),e},e.buildBetweenProdsFollowPrefix=p,e.buildInProdFollowPrefix=function(t){return t.terminalType.name+t.idx+c.IN}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(15),a=n(0),s=n(16),c=n(20),u="Complement Sets are not supported for first char optimization";function l(t,e,n){switch(t.type){case"Disjunction":for(var r=0;r<t.value.length;r++)l(t.value[r],e,n);break;case"Alternative":var i=t.value;for(r=0;r<i.length;r++){var o=i[r];switch(o.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}var s=o;switch(s.type){case"Character":p(s.value,e,n);break;case"Set":if(!0===s.complement)throw Error(u);a.forEach(s.value,function(t){if("number"==typeof t)p(t,e,n);else{var r=t;if(!0===n)for(var i=r.from;i<=r.to;i++)p(i,e,n);else{for(i=r.from;i<=r.to&&i<c.minOptimizationVal;i++)p(i,e,n);if(r.to>=c.minOptimizationVal)for(var o=r.from>=c.minOptimizationVal?r.from:c.minOptimizationVal,a=r.to,s=c.charCodeToOptimizedIndex(o),u=c.charCodeToOptimizedIndex(a),l=s;l<=u;l++)e[l]=l}}});break;case"Group":l(s.value,e,n);break;default:throw Error("Non Exhaustive Match")}var h=void 0!==s.quantifier&&0===s.quantifier.atLeast;if("Group"===s.type&&!1===f(s)||"Group"!==s.type&&!1===h)break}break;default:throw Error("non exhaustive match!")}return a.values(e)}function p(t,e,n){var r=c.charCodeToOptimizedIndex(t);e[r]=r,!0===n&&function(t,e){var n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){var i=c.charCodeToOptimizedIndex(r.charCodeAt(0));e[i]=i}else{var o=n.toLowerCase();if(o!==n){var i=c.charCodeToOptimizedIndex(o.charCodeAt(0));e[i]=i}}}(t,e)}function h(t,e){return a.find(t.value,function(t){if("number"==typeof t)return a.contains(e,t);var n=t;return void 0!==a.find(e,function(t){return n.from<=t&&t<=n.to})})}function f(t){return!(!t.quantifier||0!==t.quantifier.atLeast)||!!t.value&&(a.isArray(t.value)?a.every(t.value,f):f(t.value))}e.failedOptimizationPrefixMsg='Unable to use "first char" lexer optimizations:\n',e.getOptimizedStartCodesIndices=function(t,n){void 0===n&&(n=!1);try{var r=s.getRegExpAst(t);return l(r.value,{},r.flags.ignoreCase)}catch(r){if(r.message===u)n&&a.PRINT_WARNING(e.failedOptimizationPrefixMsg+"\tUnable to optimize: < "+t.toString()+" >\n\tComplement Sets cannot be automatically optimized.\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.");else{var i="";n&&(i="\n\tThis will disable the lexer's first char optimizations.\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details."),a.PRINT_ERROR(e.failedOptimizationPrefixMsg+"\n\tFailed parsing: < "+t.toString()+" >\n\tUsing the regexp-to-ast library version: "+o.VERSION+"\n\tPlease open an issue at: https://github.com/bd82/regexp-to-ast/issues"+i)}}return[]},e.firstCharOptimizedIndices=l;var d=function(t){function e(e){var n=t.call(this)||this;return n.targetCharCodes=e,n.found=!1,n}return i(e,t),e.prototype.visitChildren=function(e){if(!0!==this.found){switch(e.type){case"Lookahead":return void this.visitLookahead(e);case"NegativeLookahead":return void this.visitNegativeLookahead(e)}t.prototype.visitChildren.call(this,e)}},e.prototype.visitCharacter=function(t){a.contains(this.targetCharCodes,t.value)&&(this.found=!0)},e.prototype.visitSet=function(t){t.complement?void 0===h(t,this.targetCharCodes)&&(this.found=!0):void 0!==h(t,this.targetCharCodes)&&(this.found=!0)},e}(o.BaseRegExpVisitor);e.canMatchCharCode=function(t,e){if(e instanceof RegExp){var n=s.getRegExpAst(e),r=new d(t);return r.visit(n),r.found}return void 0!==a.find(e,function(e){return a.contains(t,e.charCodeAt(0))})}},function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=n(0),s=n(4);e.resolveGrammar=function(t,e){var n=new c(t,e);return n.resolveRefs(),n.errors};var c=function(t){function e(e,n){var r=t.call(this)||this;return r.nameToTopRule=e,r.errMsgProvider=n,r.errors=[],r}return i(e,t),e.prototype.resolveRefs=function(){var t=this;a.forEach(a.values(this.nameToTopRule),function(e){t.currTopLevel=e,e.accept(t)})},e.prototype.visitNonTerminal=function(t){var e=this.nameToTopRule[t.nonTerminalName];if(e)t.referencedRule=e;else{var n=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,t);this.errors.push({message:n,type:o.ParserDefinitionErrorType.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:t.nonTerminalName})}},e}(s.GAstVisitor);e.GastRefResolverVisitor=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(12),i=n(0),o=n(2),a=n(7),s=n(6),c=function(){function t(){}return t.prototype.initLooksAhead=function(t){this.dynamicTokensEnabled=i.has(t,"dynamicTokensEnabled")?t.dynamicTokensEnabled:o.DEFAULT_PARSER_CONFIG.dynamicTokensEnabled,this.maxLookahead=i.has(t,"maxLookahead")?t.maxLookahead:o.DEFAULT_PARSER_CONFIG.maxLookahead,this.lookAheadFuncsCache=i.isES2015MapSupported()?new Map:[],i.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj)},t.prototype.preComputeLookaheadFunctions=function(t){var e=this;i.forEach(t,function(t){e.TRACE_INIT(t.name+" Rule Lookahead",function(){var n=s.collectMethods(t),o=n.alternation,c=n.repetition,u=n.option,l=n.repetitionMandatory,p=n.repetitionMandatoryWithSeparator,h=n.repetitionWithSeparator;i.forEach(o,function(n){var i=0===n.idx?"":n.idx;e.TRACE_INIT(""+s.getProductionDslName(n)+i,function(){var i=r.buildLookaheadFuncForOr(n.idx,t,n.maxLookahead||e.maxLookahead,n.hasPredicates,e.dynamicTokensEnabled,e.lookAheadBuilderForAlternatives),o=a.getKeyForAutomaticLookahead(e.fullRuleNameToShort[t.name],a.OR_IDX,n.idx);e.setLaFuncCache(o,i)})}),i.forEach(c,function(n){e.computeLookaheadFunc(t,n.idx,a.MANY_IDX,r.PROD_TYPE.REPETITION,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(u,function(n){e.computeLookaheadFunc(t,n.idx,a.OPTION_IDX,r.PROD_TYPE.OPTION,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(l,function(n){e.computeLookaheadFunc(t,n.idx,a.AT_LEAST_ONE_IDX,r.PROD_TYPE.REPETITION_MANDATORY,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(p,function(n){e.computeLookaheadFunc(t,n.idx,a.AT_LEAST_ONE_SEP_IDX,r.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,n.maxLookahead,s.getProductionDslName(n))}),i.forEach(h,function(n){e.computeLookaheadFunc(t,n.idx,a.MANY_SEP_IDX,r.PROD_TYPE.REPETITION_WITH_SEPARATOR,n.maxLookahead,s.getProductionDslName(n))})})})},t.prototype.computeLookaheadFunc=function(t,e,n,i,o,s){var c=this;this.TRACE_INIT(""+s+(0===e?"":e),function(){var s=r.buildLookaheadFuncForOptionalProd(e,t,o||c.maxLookahead,c.dynamicTokensEnabled,i,c.lookAheadBuilderForOptional),u=a.getKeyForAutomaticLookahead(c.fullRuleNameToShort[t.name],n,e);c.setLaFuncCache(u,s)})},t.prototype.lookAheadBuilderForOptional=function(t,e,n){return r.buildSingleAlternativeLookaheadFunction(t,e,n)},t.prototype.lookAheadBuilderForAlternatives=function(t,e,n,i){return r.buildAlternativesLookAheadFunc(t,e,n,i)},t.prototype.getKeyForAutomaticLookahead=function(t,e){var n=this.getLastExplicitRuleShortName();return a.getKeyForAutomaticLookahead(n,t,e)},t.prototype.getLaFuncFromCache=function(t){},t.prototype.getLaFuncFromMap=function(t){return this.lookAheadFuncsCache.get(t)},t.prototype.getLaFuncFromObj=function(t){return this.lookAheadFuncsCache[t]},t.prototype.setLaFuncCache=function(t,e){},t.prototype.setLaFuncCacheUsingMap=function(t,e){this.lookAheadFuncsCache.set(t,e)},t.prototype.setLaFuncUsingObj=function(t,e){this.lookAheadFuncsCache[t]=e},t}();e.LooksAhead=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(17),i=n(0),o=n(32),a=n(7),s=n(2),c=function(){function t(){}return t.prototype.initTreeBuilder=function(t){if(this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.outputCst=i.has(t,"outputCst")?t.outputCst:s.DEFAULT_PARSER_CONFIG.outputCst,this.nodeLocationTracking=i.has(t,"nodeLocationTracking")?t.nodeLocationTracking:s.DEFAULT_PARSER_CONFIG.nodeLocationTracking,this.outputCst)if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=r.setNodeLocationFull,this.setNodeLocationFromNode=r.setNodeLocationFull,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=r.setNodeLocationOnlyOffset,this.setNodeLocationFromNode=r.setNodeLocationOnlyOffset,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else{if(!/none/i.test(this.nodeLocationTracking))throw Error('Invalid <nodeLocationTracking> config option: "'+t.nodeLocationTracking+'"');this.setNodeLocationFromToken=i.NOOP,this.setNodeLocationFromNode=i.NOOP,this.cstPostRule=i.NOOP,this.setInitialNodeLocation=i.NOOP}else this.cstInvocationStateUpdate=i.NOOP,this.cstFinallyStateUpdate=i.NOOP,this.cstPostTerminal=i.NOOP,this.cstPostNonTerminal=i.NOOP,this.cstPostRule=i.NOOP,this.getLastExplicitRuleShortName=this.getLastExplicitRuleShortNameNoCst,this.getPreviousExplicitRuleShortName=this.getPreviousExplicitRuleShortNameNoCst,this.getLastExplicitRuleOccurrenceIndex=this.getLastExplicitRuleOccurrenceIndexNoCst,this.manyInternal=this.manyInternalNoCst,this.orInternal=this.orInternalNoCst,this.optionInternal=this.optionInternalNoCst,this.atLeastOneInternal=this.atLeastOneInternalNoCst,this.manySepFirstInternal=this.manySepFirstInternalNoCst,this.atLeastOneSepFirstInternal=this.atLeastOneSepFirstInternalNoCst},t.prototype.setInitialNodeLocationOnlyOffsetRecovery=function(t){t.location={startOffset:NaN,endOffset:NaN}},t.prototype.setInitialNodeLocationOnlyOffsetRegular=function(t){t.location={startOffset:this.LA(1).startOffset,endOffset:NaN}},t.prototype.setInitialNodeLocationFullRecovery=function(t){t.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.setInitialNodeLocationFullRegular=function(t){var e=this.LA(1);t.location={startOffset:e.startOffset,startLine:e.startLine,startColumn:e.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}},t.prototype.cstNestedInvocationStateUpdate=function(t,e){var n={name:t,fullName:this.shortRuleNameToFull[this.getLastExplicitRuleShortName()]+t,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstInvocationStateUpdate=function(t,e){this.LAST_EXPLICIT_RULE_STACK.push(this.RULE_STACK.length-1);var n={name:t,children:{}};this.setInitialNodeLocation(n),this.CST_STACK.push(n)},t.prototype.cstFinallyStateUpdate=function(){this.LAST_EXPLICIT_RULE_STACK.pop(),this.CST_STACK.pop()},t.prototype.cstNestedFinallyStateUpdate=function(){var t=this.CST_STACK.pop();this.cstPostRule(t)},t.prototype.cstPostRuleFull=function(t){var e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?(n.endOffset=e.endOffset,n.endLine=e.endLine,n.endColumn=e.endColumn):(n.startOffset=NaN,n.startLine=NaN,n.startColumn=NaN)},t.prototype.cstPostRuleOnlyOffset=function(t){var e=this.LA(0),n=t.location;n.startOffset<=e.startOffset==!0?n.endOffset=e.endOffset:n.startOffset=NaN},t.prototype.cstPostTerminal=function(t,e){var n=this.CST_STACK[this.CST_STACK.length-1];r.addTerminalToCst(n,e,t),this.setNodeLocationFromToken(n.location,e)},t.prototype.cstPostNonTerminal=function(t,e){if(!0!==this.isBackTracking()){var n=this.CST_STACK[this.CST_STACK.length-1];r.addNoneTerminalToCst(n,e,t),this.setNodeLocationFromNode(n.location,t.location)}},t.prototype.getBaseCstVisitorConstructor=function(){if(i.isUndefined(this.baseCstVisitorConstructor)){var t=o.createBaseSemanticVisitorConstructor(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(i.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var t=o.createBaseVisitorConstructorWithDefaults(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.nestedRuleBeforeClause=function(t,e){var n;return void 0!==t.NAME?(n=t.NAME,this.nestedRuleInvocationStateUpdate(n,e),n):void 0},t.prototype.nestedAltBeforeClause=function(t,e,n,r){var i,o=this.getLastExplicitRuleShortName(),s=a.getKeyForAltIndex(o,n,e,r);return void 0!==t.NAME?(i=t.NAME,this.nestedRuleInvocationStateUpdate(i,s),{shortName:s,nestedName:i}):void 0},t.prototype.nestedRuleFinallyClause=function(t,e){var n=this.CST_STACK,i=n[n.length-1];this.nestedRuleFinallyStateUpdate();var o=n[n.length-1];r.addNoneTerminalToCst(o,e,i),this.setNodeLocationFromNode(o.location,i.location)},t.prototype.getLastExplicitRuleShortName=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_STACK[t]},t.prototype.getLastExplicitRuleShortNameNoCst=function(){var t=this.RULE_STACK;return t[t.length-1]},t.prototype.getPreviousExplicitRuleShortName=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-2];return this.RULE_STACK[t]},t.prototype.getPreviousExplicitRuleShortNameNoCst=function(){var t=this.RULE_STACK;return t[t.length-2]},t.prototype.getLastExplicitRuleOccurrenceIndex=function(){var t=this.LAST_EXPLICIT_RULE_STACK[this.LAST_EXPLICIT_RULE_STACK.length-1];return this.RULE_OCCURRENCE_STACK[t]},t.prototype.getLastExplicitRuleOccurrenceIndexNoCst=function(){var t=this.RULE_OCCURRENCE_STACK;return t[t.length-1]},t.prototype.nestedRuleInvocationStateUpdate=function(t,e){this.RULE_OCCURRENCE_STACK.push(1),this.RULE_STACK.push(e),this.cstNestedInvocationStateUpdate(t,e)},t.prototype.nestedRuleFinallyStateUpdate=function(){this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstNestedFinallyStateUpdate()},t}();e.TreeBuilder=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(0),o=n(26),a=n(11);function s(t,e){for(var n=i.keys(t),r=n.length,o=0;o<r;o++)for(var a=t[n[o]],s=a.length,c=0;c<s;c++){var u=a[c];void 0===u.tokenTypeIdx&&(void 0!==u.fullName?this[u.fullName](u.children,e):this[u.name](u.children,e))}}function c(t,e){var n=u(t,e),r=p(t,e);return n.concat(r)}function u(t,e){var n=i.map(e,function(e){if(!i.isFunction(t[e]))return{msg:"Missing visitor method: <"+e+"> on "+o.functionName(t.constructor)+" CST Visitor.",type:r.MISSING_METHOD,methodName:e}});return i.compact(n)}e.defaultVisit=s,e.createBaseSemanticVisitorConstructor=function(t,e){var n=function(){};return o.defineNameProp(n,t+"BaseSemantics"),(n.prototype={visit:function(t,e){if(i.isArray(t)&&(t=t[0]),!i.isUndefined(t))return void 0!==t.fullName?this[t.fullName](t.children,e):this[t.name](t.children,e)},validateVisitor:function(){var t=c(this,e);if(!i.isEmpty(t)){var n=i.map(t,function(t){return t.msg});throw Error("Errors Detected in CST Visitor <"+o.functionName(this.constructor)+">:\n\t"+n.join("\n\n").replace(/\n/g,"\n\t"))}}}).constructor=n,n._RULE_NAMES=e,n},e.createBaseVisitorConstructorWithDefaults=function(t,e,n){var r=function(){};o.defineNameProp(r,t+"BaseSemanticsWithDefaults");var a=Object.create(n.prototype);return i.forEach(e,function(t){a[t]=s}),(r.prototype=a).constructor=r,r},function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"}(r=e.CstVisitorDefinitionError||(e.CstVisitorDefinitionError={})),e.validateVisitor=c,e.validateMissingCstMethods=u;var l=["constructor","visit","validateVisitor"];function p(t,e){var n=[];for(var s in t)a.validTermsPattern.test(s)&&i.isFunction(t[s])&&!i.contains(l,s)&&!i.contains(e,s)&&n.push({msg:"Redundant visitor method: <"+s+"> on "+o.functionName(t.constructor)+" CST Visitor\nThere is no Grammar Rule corresponding to this method's name.\nFor utility methods on visitor classes use methods names that do not match /"+a.validTermsPattern.source+"/.",type:r.REDUNDANT_METHOD,methodName:s});return n}e.validateRedundantMethods=p},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=function(){function t(){}return t.prototype.initLexerAdapter=function(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1},Object.defineProperty(t.prototype,"input",{get:function(){return this.tokVector},set:function(t){if(!0!==this.selfAnalysisDone)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=t,this.tokVectorLength=t.length},enumerable:!0,configurable:!0}),t.prototype.SKIP_TOKEN=function(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):r.END_OF_FILE},t.prototype.LA=function(t){var e=this.currIdx+t;return e<0||this.tokVectorLength<=e?r.END_OF_FILE:this.tokVector[e]},t.prototype.consumeToken=function(){this.currIdx++},t.prototype.exportLexerState=function(){return this.currIdx},t.prototype.importLexerState=function(t){this.currIdx=t},t.prototype.resetLexerState=function(){this.currIdx=-1},t.prototype.moveToTerminatedState=function(){this.currIdx=this.tokVector.length-1},t.prototype.getLexerPosition=function(){return this.exportLexerState()},t}();e.LexerAdapter=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(8),o=n(2),a=n(10),s=n(11),c=n(1),u=function(){function t(){}return t.prototype.ACTION=function(t){return t.call(this)},t.prototype.consume=function(t,e,n){return this.consumeInternal(e,t,n)},t.prototype.subrule=function(t,e,n){return this.subruleInternal(e,t,n)},t.prototype.option=function(t,e){return this.optionInternal(e,t)},t.prototype.or=function(t,e){return this.orInternal(e,t)},t.prototype.many=function(t,e){return this.manyInternal(t,e)},t.prototype.atLeastOne=function(t,e){return this.atLeastOneInternal(t,e)},t.prototype.CONSUME=function(t,e){return this.consumeInternal(t,0,e)},t.prototype.CONSUME1=function(t,e){return this.consumeInternal(t,1,e)},t.prototype.CONSUME2=function(t,e){return this.consumeInternal(t,2,e)},t.prototype.CONSUME3=function(t,e){return this.consumeInternal(t,3,e)},t.prototype.CONSUME4=function(t,e){return this.consumeInternal(t,4,e)},t.prototype.CONSUME5=function(t,e){return this.consumeInternal(t,5,e)},t.prototype.CONSUME6=function(t,e){return this.consumeInternal(t,6,e)},t.prototype.CONSUME7=function(t,e){return this.consumeInternal(t,7,e)},t.prototype.CONSUME8=function(t,e){return this.consumeInternal(t,8,e)},t.prototype.CONSUME9=function(t,e){return this.consumeInternal(t,9,e)},t.prototype.SUBRULE=function(t,e){return this.subruleInternal(t,0,e)},t.prototype.SUBRULE1=function(t,e){return this.subruleInternal(t,1,e)},t.prototype.SUBRULE2=function(t,e){return this.subruleInternal(t,2,e)},t.prototype.SUBRULE3=function(t,e){return this.subruleInternal(t,3,e)},t.prototype.SUBRULE4=function(t,e){return this.subruleInternal(t,4,e)},t.prototype.SUBRULE5=function(t,e){return this.subruleInternal(t,5,e)},t.prototype.SUBRULE6=function(t,e){return this.subruleInternal(t,6,e)},t.prototype.SUBRULE7=function(t,e){return this.subruleInternal(t,7,e)},t.prototype.SUBRULE8=function(t,e){return this.subruleInternal(t,8,e)},t.prototype.SUBRULE9=function(t,e){return this.subruleInternal(t,9,e)},t.prototype.OPTION=function(t){return this.optionInternal(t,0)},t.prototype.OPTION1=function(t){return this.optionInternal(t,1)},t.prototype.OPTION2=function(t){return this.optionInternal(t,2)},t.prototype.OPTION3=function(t){return this.optionInternal(t,3)},t.prototype.OPTION4=function(t){return this.optionInternal(t,4)},t.prototype.OPTION5=function(t){return this.optionInternal(t,5)},t.prototype.OPTION6=function(t){return this.optionInternal(t,6)},t.prototype.OPTION7=function(t){return this.optionInternal(t,7)},t.prototype.OPTION8=function(t){return this.optionInternal(t,8)},t.prototype.OPTION9=function(t){return this.optionInternal(t,9)},t.prototype.OR=function(t){return this.orInternal(t,0)},t.prototype.OR1=function(t){return this.orInternal(t,1)},t.prototype.OR2=function(t){return this.orInternal(t,2)},t.prototype.OR3=function(t){return this.orInternal(t,3)},t.prototype.OR4=function(t){return this.orInternal(t,4)},t.prototype.OR5=function(t){return this.orInternal(t,5)},t.prototype.OR6=function(t){return this.orInternal(t,6)},t.prototype.OR7=function(t){return this.orInternal(t,7)},t.prototype.OR8=function(t){return this.orInternal(t,8)},t.prototype.OR9=function(t){return this.orInternal(t,9)},t.prototype.MANY=function(t){this.manyInternal(0,t)},t.prototype.MANY1=function(t){this.manyInternal(1,t)},t.prototype.MANY2=function(t){this.manyInternal(2,t)},t.prototype.MANY3=function(t){this.manyInternal(3,t)},t.prototype.MANY4=function(t){this.manyInternal(4,t)},t.prototype.MANY5=function(t){this.manyInternal(5,t)},t.prototype.MANY6=function(t){this.manyInternal(6,t)},t.prototype.MANY7=function(t){this.manyInternal(7,t)},t.prototype.MANY8=function(t){this.manyInternal(8,t)},t.prototype.MANY9=function(t){this.manyInternal(9,t)},t.prototype.MANY_SEP=function(t){this.manySepFirstInternal(0,t)},t.prototype.MANY_SEP1=function(t){this.manySepFirstInternal(1,t)},t.prototype.MANY_SEP2=function(t){this.manySepFirstInternal(2,t)},t.prototype.MANY_SEP3=function(t){this.manySepFirstInternal(3,t)},t.prototype.MANY_SEP4=function(t){this.manySepFirstInternal(4,t)},t.prototype.MANY_SEP5=function(t){this.manySepFirstInternal(5,t)},t.prototype.MANY_SEP6=function(t){this.manySepFirstInternal(6,t)},t.prototype.MANY_SEP7=function(t){this.manySepFirstInternal(7,t)},t.prototype.MANY_SEP8=function(t){this.manySepFirstInternal(8,t)},t.prototype.MANY_SEP9=function(t){this.manySepFirstInternal(9,t)},t.prototype.AT_LEAST_ONE=function(t){this.atLeastOneInternal(0,t)},t.prototype.AT_LEAST_ONE1=function(t){return this.atLeastOneInternal(1,t)},t.prototype.AT_LEAST_ONE2=function(t){this.atLeastOneInternal(2,t)},t.prototype.AT_LEAST_ONE3=function(t){this.atLeastOneInternal(3,t)},t.prototype.AT_LEAST_ONE4=function(t){this.atLeastOneInternal(4,t)},t.prototype.AT_LEAST_ONE5=function(t){this.atLeastOneInternal(5,t)},t.prototype.AT_LEAST_ONE6=function(t){this.atLeastOneInternal(6,t)},t.prototype.AT_LEAST_ONE7=function(t){this.atLeastOneInternal(7,t)},t.prototype.AT_LEAST_ONE8=function(t){this.atLeastOneInternal(8,t)},t.prototype.AT_LEAST_ONE9=function(t){this.atLeastOneInternal(9,t)},t.prototype.AT_LEAST_ONE_SEP=function(t){this.atLeastOneSepFirstInternal(0,t)},t.prototype.AT_LEAST_ONE_SEP1=function(t){this.atLeastOneSepFirstInternal(1,t)},t.prototype.AT_LEAST_ONE_SEP2=function(t){this.atLeastOneSepFirstInternal(2,t)},t.prototype.AT_LEAST_ONE_SEP3=function(t){this.atLeastOneSepFirstInternal(3,t)},t.prototype.AT_LEAST_ONE_SEP4=function(t){this.atLeastOneSepFirstInternal(4,t)},t.prototype.AT_LEAST_ONE_SEP5=function(t){this.atLeastOneSepFirstInternal(5,t)},t.prototype.AT_LEAST_ONE_SEP6=function(t){this.atLeastOneSepFirstInternal(6,t)},t.prototype.AT_LEAST_ONE_SEP7=function(t){this.atLeastOneSepFirstInternal(7,t)},t.prototype.AT_LEAST_ONE_SEP8=function(t){this.atLeastOneSepFirstInternal(8,t)},t.prototype.AT_LEAST_ONE_SEP9=function(t){this.atLeastOneSepFirstInternal(9,t)},t.prototype.RULE=function(t,e,n){if(void 0===n&&(n=o.DEFAULT_RULE_CONFIG),r.contains(this.definedRulesNames,t)){var i={message:a.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:o.ParserDefinitionErrorType.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(i)}this.definedRulesNames.push(t);var s=this.defineRule(t,e,n);return this[t]=s,s},t.prototype.OVERRIDE_RULE=function(t,e,n){void 0===n&&(n=o.DEFAULT_RULE_CONFIG);var r=[];r=r.concat(s.validateRuleIsOverridden(t,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r);var i=this.defineRule(t,e,n);return this[t]=i,i},t.prototype.BACKTRACK=function(t,e){return function(){this.isBackTrackingStack.push(1);var n=this.saveRecogState();try{return t.apply(this,e),!0}catch(t){if(i.isRecognitionException(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return c.serializeGrammar(r.values(this.gastProductionsCache))},t}();e.RecognizerApi=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(7),o=n(8),a=n(12),s=n(13),c=n(2),u=n(25),l=n(3),p=n(5),h=n(26),f=function(){function t(){}return t.prototype.initRecognizerEngine=function(t,e){if(this.className=h.classNameFromInstance(this),this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=p.tokenStructuredMatcherNoCategories,this.definedRulesNames=[],this.tokensMap={},this.allRuleNames=[],this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},r.has(e,"serializedGrammar"))throw Error("The Parser's configuration can no longer contain a <serializedGrammar> property.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_6-0-0\n\tFor Further details.");if(r.isArray(t)){if(r.isEmpty(t))throw Error("A Token Vocabulary cannot be empty.\n\tNote that the first argument for the parser constructor\n\tis no longer a Token vector (since v4.0).");if("number"==typeof t[0].startOffset)throw Error("The Parser constructor no longer accepts a token vector as the first argument.\n\tSee: https://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(r.isArray(t))this.tokensMap=r.reduce(t,function(t,e){return t[e.name]=e,t},{});else if(r.has(t,"modes")&&r.every(r.flatten(r.values(t.modes)),p.isTokenType)){var n=r.flatten(r.values(t.modes)),i=r.uniq(n);this.tokensMap=r.reduce(i,function(t,e){return t[e.name]=e,t},{})}else{if(!r.isObject(t))throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=r.cloneObj(t)}this.tokensMap.EOF=l.EOF;var o=r.every(r.values(t),function(t){return r.isEmpty(t.categoryMatches)});this.tokenMatcher=o?p.tokenStructuredMatcherNoCategories:p.tokenStructuredMatcher,p.augmentTokenTypes(r.values(this.tokensMap))},t.prototype.defineRule=function(t,e,n){if(this.selfAnalysisDone)throw Error("Grammar rule <"+t+"> may not be defined after the 'performSelfAnalysis' method has been called'\nMake sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.");var o,a=r.has(n,"resyncEnabled")?n.resyncEnabled:c.DEFAULT_RULE_CONFIG.resyncEnabled,s=r.has(n,"recoveryValueFunc")?n.recoveryValueFunc:c.DEFAULT_RULE_CONFIG.recoveryValueFunc,u=this.ruleShortNameIdx<<i.BITS_FOR_METHOD_TYPE+i.BITS_FOR_OCCURRENCE_IDX;this.ruleShortNameIdx++,this.shortRuleNameToFull[u]=t,this.fullRuleNameToShort[t]=u;return(o=function(n,r){return void 0===n&&(n=0),this.ruleInvocationStateUpdate(u,t,n),function(t){try{if(!0===this.outputCst){e.apply(this,t);var n=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(n),n}return e.apply(this,t)}catch(t){return this.invokeRuleCatch(t,a,s)}finally{this.ruleFinallyStateUpdate()}}.call(this,r)}).ruleName=t,o.originalGrammarAction=e,o},t.prototype.invokeRuleCatch=function(t,e,n){var r=1===this.RULE_STACK.length,i=e&&!this.isBackTracking()&&this.recoveryEnabled;if(o.isRecognitionException(t)){var a=t;if(i){var s,c=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(c))return a.resyncedTokens=this.reSyncTo(c),this.outputCst?((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,s):n();throw this.outputCst&&((s=this.CST_STACK[this.CST_STACK.length-1]).recoveredNode=!0,a.partialCstResult=s),a}if(r)return this.moveToTerminatedState(),n();throw a}throw t},t.prototype.optionInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.OPTION_IDX,e),r=this.nestedRuleBeforeClause(t,n);try{return this.optionInternalLogic(t,e,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},t.prototype.optionInternalNoCst=function(t,e){var n=this.getKeyForAutomaticLookahead(i.OPTION_IDX,e);return this.optionInternalLogic(t,e,n)},t.prototype.optionInternalLogic=function(t,e,n){var r,i,o=this,a=this.getLaFuncFromCache(n);if(void 0!==t.DEF){if(r=t.DEF,void 0!==(i=t.GATE)){var s=a;a=function(){return i.call(o)&&s.call(o)}}}else r=t;if(!0===a.call(this))return r.call(this)},t.prototype.atLeastOneInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.AT_LEAST_ONE_IDX,t),r=this.nestedRuleBeforeClause(e,n);try{return this.atLeastOneInternalLogic(t,e,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},t.prototype.atLeastOneInternalNoCst=function(t,e){var n=this.getKeyForAutomaticLookahead(i.AT_LEAST_ONE_IDX,t);this.atLeastOneInternalLogic(t,e,n)},t.prototype.atLeastOneInternalLogic=function(t,e,n){var r,o,c=this,u=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,void 0!==(o=e.GATE)){var l=u;u=function(){return o.call(c)&&l.call(c)}}}else r=e;if(!0!==u.call(this))throw this.raiseEarlyExitException(t,a.PROD_TYPE.REPETITION_MANDATORY,e.ERR_MSG);for(var p=this.doSingleRepetition(r);!0===u.call(this)&&!0===p;)p=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[t,e],u,i.AT_LEAST_ONE_IDX,t,s.NextTerminalAfterAtLeastOneWalker)},t.prototype.atLeastOneSepFirstInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.AT_LEAST_ONE_SEP_IDX,t),r=this.nestedRuleBeforeClause(e,n);try{this.atLeastOneSepFirstInternalLogic(t,e,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},t.prototype.atLeastOneSepFirstInternalNoCst=function(t,e){var n=this.getKeyForAutomaticLookahead(i.AT_LEAST_ONE_SEP_IDX,t);this.atLeastOneSepFirstInternalLogic(t,e,n)},t.prototype.atLeastOneSepFirstInternalLogic=function(t,e,n){var r=this,o=e.DEF,c=e.SEP;if(!0!==this.getLaFuncFromCache(n).call(this))throw this.raiseEarlyExitException(t,a.PROD_TYPE.REPETITION_MANDATORY_WITH_SEPARATOR,e.ERR_MSG);o.call(this);for(var u=function(){return r.tokenMatcher(r.LA(1),c)};!0===this.tokenMatcher(this.LA(1),c);)this.CONSUME(c),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,c,u,o,s.NextTerminalAfterAtLeastOneSepWalker],u,i.AT_LEAST_ONE_SEP_IDX,t,s.NextTerminalAfterAtLeastOneSepWalker)},t.prototype.manyInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.MANY_IDX,t),r=this.nestedRuleBeforeClause(e,n);try{return this.manyInternalLogic(t,e,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},t.prototype.manyInternalNoCst=function(t,e){var n=this.getKeyForAutomaticLookahead(i.MANY_IDX,t);return this.manyInternalLogic(t,e,n)},t.prototype.manyInternalLogic=function(t,e,n){var r,o,a=this,c=this.getLaFuncFromCache(n);if(void 0!==e.DEF){if(r=e.DEF,void 0!==(o=e.GATE)){var u=c;c=function(){return o.call(a)&&u.call(a)}}}else r=e;for(var l=!0;!0===c.call(this)&&!0===l;)l=this.doSingleRepetition(r);this.attemptInRepetitionRecovery(this.manyInternal,[t,e],c,i.MANY_IDX,t,s.NextTerminalAfterManyWalker,l)},t.prototype.manySepFirstInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.MANY_SEP_IDX,t),r=this.nestedRuleBeforeClause(e,n);try{this.manySepFirstInternalLogic(t,e,n)}finally{void 0!==r&&this.nestedRuleFinallyClause(n,r)}},t.prototype.manySepFirstInternalNoCst=function(t,e){var n=this.getKeyForAutomaticLookahead(i.MANY_SEP_IDX,t);this.manySepFirstInternalLogic(t,e,n)},t.prototype.manySepFirstInternalLogic=function(t,e,n){var r=this,o=e.DEF,a=e.SEP;if(!0===this.getLaFuncFromCache(n).call(this)){o.call(this);for(var c=function(){return r.tokenMatcher(r.LA(1),a)};!0===this.tokenMatcher(this.LA(1),a);)this.CONSUME(a),o.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,a,c,o,s.NextTerminalAfterManySepWalker],c,i.MANY_SEP_IDX,t,s.NextTerminalAfterManySepWalker)}},t.prototype.repetitionSepSecondInternal=function(t,e,n,r,o){for(;n();)this.CONSUME(e),r.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[t,e,n,r,o],n,i.AT_LEAST_ONE_SEP_IDX,t,o)},t.prototype.doSingleRepetition=function(t){var e=this.getLexerPosition();return t.call(this),this.getLexerPosition()>e},t.prototype.orInternalNoCst=function(t,e){var n=r.isArray(t)?t:t.DEF,o=this.getKeyForAutomaticLookahead(i.OR_IDX,e),a=this.getLaFuncFromCache(o).call(this,n);if(void 0!==a)return n[a].ALT.call(this);this.raiseNoAltException(e,t.ERR_MSG)},t.prototype.orInternal=function(t,e){var n=this.getKeyForAutomaticLookahead(i.OR_IDX,e),o=this.nestedRuleBeforeClause(t,n);try{var a=r.isArray(t)?t:t.DEF,s=this.getLaFuncFromCache(n).call(this,a);if(void 0!==s){var c=a[s],u=this.nestedAltBeforeClause(c,e,i.OR_IDX,s);try{return c.ALT.call(this)}finally{void 0!==u&&this.nestedRuleFinallyClause(u.shortName,u.nestedName)}}this.raiseNoAltException(e,t.ERR_MSG)}finally{void 0!==o&&this.nestedRuleFinallyClause(n,o)}},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!1===this.isAtEndOfInput()){var t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new o.NotAllInputParsedException(e,t))}},t.prototype.subruleInternal=function(t,e,n){var r;try{var i=void 0!==n?n.ARGS:void 0;return r=t.call(this,e,i),this.cstPostNonTerminal(r,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),r}catch(e){this.subruleInternalError(e,n,t.ruleName)}},t.prototype.subruleInternalError=function(t,e,n){throw o.isRecognitionException(t)&&void 0!==t.partialCstResult&&(this.cstPostNonTerminal(t.partialCstResult,void 0!==e&&void 0!==e.LABEL?e.LABEL:n),delete t.partialCstResult),t},t.prototype.consumeInternal=function(t,e,n){var r;try{var i=this.LA(1);!0===this.tokenMatcher(i,t)?(this.consumeToken(),r=i):this.consumeInternalError(t,i,n)}catch(n){r=this.consumeInternalRecovery(t,e,n)}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.name,r),r},t.prototype.consumeInternalError=function(t,e,n){var r,i=this.LA(0);throw r=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:e,previous:i,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o.MismatchedTokenException(r,e,i))},t.prototype.consumeInternalRecovery=function(t,e,n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var r=this.getFollowsForInRuleRecovery(t,e);try{return this.tryInRuleRecovery(t,r)}catch(t){throw t.name===u.IN_RULE_RECOVERY_EXCEPTION?n:t}},t.prototype.saveRecogState=function(){var t=this.errors,e=r.cloneArr(this.RULE_STACK);return{errors:t,lexerState:this.exportLexerState(),RULE_STACK:e,CST_STACK:this.CST_STACK,LAST_EXPLICIT_RULE_STACK:this.LAST_EXPLICIT_RULE_STACK}},t.prototype.reloadRecogState=function(t){this.errors=t.errors,this.importLexerState(t.lexerState),this.RULE_STACK=t.RULE_STACK},t.prototype.ruleInvocationStateUpdate=function(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e,t)},t.prototype.isBackTracking=function(){return 0!==this.isBackTrackingStack.length},t.prototype.getCurrRuleFullName=function(){var t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[t]},t.prototype.shortRuleNameToFullName=function(t){return this.shortRuleNameToFull[t]},t.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),l.EOF)},t.prototype.reset=function(){this.resetLexerState(),this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.LAST_EXPLICIT_RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]},t}();e.RecognizerEngine=f},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(8),i=n(0),o=n(12),a=n(2),s=function(){function t(){}return t.prototype.initErrorHandler=function(t){this._errors=[],this.errorMessageProvider=i.defaults(t.errorMessageProvider,a.DEFAULT_PARSER_CONFIG.errorMessageProvider)},t.prototype.SAVE_ERROR=function(t){if(r.isRecognitionException(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:i.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")},Object.defineProperty(t.prototype,"errors",{get:function(){return i.cloneArr(this._errors)},set:function(t){this._errors=t},enumerable:!0,configurable:!0}),t.prototype.raiseEarlyExitException=function(t,e,n){for(var i=this.getCurrRuleFullName(),a=this.getGAstProductions()[i],s=o.getLookaheadPathsForOptionalProd(t,a,e,this.maxLookahead)[0],c=[],u=1;u<=this.maxLookahead;u++)c.push(this.LA(u));var l=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:s,actual:c,previous:this.LA(0),customUserDescription:n,ruleName:i});throw this.SAVE_ERROR(new r.EarlyExitException(l,this.LA(1),this.LA(0)))},t.prototype.raiseNoAltException=function(t,e){for(var n=this.getCurrRuleFullName(),i=this.getGAstProductions()[n],a=o.getLookaheadPathsForOr(t,i,this.maxLookahead),s=[],c=1;c<=this.maxLookahead;c++)s.push(this.LA(c));var u=this.LA(0),l=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:a,actual:s,previous:u,customUserDescription:e,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new r.NoViableAltException(l,this.LA(1),u))},t}();e.ErrorHandler=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(13),i=n(0),o=function(){function t(){}return t.prototype.initContentAssist=function(){},t.prototype.computeContentAssist=function(t,e){var n=this.gastProductionsCache[t];if(i.isUndefined(n))throw Error("Rule ->"+t+"<- does not exist in this grammar.");return r.nextPossibleTokensAfter([n],e,this.tokenMatcher,this.maxLookahead)},t.prototype.getNextPossibleTokenTypes=function(t){var e=i.first(t.ruleStack),n=this.getGAstProductions()[e];return new r.NextAfterTokenWalker(n,t).startWalking()},t}();e.ContentAssist=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o=n(9),a=n(5),s=n(3),c=n(2),u=n(7),l={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(l);var p=Math.pow(2,u.BITS_FOR_OCCURRENCE_IDX)-1,h=s.createToken({name:"RECORDING_PHASE_TOKEN",pattern:o.Lexer.NA});a.augmentTokenTypes([h]);var f=s.createTokenInstance(h,"This IToken indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",-1,-1,-1,-1,-1,-1);Object.freeze(f);var d={name:"This CSTNode indicates the Parser is in Recording Phase\n\tSee: https://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording for details",children:{}},m=function(){function t(){}return t.prototype.initGastRecorder=function(t){this.recordingProdStack=[],this.RECORDING_PHASE=!1},t.prototype.enableRecording=function(){var t=this;this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",function(){for(var e=function(e){var n=e>0?e:"";t["CONSUME"+n]=function(t,n){return this.consumeInternalRecord(t,e,n)},t["SUBRULE"+n]=function(t,n){return this.subruleInternalRecord(t,e,n)},t["OPTION"+n]=function(t){return this.optionInternalRecord(t,e)},t["OR"+n]=function(t){return this.orInternalRecord(t,e)},t["MANY"+n]=function(t){this.manyInternalRecord(e,t)},t["MANY_SEP"+n]=function(t){this.manySepFirstInternalRecord(e,t)},t["AT_LEAST_ONE"+n]=function(t){this.atLeastOneInternalRecord(e,t)},t["AT_LEAST_ONE_SEP"+n]=function(t){this.atLeastOneSepFirstInternalRecord(e,t)}},n=0;n<10;n++)e(n);t.consume=function(t,e,n){return this.consumeInternalRecord(e,t,n)},t.subrule=function(t,e,n){return this.subruleInternalRecord(e,t,n)},t.option=function(t,e){return this.optionInternalRecord(e,t)},t.or=function(t,e){return this.orInternalRecord(e,t)},t.many=function(t,e){this.manyInternalRecord(t,e)},t.atLeastOne=function(t,e){this.atLeastOneInternalRecord(t,e)},t.ACTION=t.ACTION_RECORD,t.BACKTRACK=t.BACKTRACK_RECORD,t.LA=t.LA_RECORD})},t.prototype.disableRecording=function(){var t=this;this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",function(){for(var e=0;e<10;e++){var n=e>0?e:"";delete t["CONSUME"+n],delete t["SUBRULE"+n],delete t["OPTION"+n],delete t["OR"+n],delete t["MANY"+n],delete t["MANY_SEP"+n],delete t["AT_LEAST_ONE"+n],delete t["AT_LEAST_ONE_SEP"+n]}delete t.consume,delete t.subrule,delete t.option,delete t.or,delete t.many,delete t.atLeastOne,delete t.ACTION,delete t.BACKTRACK,delete t.LA})},t.prototype.ACTION_RECORD=function(t){},t.prototype.BACKTRACK_RECORD=function(t,e){return function(){return!0}},t.prototype.LA_RECORD=function(t){return c.END_OF_FILE},t.prototype.topLevelRuleRecord=function(t,e){try{var n=new i.Rule({definition:[],name:t});return n.name=t,this.recordingProdStack.push(n),e.call(this),this.recordingProdStack.pop(),n}catch(t){if(!0!==t.KNOWN_RECORDER_ERROR)try{t.message=t.message+'\n\t This error was thrown during the "grammar recording phase" For more info see:\n\thttps://sap.github.io/chevrotain/docs/guide/internals.html#grammar-recording'}catch(e){throw t}throw t}},t.prototype.optionInternalRecord=function(t,e){return E.call(this,i.Option,t,e)},t.prototype.atLeastOneInternalRecord=function(t,e){E.call(this,i.RepetitionMandatory,e,t)},t.prototype.atLeastOneSepFirstInternalRecord=function(t,e){E.call(this,i.RepetitionMandatoryWithSeparator,e,t,!0)},t.prototype.manyInternalRecord=function(t,e){E.call(this,i.Repetition,e,t)},t.prototype.manySepFirstInternalRecord=function(t,e){E.call(this,i.RepetitionWithSeparator,e,t,!0)},t.prototype.orInternalRecord=function(t,e){return function(t,e){var n=this;y(e);var o=r.peek(this.recordingProdStack),a=!1===r.isArray(t),s=!1===a?t:t.DEF,c=new i.Alternation({definition:[],idx:e,ignoreAmbiguities:a&&!0===t.IGNORE_AMBIGUITIES});r.has(t,"NAME")&&(c.name=t.NAME);r.has(t,"MAX_LOOKAHEAD")&&(c.maxLookahead=t.MAX_LOOKAHEAD);var u=r.some(s,function(t){return r.isFunction(t.GATE)});return c.hasPredicates=u,o.definition.push(c),r.forEach(s,function(t){var e=new i.Flat({definition:[]});c.definition.push(e),r.has(t,"NAME")&&(e.name=t.NAME),r.has(t,"IGNORE_AMBIGUITIES")?e.ignoreAmbiguities=t.IGNORE_AMBIGUITIES:r.has(t,"GATE")&&(e.ignoreAmbiguities=!0),n.recordingProdStack.push(e),t.ALT.call(n),n.recordingProdStack.pop()}),l}.call(this,t,e)},t.prototype.subruleInternalRecord=function(t,e,n){if(y(e),!t||!1===r.has(t,"ruleName")){var o=new Error("<SUBRULE"+T(e)+"> argument is invalid expecting a Parser method reference but got: <"+JSON.stringify(t)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var a=r.peek(this.recordingProdStack),s=t.ruleName,c=new i.NonTerminal({idx:e,nonTerminalName:s,referencedRule:void 0});return a.definition.push(c),this.outputCst?d:l},t.prototype.consumeInternalRecord=function(t,e,n){if(y(e),!a.hasShortKeyProperty(t)){var o=new Error("<CONSUME"+T(e)+"> argument is invalid expecting a TokenType reference but got: <"+JSON.stringify(t)+">\n inside top level rule: <"+this.recordingProdStack[0].name+">");throw o.KNOWN_RECORDER_ERROR=!0,o}var s=r.peek(this.recordingProdStack),c=new i.Terminal({idx:e,terminalType:t});return s.definition.push(c),f},t}();function E(t,e,n,i){void 0===i&&(i=!1),y(n);var o=r.peek(this.recordingProdStack),a=r.isFunction(e)?e:e.DEF,s=new t({definition:[],idx:n});return r.has(e,"NAME")&&(s.name=e.NAME),i&&(s.separator=e.SEP),r.has(e,"MAX_LOOKAHEAD")&&(s.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(s),a.call(this),o.definition.push(s),this.recordingProdStack.pop(),l}function T(t){return 0===t?"":""+t}function y(t){if(t<0||t>p){var e=new Error("Invalid DSL Method idx value: <"+t+">\n\tIdx value must be a none negative value smaller than "+(p+1));throw e.KNOWN_RECORDER_ERROR=!0,e}}e.GastRecorder=m},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(2),o=function(){function t(){}return t.prototype.initPerformanceTracer=function(t){if(r.has(t,"traceInitPerf")){var e=t.traceInitPerf,n="number"==typeof e;this.traceInitMaxIdent=n?e:1/0,this.traceInitPerf=n?e>0:e}else this.traceInitMaxIdent=0,this.traceInitPerf=i.DEFAULT_PARSER_CONFIG.traceInitPerf;this.traceInitIndent=-1},t.prototype.TRACE_INIT=function(t,e){if(!0===this.traceInitPerf){this.traceInitIndent++;var n=new Array(this.traceInitIndent+1).join("\t");this.traceInitIndent<this.traceInitMaxIdent&&console.log(n+"--\x3e <"+t+">");var i=r.timer(e),o=i.time,a=i.value,s=o>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&s(n+"<-- <"+t+"> time: "+o+"ms"),this.traceInitIndent--,a}return e()},t}();e.PerformanceTracer=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(19);e.createSyntaxDiagramsCode=function(t,e){var n=void 0===e?{}:e,i=n.resourceBase,o=void 0===i?"https://unpkg.com/chevrotain@"+r.VERSION+"/diagrams/":i,a=n.css;return"\n\x3c!-- This is a generated file --\x3e\n<!DOCTYPE html>\n<meta charset=\"utf-8\">\n<style>\n body {\n background-color: hsl(30, 20%, 95%)\n }\n</style>\n\n\n<link rel='stylesheet' href='"+(void 0===a?"https://unpkg.com/chevrotain@"+r.VERSION+"/diagrams/diagrams.css":a)+"'>\n\n<script src='"+o+"vendor/railroad-diagrams.js'><\/script>\n<script src='"+o+"src/diagrams_builder.js'><\/script>\n<script src='"+o+"src/diagrams_behavior.js'><\/script>\n<script src='"+o+'src/main.js\'><\/script>\n\n<div id="diagrams" align="center"></div> \n\n<script>\n window.serializedGrammar = '+JSON.stringify(t,null," ")+';\n<\/script>\n\n<script>\n var diagramsDiv = document.getElementById("diagrams");\n main.drawDiagramsFromSerializedGrammar(serializedGrammar, diagramsDiv);\n<\/script>\n'}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(42);e.generateParserFactory=function(t){var e=r.genWrapperFunction({name:t.name,rules:t.rules}),i=new Function("tokenVocabulary","config","chevrotain",e);return function(e){return i(t.tokenVocabulary,e,n(18))}},e.generateParserModule=function(t){return r.genUmdModule({name:t.name,rules:t.rules})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(1),o="\n";function a(t){return"\nfunction "+t.name+"(tokenVocabulary, config) {\n // invoke super constructor\n // No support for embedded actions currently, so we can 'hardcode'\n // The use of CstParser.\n chevrotain.CstParser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n "+s(t.rules)+"\n\n // very important to call this after all the rules have been defined.\n // otherwise the parser may not work correctly as it will lack information\n // derived during the self analysis phase.\n this.performSelfAnalysis(this)\n}\n\n// inheritance as implemented in javascript in the previous decade... :(\n"+t.name+".prototype = Object.create(chevrotain.CstParser.prototype)\n"+t.name+".prototype.constructor = "+t.name+" \n "}function s(t){return r.map(t,function(t){return c(t,1)}).join("\n")}function c(t,e){var n=E(e,'$.RULE("'+t.name+'", function() {')+o;return n+=m(t.definition,e+1),n+=E(e+1,"})")+o}function u(t,e){var n=t.terminalType.name;return E(e,"$.CONSUME"+t.idx+"(this.tokensMap."+n+")"+o)}function l(t,e){return E(e,"$.SUBRULE"+t.idx+"($."+t.nonTerminalName+")"+o)}function p(t,e){var n=E(e,"$.OR"+t.idx+"([")+o;return n+=r.map(t.definition,function(t){return h(t,e+1)}).join(","+o),n+=o+E(e,"])"+o)}function h(t,e){var n=E(e,"{")+o;return t.name&&(n+=E(e+1,'NAME: "'+t.name+'",')+o),n+=E(e+1,"ALT: function() {")+o,n+=m(t.definition,e+1),n+=E(e+1,"}")+o,n+=E(e,"}")}function f(t,e,n){var r=E(n,"$."+(t+e.idx)+"(");return e.name||e.separator?(r+="{"+o,e.name&&(r+=E(n+1,'NAME: "'+e.name+'"')+","+o),e.separator&&(r+=E(n+1,"SEP: this.tokensMap."+e.separator.name)+","+o),r+="DEF: "+d(e.definition,n+2)+o,r+=E(n,"}")+o):r+=d(e.definition,n+1),r+=E(n,")")+o}function d(t,e){var n="function() {"+o;return n+=m(t,e),n+=E(e,"}")+o}function m(t,e){var n="";return r.forEach(t,function(t){n+=function(t,e){if(t instanceof i.NonTerminal)return l(t,e);if(t instanceof i.Option)return f("OPTION",t,e);if(t instanceof i.RepetitionMandatory)return f("AT_LEAST_ONE",t,e);if(t instanceof i.RepetitionMandatoryWithSeparator)return f("AT_LEAST_ONE_SEP",t,e);if(t instanceof i.RepetitionWithSeparator)return f("MANY_SEP",t,e);if(t instanceof i.Repetition)return f("MANY",t,e);if(t instanceof i.Alternation)return p(t,e);if(t instanceof i.Terminal)return u(t,e);if(t instanceof i.Flat)return m(t.definition,e);throw Error("non exhaustive match")}(t,e+1)}),n}function E(t,e){return Array(4*t+1).join(" ")+e}e.genUmdModule=function(t){return"\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n // AMD. Register as an anonymous module.\n define(['chevrotain'], factory);\n } else if (typeof module === 'object' && module.exports) {\n // Node. Does not work with strict CommonJS, but\n // only CommonJS-like environments that support module.exports,\n // like Node.\n module.exports = factory(require('chevrotain'));\n } else {\n // Browser globals (root is window)\n root.returnExports = factory(root.b);\n }\n}(typeof self !== 'undefined' ? self : this, function (chevrotain) {\n\n"+a(t)+"\n \nreturn {\n "+t.name+": "+t.name+" \n}\n}));\n"},e.genWrapperFunction=function(t){return" \n"+a(t)+"\nreturn new "+t.name+"(tokenVocabulary, config) \n"},e.genClass=a,e.genAllRules=s,e.genRule=c,e.genTerminal=u,e.genNonTerminal=l,e.genAlternation=p,e.genSingleAlt=h}])});