diff --git a/dist/jdl-core.min.js b/dist/jdl-core.min.js index 22968400..b990009b 100644 --- a/dist/jdl-core.min.js +++ b/dist/jdl-core.min.js @@ -1 +1,7961 @@ -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("lodash")):"function"==typeof define&&define.amd?define(["lodash"],e):"object"==typeof exports?exports.jdlCore=e(require("lodash")):t.jdlCore=e(t._)}("undefined"!=typeof self?self:this,function(t){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=27)}([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;r1});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},p=m(r);return p&&(u.parameter=p),u})}(t,i)}),f=o.map(t,function(t){return R(t,t,i)}),d=[],g=[],S=[];a.every(f,a.isEmpty)&&(d=a.map(t,function(t){return O(t,i)}),g=a.map(t,function(t){return _(t,e,r,i)}),S=M(t,e,i));var L=function(t,e,n){var r=[],i=a.map(e,function(t){return u.tokenName(t)});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),C=o.map(n,function(t){return v(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.map(r.result,function(t){return t.orgProd});n.push(a.map(i,function(n){return A(t,n,e)}))}),a.flatten(n)}(t,i),P=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 I(t,i)}),U=a.map(t,function(t){return y(t,i)}),D=a.map(t,function(e){return N(e,t,p,i)});return o.flatten(h.concat(C,k,P,S,f,d,g,L,x,U,D))},e.identifyProductionForDuplicates=E;var T=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}(d.GAstVisitor);function y(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 A(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 u.tokenName(t).match(e.validTermsPattern)||r.push({message:n.buildTokenNameError({tokenType:t,expectedPattern:e.validTermsPattern}),type:s.ParserDefinitionErrorType.INVALID_TOKEN_NAME}),r}function N(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 R(t,e,n,r){void 0===r&&(r=[]);var i=[],a=g(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])),p=o.map(u,function(e){var i=o.cloneArr(r);return i.push(e),R(t,e,n,i)});return i.concat(o.flatten(p))}function g(t){var e=[];if(o.isEmpty(t))return e;var n=o.first(t);if(n instanceof f.NonTerminal)e.push(n.referencedRule);else if(n instanceof f.Flat||n instanceof f.Option||n instanceof f.RepetitionMandatory||n instanceof f.RepetitionMandatoryWithSeparator||n instanceof f.RepetitionWithSeparator||n instanceof f.Repetition)e=e.concat(g(n.definition));else if(n instanceof f.Alternation)e=o.flatten(o.map(n.definition,function(t){return g(t.definition)}));else if(!(n instanceof f.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(g(a))}return e}e.OccurrenceValidationCollector=T,e.validTermsPattern=/^[a-zA-Z_]\w*$/,e.validNestedRuleName=new RegExp(e.validTermsPattern.source.replace("^","^\\$")),e.validateRuleName=y,e.validateNestedRuleName=A,e.validateTokenName=v,e.validateRuleDoesNotAlreadyExist=N,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=R,e.getFirstNoneTerminal=g;var S=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}(d.GAstVisitor);function O(t,e){var n=new S;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=h.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 _(t,e,n,r){var i=new S;t.accept(i);var u=i.alternations,l=n[t.name];return l&&(u=a.reject(u,function(t){return l[c.getProductionDslName(t)+(0===t.idx?"":t.idx)]})),o.reduce(u,function(n,i){var c=i.idx,u=p.getLookaheadPathsForOr(c,t,e),l=function(t,e,n,r){var i=[],c=a.reduce(t,function(e,n,r){return a.forEach(n,function(n){var o=[r];a.forEach(t,function(t,e){r!==e&&p.containsPath(t,n)&&o.push(e)}),o.length>1&&!p.containsPath(i,n)&&(i.push(n),e.push({alts:o,path:n}))}),e},[]);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]}})}(u,i,t,r),h=function(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){var c=t.idx,u=t.path,l=a.findAll(o,function(t){return t.idx255&&n.push({message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:r}),type:s.ParserDefinitionErrorType.TOO_MANY_ALTS,ruleName:t.name,occurrence:r.idx}),n},[])}function M(t,e,n){var r=[];return a.forEach(t,function(t){var i=new L;t.accept(i);var o=i.allProductions;a.forEach(o,function(i){var o=p.getProdType(i),c=i.idx,u=p.getLookaheadPathsForOptionalProd(c,t,o,e)[0];if(a.isEmpty(a.flatten(u))){var l=n.buildEmptyRepetitionError({topLevelRule:t,repetition:i});r.push({message:l,type:s.ParserDefinitionErrorType.NO_NON_EMPTY_LOOKAHEAD,ruleName:t.name})}})}),r}e.RepetionCollector=L,e.validateTooManyAlts=I,e.validateSomeNonEmptyLookaheadPath=M},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(5),c=n(2);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 u=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.visitTerminal=function(t){var e=c.tokenName(t.terminalType)+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=u},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(0),i=n(4),o=n(2);function a(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 s(t){r.forEach(t,function(t){l(t)||(e.tokenIdxToClass.put(e.tokenShortNameIdx,t),t.tokenTypeIdx=e.tokenShortNameIdx++),h(t)&&!r.isArray(t.CATEGORIES)&&(t.CATEGORIES=[t.CATEGORIES]),h(t)||(t.CATEGORIES=[]),f(t)||(t.categoryMatches=[]),d(t)||(t.categoryMatchesMap={}),E(t)||(t.tokenName=o.tokenName(t))})}function c(t){r.forEach(t,function(t){t.categoryMatches=[],r.forEach(t.categoryMatchesMap,function(n,r){t.categoryMatches.push(e.tokenIdxToClass.get(r).tokenTypeIdx)})})}function u(t){r.forEach(t,function(t){p([],t)})}function p(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)||p(i,n)})}function l(t){return r.has(t,"tokenTypeIdx")}function h(t){return r.has(t,"CATEGORIES")}function f(t){return r.has(t,"categoryMatches")}function d(t){return r.has(t,"categoryMatchesMap")}function E(t){return r.has(t,"tokenName")}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=new i.HashTable,e.augmentTokenTypes=function(t){var e=a(t);s(e),u(e),c(e),r.forEach(e,function(t){t.isParent=t.categoryMatches.length>0})},e.expandCategories=a,e.assignTokenDefaultProps=s,e.assignCategoriesTokensProp=c,e.assignCategoriesMapProp=u,e.singleAssignCategoriesToksMap=p,e.hasShortKeyProperty=l,e.hasCategoriesProperty=h,e.hasExtendingTokensTypesProperty=f,e.hasExtendingTokensTypesMapProperty=d,e.hasTokenNameProperty=E,e.isTokenType=function(t){return r.has(t,"tokenTypeIdx")}},function(t,e,n){const r=n(3).Parser,i=n(7).tokens;let o=null;t.exports=class t extends r{static getParser(){return o||(o=new t)}constructor(){super(i)}parse(){this.prog(),this.constantDeclaration(),this.entityDeclaration(),this.simpleAnnotationDeclaration(),this.complexAnnotationDeclaration(),this.entityTableNameDeclaration(),this.entityBody(),this.fieldDeclaration(),this.type(),this.validation(),this.minMaxValidation(),this.pattern(),this.relationDeclaration(),this.relationshipType(),this.relationshipBody(),this.relationshipSide(),this.enumDeclaration(),this.enumPropList(),this.dtoDeclaration(),this.entityList(),this.exclusion(),this.paginationDeclaration(),this.serviceDeclaration(),this.searchEngineDeclaration(),this.microserviceDeclaration(),this.searchEngineDeclaration(),this.noClientDeclaration(),this.noServerDeclaration(),this.noFluentMethod(),this.clientRootFolderDeclaration(),this.filterDeclaration(),this.filterDef(),this.angularSuffixDeclaration(),this.comment(),this.applicationDeclaration(),this.applicationSubDeclaration(),this.applicationSubConfig(),this.applicationSubEntities(),this.applicationConfigDeclaration(),this.configValue(),this.qualifiedName(),this.list(),r.performSelfAnalysis(this)}prog(){this.RULE("prog",()=>{this.MANY(()=>{this.OR([{ALT:()=>this.SUBRULE(this.entityDeclaration)},{ALT:()=>this.SUBRULE(this.relationDeclaration)},{ALT:()=>this.SUBRULE(this.enumDeclaration)},{ALT:()=>this.SUBRULE(this.dtoDeclaration)},{ALT:()=>this.SUBRULE(this.paginationDeclaration)},{ALT:()=>this.SUBRULE(this.serviceDeclaration)},{ALT:()=>this.CONSUME(i.COMMENT)},{ALT:()=>this.SUBRULE(this.microserviceDeclaration)},{ALT:()=>this.SUBRULE(this.searchEngineDeclaration)},{ALT:()=>this.SUBRULE(this.noClientDeclaration)},{ALT:()=>this.SUBRULE(this.noServerDeclaration)},{ALT:()=>this.SUBRULE(this.angularSuffixDeclaration)},{ALT:()=>this.SUBRULE(this.noFluentMethod)},{ALT:()=>this.SUBRULE(this.filterDeclaration)},{ALT:()=>this.SUBRULE(this.clientRootFolderDeclaration)},{ALT:()=>this.SUBRULE(this.applicationDeclaration)},{GATE:()=>this.LA(2).tokenType===i.EQUALS,ALT:()=>this.SUBRULE(this.constantDeclaration)}])})})}constantDeclaration(){this.RULE("constantDeclaration",()=>{this.CONSUME(i.NAME),this.CONSUME(i.EQUALS),this.CONSUME(i.INTEGER)})}entityDeclaration(){this.RULE("entityDeclaration",()=>{this.MANY(()=>{this.OR([{ALT:()=>this.SUBRULE(this.simpleAnnotationDeclaration)},{ALT:()=>this.SUBRULE(this.complexAnnotationDeclaration)}])}),this.OPTION(()=>{this.CONSUME(i.COMMENT)}),this.CONSUME(i.ENTITY),this.CONSUME(i.NAME),this.OPTION1(()=>{this.SUBRULE(this.entityTableNameDeclaration)}),this.OPTION2(()=>{this.SUBRULE(this.entityBody)})})}simpleAnnotationDeclaration(){this.RULE("simpleAnnotationDeclaration",()=>{this.CONSUME(i.AT),this.OR([{ALT:()=>this.CONSUME(i.SKIP_CLIENT,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.SKIP_SERVER,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.FILTER,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.NO_FLUENT_METHOD,{LABEL:"option"})}])})}complexAnnotationDeclaration(){this.RULE("complexAnnotationDeclaration",()=>{this.CONSUME(i.AT),this.OR([{ALT:()=>this.CONSUME(i.DTO,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.PAGINATE,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.SERVICE,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.MICROSERVICE,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.SEARCH,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.ANGULAR_SUFFIX,{LABEL:"option"})},{ALT:()=>this.CONSUME(i.CLIENT_ROOT_FOLDER,{LABEL:"option"})}]),this.CONSUME(i.LPAREN),this.CONSUME(i.NAME,{LABEL:"value"}),this.CONSUME(i.RPAREN)})}entityTableNameDeclaration(){this.RULE("entityTableNameDeclaration",()=>{this.CONSUME(i.LPAREN),this.CONSUME(i.NAME),this.CONSUME(i.RPAREN)})}entityBody(){this.RULE("entityBody",()=>{this.CONSUME(i.LCURLY),this.MANY(()=>{this.SUBRULE(this.fieldDeclaration),this.OPTION(()=>{this.CONSUME(i.COMMA)})}),this.CONSUME(i.RCURLY)})}fieldDeclaration(){this.RULE("fieldDeclaration",()=>{this.OPTION(()=>{this.CONSUME(i.COMMENT)}),this.CONSUME(i.NAME),this.SUBRULE(this.type),this.MANY(()=>{this.SUBRULE(this.validation)}),this.OPTION2({GATE:()=>{const t=this.LA(0),e=this.LA(1);return t.startLine===e.startLine},DEF:()=>{this.CONSUME2(i.COMMENT)}})})}type(){this.RULE("type",()=>{this.CONSUME(i.NAME)})}validation(){this.RULE("validation",()=>{this.OR([{ALT:()=>this.CONSUME(i.REQUIRED)},{ALT:()=>this.CONSUME(i.UNIQUE)},{ALT:()=>this.SUBRULE(this.minMaxValidation)},{ALT:()=>this.SUBRULE(this.pattern)}])})}minMaxValidation(){this.RULE("minMaxValidation",()=>{this.CONSUME(i.MIN_MAX_KEYWORD),this.CONSUME(i.LPAREN),this.OR([{ALT:()=>this.CONSUME(i.INTEGER)},{ALT:()=>this.CONSUME(i.NAME)}]),this.CONSUME(i.RPAREN)})}pattern(){this.RULE("pattern",()=>{this.CONSUME(i.PATTERN),this.CONSUME(i.LPAREN),this.CONSUME(i.REGEX),this.CONSUME(i.RPAREN)})}relationDeclaration(){this.RULE("relationDeclaration",()=>{this.CONSUME(i.RELATIONSHIP),this.SUBRULE(this.relationshipType),this.CONSUME(i.LCURLY),this.AT_LEAST_ONE(()=>{this.SUBRULE(this.relationshipBody),this.OPTION(()=>{this.CONSUME(i.COMMA)})}),this.CONSUME(i.RCURLY)})}relationshipType(){this.RULE("relationshipType",()=>{this.OR([{ALT:()=>this.CONSUME(i.ONE_TO_ONE)},{ALT:()=>this.CONSUME(i.ONE_TO_MANY)},{ALT:()=>this.CONSUME(i.MANY_TO_ONE)},{ALT:()=>this.CONSUME(i.MANY_TO_MANY)}])})}relationshipBody(){this.RULE("relationshipBody",()=>{this.SUBRULE(this.relationshipSide,{LABEL:"from"}),this.CONSUME(i.TO),this.SUBRULE2(this.relationshipSide,{LABEL:"to"})})}relationshipSide(){this.RULE("relationshipSide",()=>{this.SUBRULE(this.comment),this.CONSUME(i.NAME),this.OPTION(()=>{this.CONSUME(i.LCURLY),this.CONSUME2(i.NAME,{LABEL:"injectedField"}),this.OPTION1(()=>{this.CONSUME(i.LPAREN),this.CONSUME3(i.NAME,{LABEL:"injectedFieldParam"}),this.CONSUME(i.RPAREN)}),this.OPTION2(()=>{this.CONSUME(i.REQUIRED)}),this.CONSUME(i.RCURLY)})})}enumDeclaration(){this.RULE("enumDeclaration",()=>{this.CONSUME(i.ENUM),this.CONSUME(i.NAME),this.CONSUME(i.LCURLY),this.SUBRULE(this.enumPropList),this.CONSUME(i.RCURLY)})}enumPropList(){this.RULE("enumPropList",()=>{this.CONSUME(i.NAME),this.MANY(()=>{this.CONSUME(i.COMMA),this.CONSUME2(i.NAME)})})}dtoDeclaration(){this.RULE("dtoDeclaration",()=>{this.CONSUME(i.DTO),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}entityList(){this.RULE("entityList",()=>{this.MANY({GATE:()=>this.LA(2).tokenType===i.COMMA,DEF:()=>{this.CONSUME(i.NAME),this.CONSUME(i.COMMA)}}),this.OR([{ALT:()=>this.CONSUME(i.ALL)},{ALT:()=>this.CONSUME(i.STAR)},{ALT:()=>this.CONSUME1(i.NAME)}]),this.CONSUME(i.WITH),this.CONSUME2(i.NAME,{LABEL:"method"})})}exclusion(){this.RULE("exclusion",()=>{this.CONSUME(i.EXCEPT),this.CONSUME(i.NAME),this.MANY(()=>{this.CONSUME(i.COMMA),this.CONSUME2(i.NAME)})})}paginationDeclaration(){this.RULE("paginationDeclaration",()=>{this.CONSUME(i.PAGINATE),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}serviceDeclaration(){this.RULE("serviceDeclaration",()=>{this.CONSUME(i.SERVICE),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}microserviceDeclaration(){this.RULE("microserviceDeclaration",()=>{this.CONSUME(i.MICROSERVICE),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}searchEngineDeclaration(){this.RULE("searchEngineDeclaration",()=>{this.CONSUME(i.SEARCH),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}noClientDeclaration(){this.RULE("noClientDeclaration",()=>{this.CONSUME(i.SKIP_CLIENT),this.SUBRULE(this.filterDef),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}noServerDeclaration(){this.RULE("noServerDeclaration",()=>{this.CONSUME(i.SKIP_SERVER),this.SUBRULE(this.filterDef),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}noFluentMethod(){this.RULE("noFluentMethod",()=>{this.CONSUME(i.NO_FLUENT_METHOD),this.SUBRULE(this.filterDef),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}clientRootFolderDeclaration(){this.RULE("clientRootFolderDeclaration",()=>{this.CONSUME(i.CLIENT_ROOT_FOLDER),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}filterDeclaration(){this.RULE("filterDeclaration",()=>{this.CONSUME(i.FILTER),this.SUBRULE(this.filterDef),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}filterDef(){this.RULE("filterDef",()=>{this.MANY({GATE:()=>this.LA(2).tokenType===i.COMMA,DEF:()=>{this.CONSUME(i.NAME),this.CONSUME(i.COMMA)}}),this.OR([{ALT:()=>this.CONSUME(i.ALL)},{ALT:()=>this.CONSUME(i.STAR)},{ALT:()=>this.CONSUME1(i.NAME)}])})}angularSuffixDeclaration(){this.RULE("angularSuffixDeclaration",()=>{this.CONSUME(i.ANGULAR_SUFFIX),this.SUBRULE(this.entityList),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}comment(){this.RULE("comment",()=>{this.OPTION(()=>{this.CONSUME(i.COMMENT)})})}applicationDeclaration(){this.RULE("applicationDeclaration",()=>{this.CONSUME(i.APPLICATION),this.CONSUME(i.LCURLY),this.SUBRULE(this.applicationSubDeclaration),this.CONSUME(i.RCURLY)})}applicationSubDeclaration(){this.RULE("applicationSubDeclaration",()=>{this.MANY(()=>{this.OR([{ALT:()=>this.SUBRULE(this.applicationSubConfig)},{ALT:()=>this.SUBRULE(this.applicationSubEntities)}])})})}applicationSubConfig(){this.RULE("applicationSubConfig",()=>{this.CONSUME(i.CONFIG),this.CONSUME(i.LCURLY),this.MANY(()=>{this.OR([{ALT:()=>this.CONSUME(i.COMMENT)},{ALT:()=>this.SUBRULE(this.applicationConfigDeclaration)}])}),this.CONSUME(i.RCURLY)})}applicationConfigDeclaration(){this.RULE("applicationConfigDeclaration",()=>{this.CONSUME(i.CONFIG_KEY),this.SUBRULE(this.configValue),this.OPTION(()=>{this.CONSUME(i.COMMA)})})}configValue(){this.RULE("configValue",()=>{this.OR([{ALT:()=>this.CONSUME(i.BOOLEAN)},{ALT:()=>this.SUBRULE(this.qualifiedName)},{ALT:()=>this.SUBRULE(this.list)},{ALT:()=>this.CONSUME(i.INTEGER)},{ALT:()=>this.CONSUME(i.STRING)}])})}qualifiedName(){this.RULE("qualifiedName",()=>{this.AT_LEAST_ONE_SEP({SEP:i.DOT,DEF:()=>{this.CONSUME(i.NAME)}})})}list(){this.RULE("list",()=>{this.CONSUME(i.LSQUARE),this.MANY_SEP({SEP:i.COMMA,DEF:()=>{this.CONSUME(i.NAME)}}),this.CONSUME(i.RSQUARE)})}applicationSubEntities(){this.RULE("applicationSubEntities",()=>{this.CONSUME(i.ENTITIES),this.SUBRULE(this.filterDef),this.OPTION(()=>{this.SUBRULE(this.exclusion)})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(18),i=n(4),o=n(8),a=n(0),s=n(30),c=n(2),u=n(20),p=n(31),l=n(14),h=n(24),f=n(10),d=n(22),E=n(23),m=n(33),T=n(16),y=n(1),A=n(25),v="InRuleRecoveryException";e.END_OF_FILE=c.createTokenInstance(c.EOF,"",NaN,NaN,NaN,NaN,NaN,NaN),Object.freeze(e.END_OF_FILE);var N,R=Object.freeze({recoveryEnabled:!1,maxLookahead:4,ignoredIssues:{},dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:T.defaultParserErrorProvider,serializedGrammar:null}),g=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"}(N=e.ParserDefinitionErrorType||(e.ParserDefinitionErrorType={})),e.EMPTY_ALT=function(t){return void 0===t&&(t=void 0),function(){return t}};var S={},O=function(){function t(t,e){if(void 0===e&&(e=R),this.resyncFollows=new i.HashTable,this.allRuleNames=[],this.gastProductionsCache=new i.HashTable,this._errors=[],this.recoveryEnabled=R.recoveryEnabled,this.dynamicTokensEnabled=R.dynamicTokensEnabled,this.maxLookahead=R.maxLookahead,this.ignoredIssues=R.ignoredIssues,this.outputCst=R.outputCst,this.serializedGrammar=R.serializedGrammar,this.errorMessageProvider=R.errorMessageProvider,this.isBackTrackingStack=[],this.className="Parser",this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.CST_STACK=[],this.tokensMap={},this.lookAheadFuncsCache=a.isES2015MapSupported()?new Map:[],this.firstAfterRepMap=new i.HashTable,this.definitionErrors=[],this.definedRulesNames=[],this.shortRuleNameToFull=new i.HashTable,this.fullRuleNameToShort=new i.HashTable,this.ruleShortNameIdx=256,this.tokenMatcher=f.tokenStructuredMatcherNoCategories,this.LAST_EXPLICIT_RULE_STACK=[],this.selfAnalysisDone=!1,this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1,a.isArray(t)){if(a.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: http://sap.github.io/chevrotain/docs/changes/BREAKING_CHANGES.html#_4-0-0\n\tFor Further details.")}if(this.recoveryEnabled=a.has(e,"recoveryEnabled")?e.recoveryEnabled:R.recoveryEnabled,this.recoveryEnabled||(this.attemptInRepetitionRecovery=a.NOOP),this.dynamicTokensEnabled=a.has(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:R.dynamicTokensEnabled,this.maxLookahead=a.has(e,"maxLookahead")?e.maxLookahead:R.maxLookahead,this.ignoredIssues=a.has(e,"ignoredIssues")?e.ignoredIssues:R.ignoredIssues,this.outputCst=a.has(e,"outputCst")?e.outputCst:R.outputCst,this.errorMessageProvider=a.defaults(e.errorMessageProvider,R.errorMessageProvider),this.serializedGrammar=a.has(e,"serializedGrammar")?e.serializedGrammar:R.serializedGrammar,a.isES2015MapSupported()?(this.getLaFuncFromCache=this.getLaFuncFromMap,this.setLaFuncCache=this.setLaFuncCacheUsingMap):(this.getLaFuncFromCache=this.getLaFuncFromObj,this.setLaFuncCache=this.setLaFuncUsingObj),this.outputCst||(this.cstInvocationStateUpdate=a.NOOP,this.cstFinallyStateUpdate=a.NOOP,this.cstPostTerminal=a.NOOP,this.cstPostNonTerminal=a.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),this.className=i.classNameFromInstance(this),a.isArray(t))this.tokensMap=a.reduce(t,function(t,e){return t[c.tokenName(e)]=e,t},{});else if(a.has(t,"modes")&&a.every(a.flatten(a.values(t.modes)),f.isTokenType)){var n=a.flatten(a.values(t.modes)),r=a.uniq(n);this.tokensMap=a.reduce(r,function(t,e){return t[c.tokenName(e)]=e,t},{})}else{if(!a.isObject(t))throw new Error(" argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap=a.cloneObj(t)}var o=a.every(a.values(t),function(t){return a.isEmpty(t.categoryMatches)});this.tokenMatcher=o?f.tokenStructuredMatcherNoCategories:f.tokenStructuredMatcher,this.tokensMap.EOF=c.EOF,f.augmentTokenTypes(a.values(this.tokensMap))}return t.performSelfAnalysis=function(t){t.performSelfAnalysis()},t.prototype.performSelfAnalysis=function(){var e,n=this;this.selfAnalysisDone=!0;var r=i.classNameFromInstance(this),o=this.gastProductionsCache;if(this.serializedGrammar){var c=p.deserializeGrammar(this.serializedGrammar,this.tokensMap);a.forEach(c,function(t){n.gastProductionsCache.put(t.name,t)})}var u=A.resolveGrammar({rules:o.values()});if(this.definitionErrors.push.apply(this.definitionErrors,u),a.isEmpty(u)){var l=A.validateGrammar({rules:o.values(),maxLookahead:this.maxLookahead,tokenTypes:a.values(this.tokensMap),ignoredIssues:this.ignoredIssues,errMsgProvider:T.defaultGrammarValidatorErrorProvider,grammarName:r});this.definitionErrors.push.apply(this.definitionErrors,l)}if(a.isEmpty(this.definitionErrors)){var h=s.computeAllProdsFollows(o.values());this.resyncFollows=h}var f=d.analyzeCst(o.values(),this.fullRuleNameToShort);if(this.allRuleNames=f.allRuleNames,!t.DEFER_DEFINITION_ERRORS_HANDLING&&!a.isEmpty(this.definitionErrors))throw e=a.map(this.definitionErrors,function(t){return t.message}),new Error("Parser Definition Errors detected:\n "+e.join("\n-------------------------------\n"))},Object.defineProperty(t.prototype,"errors",{get:function(){return a.cloneArr(this._errors)},set:function(t){this._errors=t},enumerable:!0,configurable:!0}),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.prototype.isAtEndOfInput=function(){return this.tokenMatcher(this.LA(1),c.EOF)},t.prototype.getBaseCstVisitorConstructor=function(){if(a.isUndefined(this.baseCstVisitorConstructor)){var t=m.createBaseSemanticVisitorConstructor(this.className,this.allRuleNames);return this.baseCstVisitorConstructor=t,t}return this.baseCstVisitorConstructor},t.prototype.getBaseCstVisitorConstructorWithDefaults=function(){if(a.isUndefined(this.baseCstVisitorWithDefaultsConstructor)){var t=m.createBaseVisitorConstructorWithDefaults(this.className,this.allRuleNames,this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=t,t}return this.baseCstVisitorWithDefaultsConstructor},t.prototype.getGAstProductions=function(){return this.gastProductionsCache},t.prototype.getSerializedGastProductions=function(){return y.serializeGrammar(this.gastProductionsCache.values())},t.prototype.computeContentAssist=function(t,e){var n=this.gastProductionsCache.get(t);if(a.isUndefined(n))throw Error("Rule ->"+t+"<- does not exist in this grammar.");return l.nextPossibleTokensAfter([n],e,this.tokenMatcher,this.maxLookahead)},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(r.isRecognitionException(t))return!1;throw t}finally{this.reloadRecogState(n),this.isBackTrackingStack.pop()}}},t.prototype.SAVE_ERROR=function(t){if(r.isRecognitionException(t))return t.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:a.cloneArr(this.RULE_OCCURRENCE_STACK)},this._errors.push(t),t;throw Error("Trying to save an Error which is not a RecognitionException")},t.prototype.isBackTracking=function(){return!a.isEmpty(this.isBackTrackingStack)},t.prototype.getCurrRuleFullName=function(){var t=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull.get(t)},t.prototype.shortRuleNameToFullName=function(t){return this.shortRuleNameToFull.get(t)},t.prototype.getHumanReadableRuleStack=function(){var t=this;return a.isEmpty(this.LAST_EXPLICIT_RULE_STACK)?a.map(this.RULE_STACK,function(e){return t.shortRuleNameToFullName(e)}):a.map(this.LAST_EXPLICIT_RULE_STACK,function(e){return t.shortRuleNameToFullName(t.RULE_STACK[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=g),a.contains(this.definedRulesNames,t)){var r={message:T.defaultGrammarValidatorErrorProvider.buildDuplicateRuleNameError({topLevelRule:t,grammarName:this.className}),type:N.DUPLICATE_RULE_NAME,ruleName:t};this.definitionErrors.push(r)}if(this.definedRulesNames.push(t),!this.gastProductionsCache.containsKey(t)&&!this.serializedGrammar){var i=p.buildTopProduction(e.toString(),t,this.tokensMap);this.gastProductionsCache.put(t,i)}var o=this.defineRule(t,e,n);return this[t]=o,o},t.prototype.OVERRIDE_RULE=function(t,e,n){void 0===n&&(n=g);var r=[];if(r=r.concat(o.validateRuleIsOverridden(t,this.definedRulesNames,this.className)),this.definitionErrors.push.apply(this.definitionErrors,r),!this.serializedGrammar){var i=p.buildTopProduction(e.toString(),t,this.tokensMap);this.gastProductionsCache.put(t,i)}var a=this.defineRule(t,e,n);return this[t]=a,a},t.prototype.getTokenToInsert=function(t){var e=c.createTokenInstance(t,"",NaN,NaN,NaN,NaN,NaN,NaN);return e.isInsertedInRecovery=!0,e},t.prototype.canTokenTypeBeInsertedInRecovery=function(t){return!0},t.prototype.ruleInvocationStateUpdate=function(t,e,n){this.RULE_OCCURRENCE_STACK.push(n),this.RULE_STACK.push(t),this.cstInvocationStateUpdate(e,t)},t.prototype.ruleFinallyStateUpdate=function(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),0===this.RULE_STACK.length&&!this.isAtEndOfInput()){var t=this.LA(1),e=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:t,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new r.NotAllInputParsedException(e,t))}},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.prototype.getCurrentGrammarPath=function(t,e){return{ruleStack:this.getHumanReadableRuleStack(),occurrenceStack:a.cloneArr(this.RULE_OCCURRENCE_STACK),lastTok:t,lastTokOccurrence:e}},t.prototype.getNextPossibleTokenTypes=function(t){var e=a.first(t.ruleStack),n=this.getGAstProductions().get(e);return new l.NextAfterTokenWalker(n,t).startWalking()},t.prototype.subruleInternal=function(t,e,n){var i;try{var o=void 0!==n?n.ARGS:void 0;return i=t.call(this,e,o),this.cstPostNonTerminal(i,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),i}catch(e){throw r.isRecognitionException(e)&&void 0!==e.partialCstResult&&(this.cstPostNonTerminal(e.partialCstResult,void 0!==n&&void 0!==n.LABEL?n.LABEL:t.ruleName),delete e.partialCstResult),e}},t.prototype.consumeInternal=function(t,e,n){var i;try{var o=this.LA(1);if(!0!==this.tokenMatcher(o,t)){var a=void 0,s=this.LA(0);throw a=void 0!==n&&n.ERR_MSG?n.ERR_MSG:this.errorMessageProvider.buildMismatchTokenMessage({expected:t,actual:o,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new r.MismatchedTokenException(a,o,s))}this.consumeToken(),i=o}catch(n){if(!this.recoveryEnabled||"MismatchedTokenException"!==n.name||this.isBackTracking())throw n;var c=this.getFollowsForInRuleRecovery(t,e);try{i=this.tryInRuleRecovery(t,c)}catch(t){throw t.name===v?n:t}}return this.cstPostTerminal(void 0!==n&&void 0!==n.LABEL?n.LABEL:t.tokenName,i),i},t.prototype.saveRecogState=function(){var t=this.errors,e=a.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.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 i,o=a.has(n,"resyncEnabled")?n.resyncEnabled:g.resyncEnabled,s=a.has(n,"recoveryValueFunc")?n.recoveryValueFunc:g.recoveryValueFunc,c=this.ruleShortNameIdx< 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.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking);var s,c=!0;i.isArray(t)?((s={modes:{}}).modes[r.DEFAULT_MODE]=i.cloneArr(t),s[r.DEFAULT_MODE]=r.DEFAULT_MODE):(c=!1,s=i.cloneObj(t)),this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(r.performRuntimeChecks(s,this.trackStartLines,this.config.lineTerminatorCharacters)),this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(r.performWarningRuntimeChecks(s,this.trackStartLines,this.config.lineTerminatorCharacters)),s.modes=s.modes?s.modes:{},i.forEach(s.modes,function(t,e){s.modes[e]=i.reject(t,function(t){return i.isUndefined(t)})});var u=i.keys(s.modes);if(i.forEach(s.modes,function(t,a){if(n.modes.push(a),n.lexerDefinitionErrors=n.lexerDefinitionErrors.concat(r.validatePatterns(t,u)),i.isEmpty(n.lexerDefinitionErrors)){o.augmentTokenTypes(t);var s=r.analyzeTokenTypes(t,{lineTerminatorCharacters:n.config.lineTerminatorCharacters,positionTracking:e.positionTracking,ensureOptimizations:e.ensureOptimizations,safeMode:e.safeMode});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}}),this.defaultMode=s.defaultMode,!i.isEmpty(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){var p=i.map(this.lexerDefinitionErrors,function(t){return t.message}).join("-----------------------\n");throw new Error("Errors detected in definition of Lexer:\n"+p)}if(i.forEach(this.lexerDefinitionWarning,function(t){i.PRINT_WARNING(t.message)}),r.SUPPORT_STICKY?(this.chopInput=i.IDENTITY,this.match=this.matchWithTest):(this.updateLastIndex=i.NOOP,this.match=this.matchWithExec),c&&(this.handleModes=i.NOOP),!1===this.trackStartLines&&(this.computeNewColumn=i.IDENTITY),!1===this.trackEndLines&&(this.updateTokenEndLineColumnLocation=i.NOOP),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else{if(!/onlyOffset/i.test(this.config.positionTracking))throw Error('Invalid config option: "'+this.config.positionTracking+'"');this.createTokenInstance=this.createOffsetOnlyToken}this.hasCustom?this.addToken=this.addTokenUsingPush:this.addToken=this.addTokenUsingMemberAccess;var l=i.reduce(this.canModeBeOptimized,function(t,e,n){return!1===e&&t.push(n),t},[]);if(e.ensureOptimizations&&!i.isEmpty(l))throw Error("Lexer Modes: < "+l.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.')}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,p,l,h,f,d,E,m=this,T=t,y=T.length,A=0,v=0,N=this.hasCustom?0:Math.floor(t.length/10),R=new Array(N),g=[],S=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0,_=r.cloneEmptyGroups(this.emptyGroups),L=this.trackStartLines,I=this.config.lineTerminatorsPattern,M=0,C=[],k=[],P=[],x=[];Object.freeze(x);var U,D=void 0,F=function(t){if(1===P.length&&void 0===t.tokenType.PUSH_MODE){var e="Unable to pop Lexer Mode after encountering Token ->"+t.image+"<- The Mode Stack is empty";g.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{P.pop();var n=i.last(P);C=m.patternIdxToConfig[n],k=m.charCodeToPatternIdxToConfig[n],M=C.length;var r=m.canModeBeOptimized[n]&&!1===m.config.safeMode;D=k&&r?function(t){var e=k[t];return void 0===e?x:e}:function(){return C}}};function b(t){P.push(t),k=this.charCodeToPatternIdxToConfig[t],C=this.patternIdxToConfig[t],M=C.length,M=C.length;var e=this.canModeBeOptimized[t]&&!1===this.config.safeMode;D=k&&e?function(t){var e=k[t];return void 0===e?x:e}:function(){return C}}for(b.call(this,e);Ac.length&&(c=a,U=V)}break}}if(null!==c){if(u=c.length,void 0!==(p=U.group)&&(l=U.tokenTypeIdx,h=this.createTokenInstance(c,A,l,U.tokenType,S,O,u),!1===p?v=this.addToken(R,v,h):_[p].push(h)),t=this.chopInput(t,u),A+=u,O=this.computeNewColumn(O,u),!0===L&&!0===U.canLineTerminator){var W=0,j=void 0,H=void 0;I.lastIndex=0;do{!0===(j=I.test(c))&&(H=I.lastIndex-1,W++)}while(j);0!==W&&(S+=W,O=u-H,this.updateTokenEndLineColumnLocation(h,p,H,W,S,O,u))}this.handleModes(U,F,b,h)}else{for(var X=A,z=S,$=O,q=!1;!q&&A"+T.charAt(X)+"<- at offset: "+X+", skipped "+(A-X)+" characters.",g.push({offset:X,line:z,column:$,length:f,message:d})}}return this.hasCustom||(R.length=v),{tokens:R,groups:_,errors:g}},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=0;I--){var M={idx:d,def:y.definition[I].definition.concat(a.drop(f)),ruleStack:E,occurrenceStack:m};l.push(M),l.push("EXIT_ALTERNATIVE")}else if(y instanceof u.Flat)l.push({idx:d,def:y.definition.concat(a.drop(f)),ruleStack:E,occurrenceStack:m});else{if(!(y instanceof u.Rule))throw Error("non exhaustive match");l.push(T(y,d,E,m))}}}else o&&a.last(l).idx<=c&&l.pop()}return p}},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){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(2),i=n(0),o=n(0),a=n(1),s=n(9),c=n(8),u=n(17);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 "+r.tokenName(e)+" <--")+" 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,i=t.name,c=o.first(e),u=c.idx,p=s.getProductionDslName(c),l=(n=c)instanceof a.Terminal?r.tokenName(n.terminalType):n instanceof a.NonTerminal?n.nonTerminalName:"",h="->"+p+"<- with numerical suffix: ->"+u+"<-\n "+(l?"and argument: ->"+l+"<-":"")+"\n appears more than once ("+e.length+" times) in the top level rule: ->"+i+"<-.\n "+(0===u?"Also note that numerical suffix 0 means "+p+" without any suffix.":"")+"\n To fix this make sure each usage of "+p+" "+(l?"with the argument: ->"+l+"<-":"")+"\n in the rule ->"+i+"<- has a different occurrence index (0-5), as that combination acts as a unique\n position key in the grammar, which is needed by the parsing engine.\n \n For further details see: https://sap.github.io/chevrotain/docs/FAQ.html#NUMERICAL_SUFFIXES \n ";return h=(h=h.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 inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\nhttps://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: <"+t.ambiguityIndices.join(" ,")+"> in inside <"+t.topLevelRule.name+"> Rule,\n<"+e+"> may appears as a prefix path in all these alternatives.\n";return i=i+"To Resolve this, try one of of the following: \n1. Refactor your grammar to be LL(K) for the current value of k (by default k=5)\n2. Increase the value of K for your grammar by providing a larger 'maxLookahead' value in the parser's config\n3. This issue can be ignored (if you know what you are doing...), see https://sap.github.io/chevrotain/documentation/"+u.VERSION.replace(/\./g,"_")+"/interfaces/iparserconfig.html#ignoredissues for more details\n"},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: ->"+r.tokenName(t.tokenType)+"<- it must match the pattern: ->"+t.expectedPattern.toString()+"<-"},buildEmptyAlternationError:function(t){return"Ambiguous empty alternative: <"+(t.emptyChoiceIdx+1)+"> in 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 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";Object.defineProperty(e,"__esModule",{value:!0}),e.VERSION="4.1.0"},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 p(t,e,n){this.name=o,this.message=t,this.token=e,this.previousToken=n,this.resyncedTokens=[]}function l(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=p,p.prototype=Error.prototype,e.NotAllInputParsedException=l,l.prototype=Error.prototype,e.EarlyExitException=h,h.prototype=Error.prototype},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(){var t;switch(this.popChar()){case"*":t={atLeast:0,atMost:1/0};break;case"+":t={atLeast:1,atMost:1/0};break;case"?":t={atLeast:0,atMost:1};break;case"{":var e=this.integerIncludingZero();switch(this.popChar()){case"}":t={atLeast:e,atMost:e};break;case",":var n;this.isDigit()?(n=this.integerIncludingZero(),t={atLeast:e,atMost:n}):t={atLeast:e,atMost:1/0},this.consumeChar("}")}c(t)}return c(t),"?"===this.peekChar(0)?(this.consumeChar("?"),t.greedy=!1):t.greedy=!0,t.type="Quantifier",t},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=l;break;case"S":t=l,e=!0;break;case"w":t=p;break;case"W":t=p,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=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 p=[o("_")].concat(u);for(e=o("a");e<=o("z");e++)p.push(e);for(e=o("A");e<=o("Z");e++)p.push(e);var l=[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.3.5"}})?r.apply(e,i):r)||(t.exports=o)},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(14),c=n(15),u=n(10),p=n(1),l=n(5);!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 p.Option)return o.OPTION;if(t instanceof p.Repetition)return o.REPETITION;if(t instanceof p.RepetitionMandatory)return o.REPETITION_MANDATORY;if(t instanceof p.RepetitionMandatoryWithSeparator)return o.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof p.RepetitionWithSeparator)return o.REPETITION_WITH_SEPARATOR;if(t instanceof p.Alternation)return o.ALTERNATION;throw Error("non exhaustive match")},e.buildLookaheadFuncForOr=function(t,e,n,r,i,o){var a=E(t,e,n);return o(a,r,y(a)?u.tokenStructuredMatcherNoCategories:u.tokenStructuredMatcher,i)},e.buildLookaheadFuncForOptionalProd=function(t,e,n,r,i,o){var a=m(t,e,i,n),s=y(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;os,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";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(4),s=n(23),c=n(1),u=n(5);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 p=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 c.Option||t instanceof c.Repetition||t instanceof c.RepetitionMandatory||t instanceof c.Alternation)r=new e({definition:t.definition,idx:t.idx});else{if(!(t instanceof c.RepetitionMandatoryWithSeparator||t instanceof c.RepetitionWithSeparator))throw Error("non exhaustive match");r=new e({definition:t.definition,idx:t.idx,separator:t.separator})}var i=[r],a=s.getKeyForAutomaticLookahead(this.ruleIdx,n,t.idx);this.result.push({def:i,key:a,name:t.name,orgProd:t})}},e.prototype.visitOption=function(t){this.collectNamedDSLMethod(t,c.Option,s.OPTION_IDX)},e.prototype.visitRepetition=function(t){this.collectNamedDSLMethod(t,c.Repetition,s.MANY_IDX)},e.prototype.visitRepetitionMandatory=function(t){this.collectNamedDSLMethod(t,c.RepetitionMandatory,s.AT_LEAST_ONE_IDX)},e.prototype.visitRepetitionMandatoryWithSeparator=function(t){this.collectNamedDSLMethod(t,c.RepetitionMandatoryWithSeparator,s.AT_LEAST_ONE_SEP_IDX)},e.prototype.visitRepetitionWithSeparator=function(t){this.collectNamedDSLMethod(t,c.RepetitionWithSeparator,s.MANY_SEP_IDX)},e.prototype.visitAlternation=function(t){var e=this;this.collectNamedDSLMethod(t,c.Alternation,s.OR_IDX);var n=t.definition.length>1;o.forEach(t.definition,function(r,i){if(!o.isUndefined(r.name)){var a=r.definition;a=n?[new c.Option({definition:r.definition})]:r.definition;var u=s.getKeyForAltIndex(e.ruleIdx,s.OR_IDX,t.idx,i);e.result.push({def:a,key:u,name:r.name,orgProd:r})}})},e}(u.GAstVisitor);e.NamedDSLMethodsCollectorVisitor=p,e.analyzeCst=function(t,e){var n={dictDef:new a.HashTable,allRuleNames:[]};return o.forEach(t,function(t){var r=e.get(t.name);n.allRuleNames.push(t.name);var i=new p(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";function r(t,e,n){return n|e|t}Object.defineProperty(e,"__esModule",{value:!0}),e.BITS_FOR_METHOD_IDX=4,e.BITS_FOR_OCCURRENCE_IDX=4,e.BITS_FOR_RULE_IDX=24,e.BITS_FOR_ALT_IDX=8,e.OR_IDX=1<{const e=t.CATEGORIES;return r.some(e,t=>r.includes(n,t))});return r.reject(a,t=>t.GROUP===i.SKIPPED)}(function(t){return t.reduce((t,e)=>{const n=new o;return e.accept(n),r.uniq(t.concat(n.actualTokens))},[])}(e),t);if(0!==n.length){const t=n.map(t=>t.tokenName);throw Error(`Redundant token definitions found: [ ${t.join(", ")} ]`)}},checkConfigKeys:function(t,e){(function(t,e){const n=r.difference(e,r.keys(t));if(!r.isEmpty(n))throw Error(`Useless configuration keys: [ ${n.join(", ")} ]`)})(t,e),function(t,e){const n=r.values(t).filter(e=>r.includes(e.CATEGORIES,t.CONFIG_KEY)).map(t=>t.tokenName),i=r.difference(n,e);if(!r.isEmpty(i))throw Error(`Missing configuration keys: [ ${i.join(", ")} ]`)}(t,e)}}},function(t,e,n){const{tokens:r,JDLLexer:i}=n(7),{parse:o,getSyntacticAutoCompleteSuggestions:a}=n(38),s=n(11);t.exports={tokens:r,JDLLexer:i,JDLParser:s,parse:o,getSyntacticAutoCompleteSuggestions: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(19),a=n(2),s=n(13),c=n(0),u=n(29),p=new o.RegExpParser,l="PATTERN";function h(t){var e=c.filter(t,function(t){return!c.has(t,l)});return{errors:c.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- missing static 'PATTERN' property",type:s.LexerDefinitionErrorType.MISSING_PATTERN,tokenTypes:[t]}}),valid:c.difference(t,e)}}function f(t){var e=c.filter(t,function(t){var e=t[l];return!(c.isRegExp(e)||c.isFunction(e)||c.has(e,"exec")||c.isString(e))});return{errors:c.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:s.LexerDefinitionErrorType.INVALID_PATTERN,tokenTypes:[t]}}),valid:c.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){n=c.defaults(n,{useSticky:e.SUPPORT_STICKY,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r","\n"]});var r=c.reject(t,function(t){return t[l]===s.Lexer.NA}),i=!1,o=c.map(r,function(t){var e=t[l];if(c.isRegExp(e)){var r=e.source;return 1===r.length&&"^"!==r&&"$"!==r&&"."!==r?r:2!==r.length||"\\"!==r[0]||c.contains(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],r[1])?n.useSticky?O(e):S(e):r[1]}if(c.isFunction(e))return i=!0,{exec:e};if(c.has(e,"exec"))return i=!0,e;if("string"==typeof e){if(1===e.length)return e;var o=e.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),a=new RegExp(o);return n.useSticky?O(a):S(a)}throw Error("non exhaustive match")}),p=c.map(r,function(t){return t.tokenTypeIdx}),h=c.map(r,function(t){var e=t.GROUP;if(e!==s.Lexer.SKIPPED){if(c.isString(e))return e;if(c.isUndefined(e))return!1;throw Error("non exhaustive match")}}),f=c.map(r,function(t){var e=t.LONGER_ALT;if(e)return c.indexOf(r,e)}),d=c.map(r,function(t){return t.PUSH_MODE}),E=c.map(r,function(t){return c.has(t,"POP_MODE")}),m=C(n.lineTerminatorCharacters),T=c.map(r,function(t){return!1});"onlyOffset"!==n.positionTracking&&(T=c.map(r,function(t){return c.has(t,"LINE_BREAKS")?t.LINE_BREAKS:!1===I(t,m)?u.canMatchCharCode(m,t.PATTERN):void 0}));var y=c.map(r,_),A=c.map(o,L),v=c.reduce(r,function(t,e){var n=e.GROUP;return c.isString(n)&&n!==s.Lexer.SKIPPED&&(t[n]=[]),t},{}),N=c.map(o,function(t,e){return{pattern:o[e],longerAlt:f[e],canLineTerminator:T[e],isCustom:y[e],short:A[e],group:h[e],push:d[e],pop:E[e],tokenTypeIdx:p[e],tokenType:r[e]}});function R(t,e,n){void 0===t[e]&&(t[e]=[]),t[e].push(n)}var g=!0,M=[];return n.safeMode||(M=c.reduce(r,function(t,e,r){if("string"==typeof e.PATTERN){var i=e.PATTERN.charCodeAt(0);R(t,i,N[r])}else if(c.isArray(e.START_CHARS_HINT))c.forEach(e.START_CHARS_HINT,function(e){var n="string"==typeof e?e.charCodeAt(0):e;R(t,n,N[r])});else if(c.isRegExp(e.PATTERN))if(e.PATTERN.unicode)g=!1,n.ensureOptimizations&&c.PRINT_ERROR(u.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 o=u.getStartCodes(e.PATTERN,n.ensureOptimizations);c.isEmpty(o)&&(g=!1),c.forEach(o,function(e){R(t,e,N[r])})}else n.ensureOptimizations&&c.PRINT_ERROR(u.failedOptimizationPrefixMsg+"\tTokenType: <"+a.tokenName(e)+"> is using a custom token pattern without providing 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"),g=!1;return t},[])),g&&M.length<65536&&(M=c.packArray(M)),{emptyGroups:v,patternIdxToConfig:N,charCodeToPatternIdxToConfig:M,hasCustom:i,canBeOptimized:g}},e.validatePatterns=function(t,e){var n=[],r=h(t);n=n.concat(r.errors);var i=f(r.valid),o=i.valid;return n=(n=(n=(n=(n=n.concat(i.errors)).concat(function(t){var e=[],n=c.filter(t,function(t){return c.isRegExp(t[l])});return e=(e=(e=(e=(e=e.concat(E(n))).concat(y(n))).concat(A(n))).concat(v(n))).concat(m(n))}(o))).concat(N(o))).concat(R(o,e))).concat(g(o))},e.findMissingPatterns=h,e.findInvalidPatterns=f;var d=/[^\\][\$]/;function E(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=c.filter(t,function(t){var n=t[l];try{var r=p.pattern(n.toString()),i=new e;return i.visit(r),i.found}catch(t){return d.test(n.source)}});return c.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+a.tokenName(t)+"<- static 'PATTERN' cannot contain end of input anchor '$'\n\tSee sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#ANCHORS\tfor details.",type:s.LexerDefinitionErrorType.EOI_ANCHOR_FOUND,tokenTypes:[t]}})}function m(t){var e=c.filter(t,function(t){return t[l].test("")});return c.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' must not match an empty string",type:s.LexerDefinitionErrorType.EMPTY_MATCH_PATTERN,tokenTypes:[t]}})}e.findEndOfInputAnchor=E,e.findEmptyMatchRegExps=m;var T=/[^\\[][\^]|^\^/;function y(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=c.filter(t,function(t){var n=t[l];try{var r=p.pattern(n.toString()),i=new e;return i.visit(r),i.found}catch(t){return T.test(n.source)}});return c.map(n,function(t){return{message:"Unexpected RegExp Anchor Error:\n\tToken Type: ->"+a.tokenName(t)+"<- static 'PATTERN' cannot contain start of input anchor '^'\n\tSee https://github.com/SAP/chevrotain/blob/master/docs/resolving_lexer_errors.md#ANCHORS\n\tfor details.",type:s.LexerDefinitionErrorType.SOI_ANCHOR_FOUND,tokenTypes:[t]}})}function A(t){var e=c.filter(t,function(t){var e=t[l];return e instanceof RegExp&&(e.multiline||e.global)});return c.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:s.LexerDefinitionErrorType.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[t]}})}function v(t){var e=[],n=c.map(t,function(n){return c.reduce(t,function(t,r){return n.PATTERN.source!==r.PATTERN.source||c.contains(e,r)||r.PATTERN===s.Lexer.NA?t:(e.push(r),t.push(r),t)},[])});n=c.compact(n);var r=c.filter(n,function(t){return t.length>1});return c.map(r,function(t){var e=c.map(t,function(t){return a.tokenName(t)});return{message:"The same RegExp pattern ->"+c.first(t).PATTERN+"<-has been used in all of the following Token Types: "+e.join(", ")+" <-",type:s.LexerDefinitionErrorType.DUPLICATE_PATTERNS_FOUND,tokenTypes:t}})}function N(t){var e=c.filter(t,function(t){if(!c.has(t,"GROUP"))return!1;var e=t.GROUP;return e!==s.Lexer.SKIPPED&&e!==s.Lexer.NA&&!c.isString(e)});return c.map(e,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:s.LexerDefinitionErrorType.INVALID_GROUP_TYPE_FOUND,tokenTypes:[t]}})}function R(t,e){var n=c.filter(t,function(t){return void 0!==t.PUSH_MODE&&!c.contains(e,t.PUSH_MODE)});return c.map(n,function(t){return{message:"Token Type: ->"+a.tokenName(t)+"<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->"+t.PUSH_MODE+"<-which does not exist",type:s.LexerDefinitionErrorType.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[t]}})}function g(t){var e=[],n=c.reduce(t,function(t,e,n){var r,i=e.PATTERN;return i===s.Lexer.NA?t:(c.isString(i)?t.push({str:i,idx:n,tokenType:e}):c.isRegExp(i)&&(r=i,void 0===c.find([".","\\","[","]","|","^","$","(",")","?","*","+","{"],function(t){return-1!==r.source.indexOf(t)}))&&t.push({str:i.source,idx:n,tokenType:e}),t)},[]);return c.forEach(t,function(t,r){c.forEach(n,function(n){var i=n.str,o=n.idx,u=n.tokenType;if(r"+a.tokenName(t)+"<-in the lexer's definition.\nSee https://sap.github.io/chevrotain/docs/guide/resolving_lexer_errors.html#UNREACHABLE";e.push({message:p,type:s.LexerDefinitionErrorType.UNREACHABLE_PATTERN,tokenTypes:[t,u]})}})}),e}function S(t){var e=t.ignoreCase?"i":"";return new RegExp("^(?:"+t.source+")",e)}function O(t){var e=t.ignoreCase?"iy":"y";return new RegExp(""+t.source,e)}function _(t){var e=t.PATTERN;if(c.isRegExp(e))return!1;if(c.isFunction(e))return!0;if(c.has(e,"exec"))return!0;if(c.isString(e))return!1;throw Error("non exhaustive match")}function L(t){return!(!c.isString(t)||1!==t.length)&&t.charCodeAt(0)}function I(t,e){if(c.has(t,"LINE_BREAKS"))return!1;if(c.isRegExp(t.PATTERN)){try{u.canMatchCharCode(e,t.PATTERN)}catch(t){return{issue:s.LexerDefinitionErrorType.IDENTIFY_TERMINATOR,errMsg:t.message}}return!1}if(c.isString(t.PATTERN))return!1;if(_(t))return{issue:s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}function M(t,e){if(e.issue===s.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===s.LexerDefinitionErrorType.CUSTOM_LINE_BREAK)return"Warning: A Custom Token Pattern should specify the 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 C(t){return c.map(t,function(t){return c.isString(t)&&t.length>0?t.charCodeAt(0):t})}e.findStartOfInputAnchor=y,e.findUnsupportedFlags=A,e.findDuplicatePatterns=v,e.findInvalidGroupType=N,e.findModesThatDoNotExist=R,e.findUnreachablePatterns=g,e.addStartOfInput=S,e.addStickyFlag=O,e.performRuntimeChecks=function(t,n,r){var i=[];return c.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:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),c.has(t,e.MODES)||i.push({message:"A MultiMode Lexer cannot be initialized without a <"+e.MODES+"> property in its definition\n",type:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),c.has(t,e.MODES)&&c.has(t,e.DEFAULT_MODE)&&!c.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:s.LexerDefinitionErrorType.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),c.has(t,e.MODES)&&c.forEach(t.modes,function(t,e){c.forEach(t,function(t,n){c.isUndefined(t)&&i.push({message:"A Lexer cannot be initialized using an undefined Token Type. Mode:<"+e+"> at index: <"+n+">\n",type:s.LexerDefinitionErrorType.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED})})}),i},e.performWarningRuntimeChecks=function(t,e,n){var r=[],i=!1,o=c.compact(c.flatten(c.mapValues(t.modes,function(t){return t}))),a=c.reject(o,function(t){return t[l]===s.Lexer.NA}),p=C(n);return e&&c.forEach(a,function(t){var e=I(t,p);if(!1!==e){var n={message:M(t,e),type:e.issue,tokenType:t};r.push(n)}else c.has(t,"LINE_BREAKS")?!0===t.LINE_BREAKS&&(i=!0):u.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:s.LexerDefinitionErrorType.NO_LINE_BREAKS_FLAGS}),r},e.cloneEmptyGroups=function(t){var e={},n=c.keys(t);return c.forEach(n,function(n){var r=t[n];if(!c.isArray(r))throw Error("non exhaustive match");e[n]=[]}),e},e.isCustomPattern=_,e.isShortPattern=L,e.LineTerminatorOptimizedTester={test:function(t){for(var e=t.length,n=this.lastIndex;n0)break}}return e;default:throw Error("non exhaustive match!")}}function p(t){var e=[];return a.forEach(t,function(t){e.push(t);var n=String.fromCharCode(t);n.toUpperCase()!==n?e.push(n.toUpperCase().charCodeAt(0)):n.toLowerCase()!==n&&e.push(n.toLowerCase().charCodeAt(0))}),e}function l(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})})}e.failedOptimizationPrefixMsg='Unable to use "first char" lexer optimizations:\n',e.getStartCodes=function(t,n){void 0===n&&(n=!1);try{var r=s.pattern(t.toString()),i=u(r.value);return r.flags.ignoreCase&&(i=p(i)),i}catch(r){if(r.message===c)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 l="";n&&(l="\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"+l)}}return[]},e.firstChar=u,e.applyIgnoreCase=p;var h=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){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===l(t,this.targetCharCodes)&&(this.found=!0):void 0!==l(t,this.targetCharCodes)&&(this.found=!0)},e}(o.BaseRegExpVisitor);e.canMatchCharCode=function(t,e){if(e instanceof RegExp){var n=s.pattern(e.toString()),r=new h(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(15),a=n(4),s=n(21),c=n(0),u=n(24),p=n(2),l=n(1),h=function(t){function e(e){var n=t.call(this)||this;return n.topProd=e,n.follows=new a.HashTable,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=f(t.referencedRule,t.idx)+this.topProd.name,i=e.concat(n),o=new l.Flat({definition:i}),a=s.first(o);this.follows.put(r,a)},e}(o.RestWalker);function f(t,e){return t.name+e+u.IN}e.ResyncFollowsWalker=h,e.computeAllProdsFollows=function(t){var e=new a.HashTable;return c.forEach(t,function(t){var n=new h(t).startWalking();e.putAll(n)}),e},e.buildBetweenProdsFollowPrefix=f,e.buildInProdFollowPrefix=function(t){return p.tokenName(t.terminalType)+t.idx+u.IN}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,i=n(32),o=n(0),a=n(1);!function(t){t[t.OPTION=0]="OPTION",t[t.OR=1]="OR",t[t.MANY=2]="MANY",t[t.MANY_SEP=3]="MANY_SEP",t[t.AT_LEAST_ONE=4]="AT_LEAST_ONE",t[t.AT_LEAST_ONE_SEP=5]="AT_LEAST_ONE_SEP",t[t.REF=6]="REF",t[t.TERMINAL=7]="TERMINAL",t[t.FLAT=8]="FLAT"}(r=e.ProdType||(e.ProdType={}));var s=/(?:\s*{\s*NAME\s*:\s*["'`]([\w$]*)["'`])?/,c=new RegExp(s.source.replace("{","").replace(")?","\\s*,)?")),u=/\.\s*CONSUME(\d+)?\s*\(\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,p=new RegExp(u.source,"g"),l=/\.\s*SUBRULE(\d+)?\s*\(\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,h=new RegExp(l.source,"g"),f=/\.\s*OPTION(\d+)?\s*\(/,d=new RegExp(f.source+s.source),E=new RegExp(f.source,"g"),m=/\.\s*MANY(\d+)?\s*\(/,T=new RegExp(m.source+s.source),y=new RegExp(m.source,"g"),A=/\s*SEP\s*:\s*(?:[a-zA-Z_$]\w*\s*\.\s*)*([a-zA-Z_$]\w*)/,v=new RegExp(/\.\s*MANY_SEP(\d+)?\s*\(\s*{/.source+c.source+A.source),N=new RegExp(v.source,"g"),R=new RegExp(/\.\s*AT_LEAST_ONE_SEP(\d+)?\s*\(\s*{/.source+c.source+A.source),g=new RegExp(R.source,"g"),S=/\.\s*AT_LEAST_ONE(\d+)?\s*\(/,O=new RegExp(S.source+s.source),_=new RegExp(S.source,"g"),L=/\.\s*OR(\d+)?\s*\(/,I=new RegExp(L.source+s.source),M=new RegExp(L.source,"g"),C=new RegExp(c.source+/\s*(ALT)\s*:/.source),k=new RegExp(C.source,"g");function P(t,n){switch(t.type){case r.AT_LEAST_ONE:return function(t,e){return x(O,new a.RepetitionMandatory({definition:[]}),t,e)}(t,n);case r.AT_LEAST_ONE_SEP:return function(t,e){return U(t,e,a.RepetitionMandatoryWithSeparator,R)}(t,n);case r.MANY_SEP:return function(t,e){return U(t,e,a.RepetitionWithSeparator,v)}(t,n);case r.MANY:return function(t,e){return x(T,new a.Repetition({definition:[]}),t,e)}(t,n);case r.OPTION:return function(t,e){return x(d,new a.Option({definition:[]}),t,e)}(t,n);case r.OR:return function(t,e){return x(I,new a.Alternation({definition:[]}),t,e)}(t,n);case r.FLAT:return function(t,e){var n=new a.Flat({definition:[]}),r=C.exec(t.text)[1];o.isUndefined(r)||(n.name=r);return D(n,t.range,e)}(t,n);case r.REF:return function(t){var e=l.exec(t.text),n=void 0===e[1]?0:parseInt(e[1],10),r=e[2];return new a.NonTerminal({nonTerminalName:r,idx:n})}(t);case r.TERMINAL:return function(t){var n=u.exec(t.text),r=void 0===n[1]?0:parseInt(n[1],10),i=n[2],o=e.terminalNameToConstructor[i];if(!o)throw Error("Terminal Token name: "+i+" not found\n\tSee: https://sap.github.io/chevrotain/docs/guide/resolving_grammar_errors.html#TERMINAL_NAME_NOT_FOUND\n\tFor Further details.");return new a.Terminal({terminalType:o,idx:r})}(t);default:throw Error("non exhaustive match")}}function x(t,e,n,r){var i=t.exec(n.text),a=void 0===i[1];e.idx=a?0:parseInt(i[1],10);var s=i[2];return o.isUndefined(s)||(e.name=s),D(e,n.range,r)}function U(t,n,r,i){var a=i.exec(t.text),s=void 0===a[1]?0:parseInt(a[1],10),c=a[3],u=e.terminalNameToConstructor[c];if(!u)throw Error("Separator Terminal Token name: "+c+" not found");var p=new r({definition:[],separator:u,idx:s}),l=a[2];return o.isUndefined(l)||(p.name=l),D(p,t.range,n)}function D(t,e,n){var r=F(e,n),i=o.sortBy(r,function(t){return t.range.start}),a=[];return o.forEach(i,function(t){a.push(P(t,n))}),t.definition=a,t}function F(t,e){return o.filter(e,function(n){var r=t.strictlyContainsRange(n.range),i=o.every(e,function(e){var r=e.range.strictlyContainsRange(n.range),i=e.range.isStrictlyContainedInRange(t);return!(r&&i)});return r&&i})}e.terminalNameToConstructor={},e.buildTopProduction=function(t,n,r){e.terminalNameToConstructor=r;var o=W(Y(K(" "+t)));return function(t,e,n,r){return D(new a.Rule({name:t,definition:[],orgText:r}),e,n)}(n,new i.Range(0,t.length+2),o,t)},e.buildProdGast=P,e.getDirectlyContainedRanges=F;var b=/\/\/.*/g,w=/\/\*([^*]|[\r\n]|(\*+([^*\/]|[\r\n])))*\*+\//g,B=/(NAME\s*:\s*)?"([^\\"]|\\([bfnrtv"\\\/]|u[0-9a-fA-F]{4}))*"/g,G=/(NAME\s*:\s*)?'([^\\']|\\([bfnrtv'\\\/]|u[0-9a-fA-F]{4}))*'/g;function K(t){return t.replace(b,"").replace(w,"")}function V(t,e){return void 0!==e?t:""}function Y(t){return t.replace(B,V).replace(G,V)}function W(t){var e=j(t),n=H(t),r=X(t),i=z(t),o=$(t),a=q(t),s=Z(t),c=Q(t);return[].concat(e,n,r,i,o,a,s,c)}function j(t){return nt(t,r.TERMINAL,p)}function H(t){return nt(t,r.REF,h)}function X(t){return rt(t,r.AT_LEAST_ONE,_)}function z(t){return rt(t,r.AT_LEAST_ONE_SEP,g)}function $(t){return rt(t,r.MANY,y)}function q(t){return rt(t,r.MANY_SEP,N)}function Z(t){return rt(t,r.OPTION,E)}function Q(t){var e=rt(t,r.OR,M),n=et(e);return e.concat(n)}e.removeComments=K,e.removeStringLiterals=Y,e.createRanges=W,e.createTerminalRanges=j,e.createRefsRanges=H,e.createAtLeastOneRanges=X,e.createAtLeastOneSepRanges=z,e.createManyRanges=$,e.createManySepRanges=q,e.createOptionRanges=Z,e.createOrRanges=Q;var J=o.partial(ot,"{","}"),tt=o.partial(ot,"(",")");function et(t){var e=[];return o.forEach(t,function(t){var n=it(t.text,r.FLAT,k,J),i=t.range.start;o.forEach(n,function(t){t.range.start+=i,t.range.end+=i}),e=e.concat(n)}),o.uniq(e,function(t){return t.type+"~"+t.range.start+"~"+t.range.end+"~"+t.text})}function nt(t,e,n){for(var r,o=[];r=n.exec(t);){var a=r.index,s=n.lastIndex,c=new i.Range(a,s),u=r[0];o.push({range:c,text:u,type:e})}return o}function rt(t,e,n){return it(t,e,n,tt)}function it(t,e,n,r){for(var o,a=[];o=n.exec(t);){var s=o.index,c=r(s+o[0].length,t),u=new i.Range(s,c),p=t.substr(s,c-s+1);a.push({range:u,text:p,type:e})}return a}function ot(t,e,n,r){for(var i=[1],a=-1;!o.isEmpty(i)&&a+n=t},t.prototype.containsRange=function(t){return this.start<=t.start&&this.end>=t.end},t.prototype.isContainedInRange=function(t){return t.containsRange(this)},t.prototype.strictlyContainsRange=function(t){return this.startt.end},t.prototype.isStrictlyContainedInRange=function(t){return t.strictlyContainsRange(this)},t}();function i(t,e){return!(t<0||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 p=["constructor","visit","validateVisitor"];function l(t,e){var n=[];for(var s in t)a.validTermsPattern.test(s)&&i.isFunction(t[s])&&!i.contains(p,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=l},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(12),a=n(0),s=n(5);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(this.nameToTopRule.values(),function(e){t.currTopLevel=e,e.accept(t)})},e.prototype.visitNonTerminal=function(t){var e=this.nameToTopRule.get(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(17);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\n\n\n\n\n\n\n\n\n\n\n\n
\n\n\n\n\n' + ); + }; + }, + function(t, e, n) { + 'use strict'; + Object.defineProperty(e, '__esModule', { value: !0 }); + var r = n(37); + (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(3)); + }; + }), + (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(2), + o = n(1), + a = '\n'; + function s(t) { + return ( + '\nfunction ' + + t.name + + '(tokenVocabulary, config) {\n // invoke super constructor\n chevrotain.Parser.call(this, tokenVocabulary, config)\n\n const $ = this\n\n ' + + c(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.Parser.prototype)\n' + + t.name + + '.prototype.constructor = ' + + t.name + + ' \n ' + ); + } + function c(t) { + return r + .map(t, function(t) { + return u(t, 1); + }) + .join('\n'); + } + function u(t, e) { + var n = T(e, '$.RULE("' + t.name + '", function() {') + a; + return (n += m(t.definition, e + 1)), (n += T(e + 1, '})') + a); + } + function p(t, e) { + var n = i.tokenName(t.terminalType); + return T(e, '$.CONSUME' + t.idx + '(this.tokensMap.' + n + ')' + a); + } + function l(t, e) { + return T(e, '$.SUBRULE' + t.idx + '($.' + t.nonTerminalName + ')' + a); + } + function h(t, e) { + var n = T(e, '$.OR' + t.idx + '([') + a; + return ( + (n += r + .map(t.definition, function(t) { + return f(t, e + 1); + }) + .join(',' + a)), + (n += a + T(e, '])' + a)) + ); + } + function f(t, e) { + var n = T(e, '{') + a; + return ( + t.name && (n += T(e + 1, 'NAME: "' + t.name + '",') + a), + (n += T(e + 1, 'ALT: function() {') + a), + (n += m(t.definition, e + 1)), + (n += T(e + 1, '}') + a), + (n += T(e, '}')) + ); + } + function d(t, e, n) { + var r = T(n, '$.' + (t + e.idx) + '('); + return ( + e.name || e.separator + ? ((r += '{' + a), + e.name && (r += T(n + 1, 'NAME: "' + e.name + '"') + ',' + a), + e.separator && (r += T(n + 1, 'SEP: this.tokensMap.' + i.tokenName(e.separator)) + ',' + a), + (r += 'DEF: ' + E(e.definition, n + 2) + a), + (r += T(n, '}') + a)) + : (r += E(e.definition, n + 1)), + (r += T(n, ')') + a) + ); + } + function E(t, e) { + var n = 'function() {' + a; + return (n += m(t, e)), (n += T(e, '}') + a); + } + function m(t, e) { + var n = ''; + return ( + r.forEach(t, function(t) { + n += (function(t, e) { + if (t instanceof o.NonTerminal) return l(t, e); + if (t instanceof o.Option) return d('OPTION', t, e); + if (t instanceof o.RepetitionMandatory) return d('AT_LEAST_ONE', t, e); + if (t instanceof o.RepetitionMandatoryWithSeparator) return d('AT_LEAST_ONE_SEP', t, e); + if (t instanceof o.RepetitionWithSeparator) return d('MANY_SEP', t, e); + if (t instanceof o.Repetition) return d('MANY', t, e); + if (t instanceof o.Alternation) return h(t, e); + if (t instanceof o.Terminal) return p(t, e); + if (t instanceof o.Flat) return m(t.definition, e); + throw Error('non exhaustive match'); + })(t, e + 1); + }), + n + ); + } + function T(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" + + s(t) + + '\n \nreturn {\n ' + + t.name + + ': ' + + t.name + + ' \n}\n}));\n' + ); + }), + (e.genWrapperFunction = function(t) { + return ' \n' + s(t) + '\nreturn new ' + t.name + '(tokenVocabulary, config) \n'; + }), + (e.genClass = s), + (e.genAllRules = c), + (e.genRule = u), + (e.genTerminal = p), + (e.genNonTerminal = l), + (e.genAlternation = h), + (e.genSingleAlt = f); + }, + function(t, e, n) { + const r = n(6), + { EOF: i } = n(3), + { JDLLexer: o, tokens: a } = n(7), + s = n(11), + { performAdditionalSyntaxChecks: c } = n(39), + { buildAst: u } = n(41), + { checkTokens: p } = n(26); + t.exports = { + parse: function(t, e = 'prog') { + const n = o.tokenize(t); + if (n.errors.length > 0) throw Error(n.errors[0].message); + l.input = n.tokens; + const r = l[e](); + l.errors.length > 0 && + (function(t) { + const e = t[0], + n = `${e.name}: ${e.message}`, + r = e.token, + o = r.tokenType !== i ? `\n\tat line: ${r.startLine}, column: ${r.startColumn}` : ''; + throw Error(`${n}${o}`); + })(l.errors); + const a = c(r); + a.length > 0 && + (function(t) { + throw Error( + t.map(t => `${t.message}\n\tat line: ${t.token.startLine}, column: ${t.token.startColumn}`).join('\n') + ); + })(a); + return u(r); + }, + getSyntacticAutoCompleteSuggestions: function(t, e = 'prog') { + const n = o.tokenize(t); + l.input = n.tokens; + const i = l.computeContentAssist(e, n.tokens); + return r.uniq(i.map(t => t.nextTokenType)); + } + }; + const l = s.getParser(); + l.parse(); + const h = l.getGAstProductions().values(); + p(r.values(a), h); + }, + function(t, e, n) { + const r = n(6), + i = n(3).tokenMatcher, + o = n(11), + a = n(7).tokens, + s = n(26).checkConfigKeys, + c = /^[A-Z_]+$/, + u = /^[A-Z][A-Za-z0-9]*$/, + p = /^[A-Z][A-Za-z0-9]*$/, + l = /^[A-Z][A-Za-z0-9]*$/, + h = /^[A-Z][A-Za-z0-9_]*$/, + f = /^[A-Za-z][A-Za-z0-9-]*$/, + d = /^[a-z]+$/, + E = /^[A-Za-z][A-Za-z0-9]*$/, + m = /^[a-z]+(-[A-Za-z0-9]+)*$/, + T = { + APPLICATION_TYPE: { type: 'NAME', pattern: d, msg: 'applicationType property' }, + AUTHENTICATION_TYPE: { type: 'NAME', pattern: E, msg: 'authenticationType property' }, + BASE_NAME: { type: 'NAME', pattern: E, msg: 'baseName property' }, + BUILD_TOOL: { type: 'NAME', pattern: E, msg: 'buildTool property' }, + CACHE_PROVIDER: { type: 'NAME', pattern: E, msg: 'cacheProvider property' }, + CLIENT_FRAMEWORK: { type: 'NAME', pattern: E, msg: 'clientFramework property' }, + CLIENT_PACKAGE_MANAGER: { type: 'NAME', pattern: E, msg: 'clientPackageManager property' }, + DATABASE_TYPE: { type: 'NAME', pattern: E, msg: 'databaseType property' }, + DEV_DATABASE_TYPE: { type: 'NAME', pattern: E, msg: 'devDatabaseType property' }, + ENABLE_HIBERNATE_CACHE: { type: 'BOOLEAN' }, + ENABLE_SWAGGER_CODEGEN: { type: 'BOOLEAN' }, + ENABLE_TRANSLATION: { type: 'BOOLEAN' }, + FRONT_END_BUILDER: { type: 'NAME', pattern: /^[A-Za-z]+$/, msg: 'frontendBuilder property' }, + JHIPSTER_VERSION: { type: 'STRING' }, + JHI_PREFIX: { type: 'NAME', pattern: /^[A-Za-z][A-Za-z0-9-_]*$/, msg: 'jhiPrefix property' }, + LANGUAGES: { type: 'list', pattern: m, msg: 'languages property' }, + MESSAGE_BROKER: { type: 'NAME', pattern: E, msg: 'messageBroker property' }, + NATIVE_LANGUAGE: { type: 'NAME', pattern: m, msg: 'nativeLanguage property' }, + PACKAGE_NAME: { type: 'qualifiedName', pattern: d, msg: 'packageName property' }, + PROD_DATABASE_TYPE: { type: 'NAME', pattern: E, msg: 'prodDatabaseType property' }, + SEARCH_ENGINE: { type: 'NAME', pattern: E, msg: 'searchEngine property' }, + SERVER_PORT: { type: 'INTEGER' }, + SERVICE_DISCOVERY_TYPE: { type: 'NAME', pattern: E, msg: 'serviceDiscoveryType property' }, + SKIP_CLIENT: { type: 'BOOLEAN' }, + SKIP_SERVER: { type: 'BOOLEAN' }, + SKIP_USER_MANAGEMENT: { type: 'BOOLEAN' }, + TEST_FRAMEWORKS: { type: 'list', pattern: E, msg: 'testFrameworks property' }, + UAA_BASE_NAME: { type: 'STRING' }, + USE_SASS: { type: 'BOOLEAN' }, + WEBSOCKET: { type: 'NAME', pattern: /^[A-Za-z][A-Za-z0-9-]*$/, msg: 'websocket property' } + }; + t.exports = { + performAdditionalSyntaxChecks: function(t) { + const e = new v(); + return e.visit(t), e.errors; + } + }; + const y = o.getParser(); + y.parse(); + const A = y.getBaseCstVisitorConstructorWithDefaults(); + class v extends A { + constructor() { + super(), this.validateVisitor(), (this.errors = []); + } + checkNameSyntax(t, e, n) { + var r; + e.test(t.image) || + this.errors.push({ + message: `The ${n} name must match: ${((r = e.toString()), r.replace(/^\^/, '').replace(/\$$/, ''))}`, + token: t + }); + } + checkIsSingleName(t) { + if (t.tokenType && t.tokenType.CATEGORIES.includes(a.BOOLEAN)) return !1; + const e = t.children.DOT; + return ( + !(e && e.length >= 1) || + (this.errors.push({ message: 'A single name is expected, but found a fully qualified name.', token: N(t) }), + !1) + ); + } + checkExpectedValueType(t, e) { + switch (t) { + case 'NAME': + return 'qualifiedName' !== e.name && e.tokenType && !r.includes(e.tokenType.CATEGORIES, a.BOOLEAN) + ? (this.errors.push({ message: `A name is expected, but found: "${N(e).image}"`, token: N(e) }), !1) + : this.checkIsSingleName(e); + case 'qualifiedName': + return ( + 'qualifiedName' === e.name || + (this.errors.push({ + message: `A fully qualified name is expected, but found: "${N(e).image}"`, + token: N(e) + }), + !1) + ); + case 'list': + return ( + 'list' === e.name || + (this.errors.push({ + message: `An array of names is expected, but found: "${N(e).image}"`, + token: N(e) + }), + !1) + ); + case 'INTEGER': + return ( + e.tokenType === a.INTEGER || + (this.errors.push({ + message: `An integer literal is expected, but found: "${N(e).image}"`, + token: N(e) + }), + !1) + ); + case 'STRING': + return ( + e.tokenType === a.STRING || + (this.errors.push({ message: `A string literal is expected, but found: "${N(e).image}"`, token: N(e) }), + !1) + ); + case 'BOOLEAN': + return ( + !!i(e, a.BOOLEAN) || + (this.errors.push({ + message: `A boolean literal is expected, but found: "${N(e).image}"`, + token: N(e) + }), + !1) + ); + default: + throw Error(`Expected a boolean, a string, an integer, a list or a (qualified) name, got '${t}'.`); + } + } + checkConfigPropSyntax(t, e) { + const n = t.tokenType.tokenName, + r = T[n]; + if (!r) throw Error(`Got an invalid application config property: '${n}'.`); + this.checkExpectedValueType(r.type, e) && + r.pattern && + e.children.NAME && + e.children.NAME.forEach(t => this.checkNameSyntax(t, r.pattern, r.msg)); + } + constantDeclaration(t) { + super.constantDeclaration(t), this.checkNameSyntax(t.NAME[0], c, 'constant'); + } + entityDeclaration(t) { + super.entityDeclaration(t), this.checkNameSyntax(t.NAME[0], u, 'entity'); + } + fieldDeclaration(t) { + super.fieldDeclaration(t), this.checkNameSyntax(t.NAME[0], E, 'fieldName'); + } + type(t) { + super.type(t), this.checkNameSyntax(t.NAME[0], p, 'typeName'); + } + minMaxValidation(t) { + super.minMaxValidation(t), t.NAME && this.checkNameSyntax(t.NAME[0], c, 'constant'); + } + relationshipSide(t) { + super.relationshipSide(t), + this.checkNameSyntax(t.NAME[0], u, 'entity'), + t.injectedField && + (this.checkNameSyntax(t.injectedField[0], E, 'injectedField'), + t.injectedFieldParam && this.checkNameSyntax(t.injectedFieldParam[0], E, 'injectedField')); + } + enumDeclaration(t) { + super.enumDeclaration(t), this.checkNameSyntax(t.NAME[0], l, 'enum'); + } + enumPropList(t) { + super.enumPropList(t), + t.NAME.forEach(t => { + this.checkNameSyntax(t, h, 'enum property'); + }); + } + entityList(t) { + super.entityList(t), + t.NAME && + t.NAME.forEach(t => { + this.checkNameSyntax(t, u, 'entity'); + }), + t.method && this.checkNameSyntax(t.method[0], f, 'method'); + } + exclusion(t) { + super.exclusion(t), + t.NAME.forEach(t => { + this.checkNameSyntax(t, u, 'entity'); + }); + } + filterDef(t) { + t.NAME && + t.NAME.forEach(t => { + this.checkNameSyntax(t, u, 'entity'); + }); + } + applicationConfigDeclaration(t) { + this.visit(t.configValue, t.CONFIG_KEY[0]); + } + configValue(t, e) { + const n = r.first(r.first(r.values(t))); + this.checkConfigPropSyntax(e, n); + } + } + function N(t) { + return t.tokenType + ? t + : r + .flatten(r.values(t.children)) + .reduce((t, e) => (t.startOffset > e.startOffset ? e : t), { startOffset: 1 / 0 }); + } + s(a, r.keys(T)); + }, + function(t, e, n) { + const r = n(3).GAstVisitor; + t.exports = class extends r { + constructor() { + super(), (this.actualTokens = []); + } + visitTerminal(t) { + this.actualTokens.push(t.terminalType); + } + visitRepetitionMandatoryWithSeparator(t) { + this.actualTokens.push(t.separator); + } + visitRepetitionWithSeparator(t) { + this.actualTokens.push(t.separator); + } + }; + }, + function(t, e, n) { + const r = n(6), + i = n(11); + t.exports = { + buildAst: function(t) { + return p.visit(t); + } + }; + const o = i.getParser(); + o.parse(); + const a = o.getBaseCstVisitorConstructor(); + function s(t, e) { + const n = e.visit(t.entityList), + i = r.last(n), + o = r.dropRight(n); + let a; + return t.exclusion && (a = e.visit(t.exclusion)), { name: i, list: o, excluded: a }; + } + function c(t, e, n) { + n || (n = 'list'); + const r = e.visit(t.filterDef); + let i; + t.exclusion && (i = e.visit(t.exclusion)); + const o = { excluded: i }; + return (o[n] = r), o; + } + function u(t) { + return t.replace(/^\/[*]+/, '').replace(/[*]+\/$/, ''); + } + const p = new class extends a { + constructor() { + super(), this.validateVisitor(); + } + prog(t) { + const e = { + applications: [], + constants: {}, + entities: [], + relationships: [], + enums: [], + dto: {}, + pagination: {}, + service: {}, + microservice: {}, + searchEngine: {}, + noClient: { list: [], excluded: [] }, + noServer: { list: [], excluded: [] }, + filter: { list: [], excluded: [] }, + angularSuffix: {}, + noFluentMethod: { list: [], excluded: [] }, + clientRootFolder: {} + }; + return ( + t.constantDeclaration && + t.constantDeclaration.map(this.visit, this).forEach(t => { + e.constants[t.name] = t.value; + }), + t.applicationDeclaration && (e.applications = t.applicationDeclaration.map(this.visit, this)), + t.entityDeclaration && (e.entities = t.entityDeclaration.map(this.visit, this)), + t.relationDeclaration && (e.relationships = r.flatMap(t.relationDeclaration, t => this.visit(t))), + t.enumDeclaration && (e.enums = t.enumDeclaration.map(this.visit, this)), + r.forEach( + { + dtoDeclaration: 'dto', + paginationDeclaration: 'pagination', + serviceDeclaration: 'service', + microserviceDeclaration: 'microservice', + searchEngineDeclaration: 'searchEngine', + angularSuffixDeclaration: 'angularSuffix', + noFluentMethod: 'noFluentMethod', + filterDeclaration: 'filter', + clientRootFolderDeclaration: 'clientRootFolder', + noClientDeclaration: 'noClient', + noServerDeclaration: 'noServer', + filter: 'filter' + }, + (n, i) => { + t[i] && + t[i].map(this.visit, this).forEach(t => { + let i; + t.name + ? e[n][t.name] + ? (i = e[n][t.name]) + : ((i = { list: t.list, excluded: [] }), (e[n][t.name] = i)) + : (i = e[n]), + (i.list = r.uniq(i.list.concat(t.list))), + t.excluded && (i.excluded = r.uniq(i.excluded.concat(t.excluded))); + }); + } + ), + e + ); + } + constantDeclaration(t) { + return { name: t.NAME[0].image, value: parseInt(t.INTEGER[0].image, 10) }; + } + entityDeclaration(t) { + const e = []; + t.simpleAnnotationDeclaration && + t.simpleAnnotationDeclaration.forEach(t => { + e.push(this.visit(t)); + }), + t.complexAnnotationDeclaration && + t.complexAnnotationDeclaration.forEach(t => { + e.push(this.visit(t)); + }); + let n = null; + t.COMMENT && (n = u(t.COMMENT[0].image)); + const r = t.NAME[0].image; + let i = r; + t.entityTableNameDeclaration && (i = this.visit(t.entityTableNameDeclaration)); + let o = []; + return ( + t.entityBody && (o = this.visit(t.entityBody)), + { annotations: e, name: r, tableName: i, body: o, javadoc: n } + ); + } + simpleAnnotationDeclaration(t) { + return { option: t.option[0].image, type: 'UNARY' }; + } + complexAnnotationDeclaration(t) { + return { option: t.option[0].image, method: t.value[0].image, type: 'BINARY' }; + } + entityTableNameDeclaration(t) { + return t.NAME[0].image; + } + entityBody(t) { + return r.map(t.fieldDeclaration, t => this.visit(t)); + } + fieldDeclaration(t) { + const e = t.COMMENT ? u(t.COMMENT[0].image) : null; + return { + name: t.NAME[0].image, + type: this.visit(t.type), + validations: t.validation ? r.map(t.validation, t => this.visit(t)) : [], + javadoc: e + }; + } + type(t) { + return t.NAME[0].image; + } + validation(t) { + return t.REQUIRED + ? { key: 'required', value: '' } + : t.UNIQUE + ? { key: 'unique', value: '' } + : t.minMaxValidation + ? this.visit(t.minMaxValidation) + : this.visit(t.pattern); + } + minMaxValidation(t) { + const e = !!t.NAME, + n = { key: t.MIN_MAX_KEYWORD[0].image, value: e ? t.NAME[0].image : parseInt(t.INTEGER[0].image, 10) }; + return e && (n.constant = !0), n; + } + pattern(t) { + const e = t.REGEX[0].image; + return { key: 'pattern', value: e.substring(1, e.length - 1) }; + } + relationDeclaration(t) { + const e = this.visit(t.relationshipType), + n = t.relationshipBody.map(this.visit, this); + return ( + n.forEach(t => { + t.cardinality = e; + }), + n + ); + } + relationshipType(t) { + if (t.ONE_TO_ONE) return 'one-to-one'; + if (t.ONE_TO_MANY) return 'one-to-many'; + if (t.MANY_TO_ONE) return 'many-to-one'; + if (t.MANY_TO_MANY) return 'many-to-many'; + throw new Error( + 'No valid relationship type found, expected a OneToOne, a OneToMany, a ManyToOne or a ManyToMany.' + ); + } + relationshipBody(t) { + return { from: this.visit(t.from), to: this.visit(t.to) }; + } + relationshipSide(t) { + const e = this.visit(t.comment), + n = t.NAME[0].image, + r = !!t.REQUIRED; + let i = null; + t.injectedField && + ((i = t.injectedField[0].image), t.injectedFieldParam && (i += `(${t.injectedFieldParam[0].image})`)); + const o = { name: n, injectedField: i, javadoc: e, required: r }; + return i || delete o.required, o; + } + enumDeclaration(t) { + return { name: t.NAME[0].image, values: this.visit(t.enumPropList) }; + } + enumPropList(t) { + return t.NAME.map(t => t.image); + } + dtoDeclaration(t) { + return s(t, this); + } + entityList(t) { + let e = []; + return ( + t.NAME && (e = t.NAME.map(t => t.image)), + (t.ALL || t.STAR) && e.push('*'), + e.push(t.method[0].image), + r.uniq(e) + ); + } + exclusion(t) { + return t.NAME.map(t => t.image, this); + } + paginationDeclaration(t) { + return s(t, this); + } + serviceDeclaration(t) { + return s(t, this); + } + microserviceDeclaration(t) { + return s(t, this); + } + searchEngineDeclaration(t) { + return s(t, this); + } + noClientDeclaration(t) { + return c(t, this); + } + noServerDeclaration(t) { + return c(t, this); + } + noFluentMethod(t) { + return c(t, this); + } + filterDeclaration(t) { + return c(t, this); + } + filterDef(t) { + let e = []; + return t.NAME && (e = t.NAME.map(t => t.image, this)), (t.ALL || t.STAR) && e.push('*'), r.uniq(e); + } + clientRootFolderDeclaration(t) { + return s(t, this); + } + angularSuffixDeclaration(t) { + return s(t, this); + } + comment(t) { + return t.COMMENT ? u(t.COMMENT[0].image) : null; + } + applicationDeclaration(t) { + return this.visit(t.applicationSubDeclaration); + } + applicationSubDeclaration(t) { + const e = { config: {}, entities: { entityList: [], excluded: [] } }; + return ( + t.applicationSubConfig && (e.config = this.visit(r.last(t.applicationSubConfig))), + t.applicationSubEntities && (e.entities = this.visit(r.last(t.applicationSubEntities))), + e + ); + } + applicationSubConfig(t) { + const e = {}; + return ( + t.applicationConfigDeclaration && + t.applicationConfigDeclaration.map(this.visit, this).forEach(t => { + (e[t.key] = t.value), + 'packageName' !== t.key || e.packageFolder || (e.packageFolder = t.value.replace(/[.]/g, '/')); + }), + e + ); + } + applicationSubEntities(t) { + const e = c(t, this, 'entityList'); + return e.excluded || (e.excluded = []), e; + } + applicationConfigDeclaration(t) { + return { key: t.CONFIG_KEY[0].image, value: this.visit(t.configValue) }; + } + configValue(t) { + if (t.qualifiedName) return this.visit(t.qualifiedName); + if (t.list) return this.visit(t.list); + if (t.INTEGER) return t.INTEGER[0].image; + if (t.STRING) { + const e = t.STRING[0].image; + return e.substring(1, e.length - 1); + } + if (t.BOOLEAN) return 'true' === t.BOOLEAN[0].image; + throw new Error( + 'No valid config value was found, expected a qualified name, a list, an integer, a string or a boolean.' + ); + } + qualifiedName(t) { + return t.NAME.map(t => t.image, this).join('.'); + } + list(t) { + return t.NAME ? t.NAME.map(t => t.image, this) : []; + } + }(); + } + ]); +});